Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: content/browser/renderer_host/resource_dispatcher_host_impl.cc

Issue 10701151: DuplicateContentResourceHandler to monitor resources and track how many times th… (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" 7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 17 matching lines...) Expand all
28 #include "content/browser/cross_site_request_manager.h" 28 #include "content/browser/cross_site_request_manager.h"
29 #include "content/browser/download/download_file_manager.h" 29 #include "content/browser/download/download_file_manager.h"
30 #include "content/browser/download/download_resource_handler.h" 30 #include "content/browser/download/download_resource_handler.h"
31 #include "content/browser/download/save_file_manager.h" 31 #include "content/browser/download/save_file_manager.h"
32 #include "content/browser/download/save_file_resource_handler.h" 32 #include "content/browser/download/save_file_resource_handler.h"
33 #include "content/browser/fileapi/chrome_blob_storage_context.h" 33 #include "content/browser/fileapi/chrome_blob_storage_context.h"
34 #include "content/browser/plugin_service_impl.h" 34 #include "content/browser/plugin_service_impl.h"
35 #include "content/browser/renderer_host/async_resource_handler.h" 35 #include "content/browser/renderer_host/async_resource_handler.h"
36 #include "content/browser/renderer_host/buffered_resource_handler.h" 36 #include "content/browser/renderer_host/buffered_resource_handler.h"
37 #include "content/browser/renderer_host/cross_site_resource_handler.h" 37 #include "content/browser/renderer_host/cross_site_resource_handler.h"
38 #include "content/browser/renderer_host/duplicate_resource_handler.h"
38 #include "content/browser/renderer_host/redirect_to_file_resource_handler.h" 39 #include "content/browser/renderer_host/redirect_to_file_resource_handler.h"
39 #include "content/browser/renderer_host/render_view_host_delegate.h" 40 #include "content/browser/renderer_host/render_view_host_delegate.h"
40 #include "content/browser/renderer_host/render_view_host_impl.h" 41 #include "content/browser/renderer_host/render_view_host_impl.h"
41 #include "content/browser/renderer_host/resource_message_filter.h" 42 #include "content/browser/renderer_host/resource_message_filter.h"
42 #include "content/browser/renderer_host/transfer_navigation_resource_throttle.h" 43 #include "content/browser/renderer_host/transfer_navigation_resource_throttle.h"
43 #include "content/browser/renderer_host/resource_request_info_impl.h" 44 #include "content/browser/renderer_host/resource_request_info_impl.h"
44 #include "content/browser/renderer_host/sync_resource_handler.h" 45 #include "content/browser/renderer_host/sync_resource_handler.h"
45 #include "content/browser/renderer_host/throttling_resource_handler.h" 46 #include "content/browser/renderer_host/throttling_resource_handler.h"
46 #include "content/browser/resource_context_impl.h" 47 #include "content/browser/resource_context_impl.h"
47 #include "content/browser/worker_host/worker_service_impl.h" 48 #include "content/browser/worker_host/worker_service_impl.h"
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 controller->GetBlobDataFromUrl(request->url())); 1006 controller->GetBlobDataFromUrl(request->url()));
1006 } 1007 }
1007 1008
1008 // Have the appcache associate its extra info with the request. 1009 // Have the appcache associate its extra info with the request.
1009 appcache::AppCacheInterceptor::SetExtraRequestInfo( 1010 appcache::AppCacheInterceptor::SetExtraRequestInfo(
1010 request, ResourceContext::GetAppCacheService(resource_context), child_id, 1011 request, ResourceContext::GetAppCacheService(resource_context), child_id,
1011 request_data.appcache_host_id, request_data.resource_type); 1012 request_data.appcache_host_id, request_data.resource_type);
1012 1013
1013 // Construct the IPC resource handler. 1014 // Construct the IPC resource handler.
1014 scoped_ptr<ResourceHandler> handler; 1015 scoped_ptr<ResourceHandler> handler;
1016
gavinp 2012/07/18 12:13:32 Lose this blank line.
frankwang 2012/07/19 16:10:26 Done.
1015 if (sync_result) { 1017 if (sync_result) {
1016 handler.reset(new SyncResourceHandler( 1018 handler.reset(new SyncResourceHandler(
1017 filter_, request, sync_result, this)); 1019 filter_, request, sync_result, this));
1018 } else { 1020 } else {
1019 handler.reset(new AsyncResourceHandler( 1021 handler.reset(new AsyncResourceHandler(
1020 filter_, route_id, request, this)); 1022 filter_, route_id, request, this));
1021 } 1023 }
1022 1024
1023 // The RedirectToFileResourceHandler depends on being next in the chain. 1025 // The RedirectToFileResourceHandler depends on being next in the chain.
1024 if (request_data.download_to_file) { 1026 if (request_data.download_to_file) {
(...skipping 12 matching lines...) Expand all
1037 // Wrap the event handler to be sure the current page's onunload handler 1039 // Wrap the event handler to be sure the current page's onunload handler
1038 // has a chance to run before we render the new page. 1040 // has a chance to run before we render the new page.
1039 handler.reset(new CrossSiteResourceHandler(handler.Pass(), child_id, 1041 handler.reset(new CrossSiteResourceHandler(handler.Pass(), child_id,
1040 route_id, request)); 1042 route_id, request));
1041 } 1043 }
1042 1044
1043 // Insert a buffered event handler before the actual one. 1045 // Insert a buffered event handler before the actual one.
1044 handler.reset( 1046 handler.reset(
1045 new BufferedResourceHandler(handler.Pass(), this, request)); 1047 new BufferedResourceHandler(handler.Pass(), this, request));
1046 1048
1049 handler.reset(
gavinp 2012/07/18 12:13:32 A short comment explaining what this resource hand
frankwang 2012/07/19 16:10:26 Done.
1050 new DuplicateResourceHandler(handler.Pass(), request_data.resource_type,
1051 request));
1052
1047 ScopedVector<ResourceThrottle> throttles; 1053 ScopedVector<ResourceThrottle> throttles;
1048 if (delegate_) { 1054 if (delegate_) {
1049 bool is_continuation_of_transferred_request = 1055 bool is_continuation_of_transferred_request =
1050 (deferred_loader.get() != NULL); 1056 (deferred_loader.get() != NULL);
1051 1057
1052 delegate_->RequestBeginning(request, 1058 delegate_->RequestBeginning(request,
1053 resource_context, 1059 resource_context,
1054 request_data.resource_type, 1060 request_data.resource_type,
1055 child_id, 1061 child_id,
1056 route_id, 1062 route_id,
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 1727
1722 return i->second.get(); 1728 return i->second.get();
1723 } 1729 }
1724 1730
1725 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id, 1731 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id,
1726 int request_id) const { 1732 int request_id) const {
1727 return GetLoader(GlobalRequestID(child_id, request_id)); 1733 return GetLoader(GlobalRequestID(child_id, request_id));
1728 } 1734 }
1729 1735
1730 } // namespace content 1736 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698