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

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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 controller->GetBlobDataFromUrl(request->url())); 1002 controller->GetBlobDataFromUrl(request->url()));
1002 } 1003 }
1003 1004
1004 // Have the appcache associate its extra info with the request. 1005 // Have the appcache associate its extra info with the request.
1005 appcache::AppCacheInterceptor::SetExtraRequestInfo( 1006 appcache::AppCacheInterceptor::SetExtraRequestInfo(
1006 request, ResourceContext::GetAppCacheService(resource_context), child_id, 1007 request, ResourceContext::GetAppCacheService(resource_context), child_id,
1007 request_data.appcache_host_id, request_data.resource_type); 1008 request_data.appcache_host_id, request_data.resource_type);
1008 1009
1009 // Construct the IPC resource handler. 1010 // Construct the IPC resource handler.
1010 scoped_ptr<ResourceHandler> handler; 1011 scoped_ptr<ResourceHandler> handler;
1012
1011 if (sync_result) { 1013 if (sync_result) {
1012 handler.reset(new SyncResourceHandler( 1014 handler.reset(new SyncResourceHandler(
1013 filter_, request, sync_result, this)); 1015 filter_, request, sync_result, this));
1014 } else { 1016 } else {
1015 handler.reset(new AsyncResourceHandler( 1017 handler.reset(new AsyncResourceHandler(
1016 filter_, route_id, request, this)); 1018 filter_, route_id, request, this));
1017 } 1019 }
1018 1020
1019 // The RedirectToFileResourceHandler depends on being next in the chain. 1021 // The RedirectToFileResourceHandler depends on being next in the chain.
1020 if (request_data.download_to_file) { 1022 if (request_data.download_to_file) {
(...skipping 12 matching lines...) Expand all
1033 // Wrap the event handler to be sure the current page's onunload handler 1035 // Wrap the event handler to be sure the current page's onunload handler
1034 // has a chance to run before we render the new page. 1036 // has a chance to run before we render the new page.
1035 handler.reset(new CrossSiteResourceHandler(handler.Pass(), child_id, 1037 handler.reset(new CrossSiteResourceHandler(handler.Pass(), child_id,
1036 route_id, request)); 1038 route_id, request));
1037 } 1039 }
1038 1040
1039 // Insert a buffered event handler before the actual one. 1041 // Insert a buffered event handler before the actual one.
1040 handler.reset( 1042 handler.reset(
1041 new BufferedResourceHandler(handler.Pass(), this, request)); 1043 new BufferedResourceHandler(handler.Pass(), this, request));
1042 1044
1045 handler.reset(
1046 new DuplicateResourceHandler(handler.Pass(), request_data.resource_type, r equest));
1047
1043 ScopedVector<ResourceThrottle> throttles; 1048 ScopedVector<ResourceThrottle> throttles;
1044 if (delegate_) { 1049 if (delegate_) {
1045 bool is_continuation_of_transferred_request = 1050 bool is_continuation_of_transferred_request =
1046 (deferred_loader.get() != NULL); 1051 (deferred_loader.get() != NULL);
1047 1052
1048 delegate_->RequestBeginning(request, 1053 delegate_->RequestBeginning(request,
1049 resource_context, 1054 resource_context,
1050 request_data.resource_type, 1055 request_data.resource_type,
1051 child_id, 1056 child_id,
1052 route_id, 1057 route_id,
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 1722
1718 return i->second.get(); 1723 return i->second.get();
1719 } 1724 }
1720 1725
1721 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id, 1726 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id,
1722 int request_id) const { 1727 int request_id) const {
1723 return GetLoader(GlobalRequestID(child_id, request_id)); 1728 return GetLoader(GlobalRequestID(child_id, request_id));
1724 } 1729 }
1725 1730
1726 } // namespace content 1731 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698