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

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
1013 handler.reset(
1014 new DuplicateResourceHandler(handler.Pass(), request));
1015
1011 if (sync_result) { 1016 if (sync_result) {
1012 handler.reset(new SyncResourceHandler( 1017 handler.reset(new SyncResourceHandler(
1013 filter_, request, sync_result, this)); 1018 filter_, request, sync_result, this));
1014 } else { 1019 } else {
1015 handler.reset(new AsyncResourceHandler( 1020 handler.reset(new AsyncResourceHandler(
1016 filter_, route_id, request, this)); 1021 filter_, route_id, request, this));
1017 } 1022 }
1018 1023
1019 // The RedirectToFileResourceHandler depends on being next in the chain. 1024 // The RedirectToFileResourceHandler depends on being next in the chain.
1020 if (request_data.download_to_file) { 1025 if (request_data.download_to_file) {
1021 handler.reset( 1026 handler.reset(
1022 new RedirectToFileResourceHandler(handler.Pass(), child_id, this)); 1027 new RedirectToFileResourceHandler(handler.Pass(), child_id, this));
1023 } 1028 }
1024 1029
1025 // Install a CrossSiteResourceHandler if this request is coming from a 1030 // Install a CrossSiteResourceHandler if this request is coming from a
1026 // RenderViewHost with a pending cross-site request. We only check this for 1031 // RenderViewHost with a pending cross-site request. We only check this for
1027 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do 1032 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do
1028 // not count as cross-site, otherwise it gets blocked indefinitely. 1033 // not count as cross-site, otherwise it gets blocked indefinitely.
(...skipping 688 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