| OLD | NEW |
| 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 // This is the browser side of the resource dispatcher, it receives requests | 5 // This is the browser side of the resource dispatcher, it receives requests |
| 6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and | 6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and |
| 7 // dispatches them to URLRequests. It then forwards the messages from the | 7 // dispatches them to URLRequests. It then forwards the messages from the |
| 8 // URLRequests back to the correct process for handling. | 8 // URLRequests back to the correct process for handling. |
| 9 // | 9 // |
| 10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "content/public/browser/download_item.h" | 37 #include "content/public/browser/download_item.h" |
| 38 #include "content/public/browser/download_url_parameters.h" | 38 #include "content/public/browser/download_url_parameters.h" |
| 39 #include "content/public/browser/global_request_id.h" | 39 #include "content/public/browser/global_request_id.h" |
| 40 #include "content/public/browser/notification_types.h" | 40 #include "content/public/browser/notification_types.h" |
| 41 #include "content/public/browser/resource_dispatcher_host.h" | 41 #include "content/public/browser/resource_dispatcher_host.h" |
| 42 #include "content/public/browser/web_contents_observer.h" | 42 #include "content/public/browser/web_contents_observer.h" |
| 43 #include "content/public/common/resource_type.h" | 43 #include "content/public/common/resource_type.h" |
| 44 #include "ipc/ipc_message.h" | 44 #include "ipc/ipc_message.h" |
| 45 #include "net/base/request_priority.h" | 45 #include "net/base/request_priority.h" |
| 46 #include "net/cookies/canonical_cookie.h" | 46 #include "net/cookies/canonical_cookie.h" |
| 47 #include "net/url_request/url_request.h" | |
| 48 | 47 |
| 49 class ResourceHandler; | 48 class ResourceHandler; |
| 50 | 49 |
| 51 namespace base { | 50 namespace base { |
| 52 class FilePath; | 51 class FilePath; |
| 53 } | 52 } |
| 54 | 53 |
| 55 namespace net { | 54 namespace net { |
| 56 class URLRequestJobFactory; | 55 class URLRequestJobFactory; |
| 57 } | 56 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 RenderFrameHost* root_frame_host); | 122 RenderFrameHost* root_frame_host); |
| 124 | 123 |
| 125 // Cancels any blocked request for the frame and its subframes. | 124 // Cancels any blocked request for the frame and its subframes. |
| 126 static void CancelBlockedRequestsForFrameFromUI( | 125 static void CancelBlockedRequestsForFrameFromUI( |
| 127 RenderFrameHostImpl* root_frame_host); | 126 RenderFrameHostImpl* root_frame_host); |
| 128 | 127 |
| 129 // ResourceDispatcherHost implementation: | 128 // ResourceDispatcherHost implementation: |
| 130 void SetDelegate(ResourceDispatcherHostDelegate* delegate) override; | 129 void SetDelegate(ResourceDispatcherHostDelegate* delegate) override; |
| 131 void SetAllowCrossOriginAuthPrompt(bool value) override; | 130 void SetAllowCrossOriginAuthPrompt(bool value) override; |
| 132 void ClearLoginDelegateForRequest(net::URLRequest* request) override; | 131 void ClearLoginDelegateForRequest(net::URLRequest* request) override; |
| 132 net::URLRequest* GetURLRequest(const GlobalRequestID& request_id) override; |
| 133 |
| 133 | 134 |
| 134 // Puts the resource dispatcher host in an inactive state (unable to begin | 135 // Puts the resource dispatcher host in an inactive state (unable to begin |
| 135 // new requests). Cancels all pending requests. | 136 // new requests). Cancels all pending requests. |
| 136 void Shutdown(); | 137 void Shutdown(); |
| 137 | 138 |
| 138 // Notify the ResourceDispatcherHostImpl of a new resource context. | 139 // Notify the ResourceDispatcherHostImpl of a new resource context. |
| 139 void AddResourceContext(ResourceContext* context); | 140 void AddResourceContext(ResourceContext* context); |
| 140 | 141 |
| 141 // Notify the ResourceDispatcherHostImpl of a resource context destruction. | 142 // Notify the ResourceDispatcherHostImpl of a resource context destruction. |
| 142 void RemoveResourceContext(ResourceContext* context); | 143 void RemoveResourceContext(ResourceContext* context); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // Called when a RenderViewHost starts or stops loading. | 223 // Called when a RenderViewHost starts or stops loading. |
| 223 void OnRenderViewHostSetIsLoading(int child_id, | 224 void OnRenderViewHostSetIsLoading(int child_id, |
| 224 int route_id, | 225 int route_id, |
| 225 bool is_loading); | 226 bool is_loading); |
| 226 | 227 |
| 227 // Force cancels any pending requests for the given process. | 228 // Force cancels any pending requests for the given process. |
| 228 void CancelRequestsForProcess(int child_id); | 229 void CancelRequestsForProcess(int child_id); |
| 229 | 230 |
| 230 void OnUserGesture(WebContentsImpl* contents); | 231 void OnUserGesture(WebContentsImpl* contents); |
| 231 | 232 |
| 232 // Retrieves a net::URLRequest. Must be called from the IO thread. | |
| 233 net::URLRequest* GetURLRequest(const GlobalRequestID& request_id); | |
| 234 | |
| 235 void RemovePendingRequest(int child_id, int request_id); | 233 void RemovePendingRequest(int child_id, int request_id); |
| 236 | 234 |
| 237 // Causes all new requests for the route identified by |routing_id| to be | 235 // Causes all new requests for the route identified by |routing_id| to be |
| 238 // blocked (not being started) until ResumeBlockedRequestsForRoute is called. | 236 // blocked (not being started) until ResumeBlockedRequestsForRoute is called. |
| 239 void BlockRequestsForRoute(const GlobalFrameRoutingId& global_routing_id); | 237 void BlockRequestsForRoute(const GlobalFrameRoutingId& global_routing_id); |
| 240 | 238 |
| 241 // Resumes any blocked request for the specified route id. | 239 // Resumes any blocked request for the specified route id. |
| 242 void ResumeBlockedRequestsForRoute( | 240 void ResumeBlockedRequestsForRoute( |
| 243 const GlobalFrameRoutingId& global_routing_id); | 241 const GlobalFrameRoutingId& global_routing_id); |
| 244 | 242 |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 // Allows tests to use a mock CertStore. If set, the CertStore must | 660 // Allows tests to use a mock CertStore. If set, the CertStore must |
| 663 // outlive this ResourceDispatcherHostImpl. | 661 // outlive this ResourceDispatcherHostImpl. |
| 664 CertStore* cert_store_for_testing_; | 662 CertStore* cert_store_for_testing_; |
| 665 | 663 |
| 666 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 664 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 667 }; | 665 }; |
| 668 | 666 |
| 669 } // namespace content | 667 } // namespace content |
| 670 | 668 |
| 671 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 669 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |