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

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

Issue 10414035: Move TransferNavigationResourceThrottle to content since that's where it belongs. This is a step in… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 21 matching lines...) Expand all
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/doomed_resource_handler.h" 38 #include "content/browser/renderer_host/doomed_resource_handler.h"
39 #include "content/browser/renderer_host/redirect_to_file_resource_handler.h" 39 #include "content/browser/renderer_host/redirect_to_file_resource_handler.h"
40 #include "content/browser/renderer_host/render_view_host_impl.h" 40 #include "content/browser/renderer_host/render_view_host_impl.h"
41 #include "content/browser/renderer_host/resource_message_filter.h" 41 #include "content/browser/renderer_host/resource_message_filter.h"
42 #include "content/public/browser/resource_request_details.h" 42 #include "content/browser/renderer_host/transfer_navigation_resource_throttle.h"
43 #include "content/browser/renderer_host/resource_request_info_impl.h" 43 #include "content/browser/renderer_host/resource_request_info_impl.h"
44 #include "content/browser/renderer_host/sync_resource_handler.h" 44 #include "content/browser/renderer_host/sync_resource_handler.h"
45 #include "content/browser/renderer_host/throttling_resource_handler.h" 45 #include "content/browser/renderer_host/throttling_resource_handler.h"
46 #include "content/browser/resource_context_impl.h" 46 #include "content/browser/resource_context_impl.h"
47 #include "content/browser/ssl/ssl_client_auth_handler.h" 47 #include "content/browser/ssl/ssl_client_auth_handler.h"
48 #include "content/browser/ssl/ssl_manager.h" 48 #include "content/browser/ssl/ssl_manager.h"
49 #include "content/browser/worker_host/worker_service_impl.h" 49 #include "content/browser/worker_host/worker_service_impl.h"
50 #include "content/common/resource_messages.h" 50 #include "content/common/resource_messages.h"
51 #include "content/common/ssl_status_serialization.h" 51 #include "content/common/ssl_status_serialization.h"
52 #include "content/common/view_messages.h" 52 #include "content/common/view_messages.h"
53 #include "content/public/browser/browser_thread.h" 53 #include "content/public/browser/browser_thread.h"
54 #include "content/public/browser/content_browser_client.h" 54 #include "content/public/browser/content_browser_client.h"
55 #include "content/public/browser/download_manager.h" 55 #include "content/public/browser/download_manager.h"
56 #include "content/public/browser/global_request_id.h" 56 #include "content/public/browser/global_request_id.h"
57 #include "content/public/browser/notification_service.h" 57 #include "content/public/browser/notification_service.h"
58 #include "content/public/browser/render_view_host_delegate.h" 58 #include "content/public/browser/render_view_host_delegate.h"
59 #include "content/public/browser/resource_dispatcher_host_delegate.h" 59 #include "content/public/browser/resource_dispatcher_host_delegate.h"
60 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" 60 #include "content/public/browser/resource_dispatcher_host_login_delegate.h"
61 #include "content/public/browser/resource_request_details.h"
61 #include "content/public/browser/resource_throttle.h" 62 #include "content/public/browser/resource_throttle.h"
62 #include "content/public/common/content_switches.h" 63 #include "content/public/common/content_switches.h"
63 #include "content/public/common/process_type.h" 64 #include "content/public/common/process_type.h"
64 #include "content/public/common/url_constants.h" 65 #include "content/public/common/url_constants.h"
65 #include "net/base/auth.h" 66 #include "net/base/auth.h"
66 #include "net/base/cert_status_flags.h" 67 #include "net/base/cert_status_flags.h"
67 #include "net/base/load_flags.h" 68 #include "net/base/load_flags.h"
68 #include "net/base/mime_util.h" 69 #include "net/base/mime_util.h"
69 #include "net/base/net_errors.h" 70 #include "net/base/net_errors.h"
70 #include "net/base/registry_controlled_domain.h" 71 #include "net/base/registry_controlled_domain.h"
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 return net::OK; 546 return net::OK;
546 } 547 }
547 548
548 void ResourceDispatcherHostImpl::ClearLoginDelegateForRequest( 549 void ResourceDispatcherHostImpl::ClearLoginDelegateForRequest(
549 net::URLRequest* request) { 550 net::URLRequest* request) {
550 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); 551 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request);
551 if (info) 552 if (info)
552 info->set_login_delegate(NULL); 553 info->set_login_delegate(NULL);
553 } 554 }
554 555
555 void ResourceDispatcherHostImpl::MarkAsTransferredNavigation( 556 void ResourceDispatcherHostImpl::MarkAsTransferredNavigation(
darin (slow to review) 2012/05/22 05:23:06 nit: move to after WillSendData so that methods in
jam 2012/05/22 15:01:36 Done.
556 net::URLRequest* transferred_request) { 557 net::URLRequest* transferred_request) {
557 ResourceRequestInfoImpl* info = 558 ResourceRequestInfoImpl* info =
558 ResourceRequestInfoImpl::ForRequest(transferred_request); 559 ResourceRequestInfoImpl::ForRequest(transferred_request);
559 560
560 GlobalRequestID transferred_request_id(info->GetChildID(), 561 GlobalRequestID transferred_request_id(info->GetChildID(),
561 info->GetRequestID()); 562 info->GetRequestID());
562 transferred_navigations_[transferred_request_id] = transferred_request; 563 transferred_navigations_[transferred_request_id] = transferred_request;
563 564
564 // If a URLRequest is transferred to a new RenderViewHost, its 565 // If a URLRequest is transferred to a new RenderViewHost, its
565 // ResourceHandler should not receive any notifications because it may 566 // ResourceHandler should not receive any notifications because it may
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 CrossSiteRequestManager::GetInstance()-> 892 CrossSiteRequestManager::GetInstance()->
892 HasPendingCrossSiteRequest(child_id, route_id)) { 893 HasPendingCrossSiteRequest(child_id, route_id)) {
893 // Wrap the event handler to be sure the current page's onunload handler 894 // Wrap the event handler to be sure the current page's onunload handler
894 // has a chance to run before we render the new page. 895 // has a chance to run before we render the new page.
895 handler = new CrossSiteResourceHandler(handler, child_id, route_id, this); 896 handler = new CrossSiteResourceHandler(handler, child_id, route_id, this);
896 } 897 }
897 898
898 // Insert a buffered event handler before the actual one. 899 // Insert a buffered event handler before the actual one.
899 handler = new BufferedResourceHandler(handler, this, request); 900 handler = new BufferedResourceHandler(handler, this, request);
900 901
902 ScopedVector<ResourceThrottle> throttles;
darin (slow to review) 2012/05/22 05:23:06 not sure if it is worth it, but it would be less c
jam 2012/05/22 15:01:36 Done.
903 if (request_data.resource_type == ResourceType::MAIN_FRAME)
904 throttles.push_back(new TransferNavigationResourceThrottle(request));
905
901 if (delegate_) { 906 if (delegate_) {
902 bool is_continuation_of_transferred_request = 907 bool is_continuation_of_transferred_request =
903 (deferred_request != NULL); 908 (deferred_request != NULL);
904 909
905 ScopedVector<ResourceThrottle> throttles; 910 ScopedVector<ResourceThrottle> embedder_throttles;
906 delegate_->RequestBeginning(request, 911 delegate_->RequestBeginning(request,
907 resource_context, 912 resource_context,
908 request_data.resource_type, 913 request_data.resource_type,
909 child_id, 914 child_id,
910 route_id, 915 route_id,
911 is_continuation_of_transferred_request, 916 is_continuation_of_transferred_request,
912 &throttles); 917 &embedder_throttles);
913 if (!throttles.empty()) { 918 throttles.insert(
914 handler = new ThrottlingResourceHandler(this, handler, child_id, 919 throttles.end(), embedder_throttles.begin(), embedder_throttles.end());
915 request_id, throttles.Pass()); 920 embedder_throttles.weak_erase(
916 } 921 embedder_throttles.begin(), embedder_throttles.end());
922 }
923
924 if (!throttles.empty()) {
925 handler = new ThrottlingResourceHandler(this, handler, child_id, request_id,
926 throttles.Pass());
917 } 927 }
918 928
919 bool allow_download = request_data.allow_download && 929 bool allow_download = request_data.allow_download &&
920 ResourceType::IsFrame(request_data.resource_type); 930 ResourceType::IsFrame(request_data.resource_type);
921 // Make extra info and read footer (contains request ID). 931 // Make extra info and read footer (contains request ID).
922 ResourceRequestInfoImpl* extra_info = 932 ResourceRequestInfoImpl* extra_info =
923 new ResourceRequestInfoImpl( 933 new ResourceRequestInfoImpl(
924 handler, 934 handler,
925 process_type, 935 process_type,
926 child_id, 936 child_id,
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2353 return allow_cross_origin_auth_prompt_; 2363 return allow_cross_origin_auth_prompt_;
2354 } 2364 }
2355 2365
2356 bool ResourceDispatcherHostImpl::IsTransferredNavigation( 2366 bool ResourceDispatcherHostImpl::IsTransferredNavigation(
2357 const GlobalRequestID& transferred_request_id) const { 2367 const GlobalRequestID& transferred_request_id) const {
2358 return transferred_navigations_.find(transferred_request_id) != 2368 return transferred_navigations_.find(transferred_request_id) !=
2359 transferred_navigations_.end(); 2369 transferred_navigations_.end();
2360 } 2370 }
2361 2371
2362 } // namespace content 2372 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698