| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // ResourceDispatcherHost implementation: | 73 // ResourceDispatcherHost implementation: |
| 74 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) OVERRIDE; | 74 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) OVERRIDE; |
| 75 virtual void SetAllowCrossOriginAuthPrompt(bool value) OVERRIDE; | 75 virtual void SetAllowCrossOriginAuthPrompt(bool value) OVERRIDE; |
| 76 virtual net::Error BeginDownload( | 76 virtual net::Error BeginDownload( |
| 77 scoped_ptr<net::URLRequest> request, | 77 scoped_ptr<net::URLRequest> request, |
| 78 bool is_content_initiated, | 78 bool is_content_initiated, |
| 79 ResourceContext* context, | 79 ResourceContext* context, |
| 80 int child_id, | 80 int child_id, |
| 81 int route_id, | 81 int route_id, |
| 82 bool prefer_cache, | 82 bool prefer_cache, |
| 83 const DownloadSaveInfo& save_info, | 83 scoped_ptr<DownloadSaveInfo> save_info, |
| 84 const DownloadStartedCallback& started_callback) OVERRIDE; | 84 const DownloadStartedCallback& started_callback) OVERRIDE; |
| 85 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) OVERRIDE; | 85 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) OVERRIDE; |
| 86 virtual void BlockRequestsForRoute(int child_id, int route_id) OVERRIDE; | 86 virtual void BlockRequestsForRoute(int child_id, int route_id) OVERRIDE; |
| 87 virtual void ResumeBlockedRequestsForRoute( | 87 virtual void ResumeBlockedRequestsForRoute( |
| 88 int child_id, int route_id) OVERRIDE; | 88 int child_id, int route_id) OVERRIDE; |
| 89 | 89 |
| 90 // Puts the resource dispatcher host in an inactive state (unable to begin | 90 // Puts the resource dispatcher host in an inactive state (unable to begin |
| 91 // new requests). Cancels all pending requests. | 91 // new requests). Cancels all pending requests. |
| 92 void Shutdown(); | 92 void Shutdown(); |
| 93 | 93 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 202 |
| 203 ResourceDispatcherHostDelegate* delegate() { | 203 ResourceDispatcherHostDelegate* delegate() { |
| 204 return delegate_; | 204 return delegate_; |
| 205 } | 205 } |
| 206 | 206 |
| 207 // Must be called after the ResourceRequestInfo has been created | 207 // Must be called after the ResourceRequestInfo has been created |
| 208 // and associated with the request. | 208 // and associated with the request. |
| 209 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( | 209 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( |
| 210 net::URLRequest* request, | 210 net::URLRequest* request, |
| 211 bool is_content_initiated, | 211 bool is_content_initiated, |
| 212 const DownloadSaveInfo& save_info, | 212 scoped_ptr<DownloadSaveInfo> save_info, |
| 213 const DownloadResourceHandler::OnStartedCallback& started_cb); | 213 const DownloadResourceHandler::OnStartedCallback& started_cb); |
| 214 | 214 |
| 215 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); | 215 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); |
| 216 | 216 |
| 217 private: | 217 private: |
| 218 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 218 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 219 TestBlockedRequestsProcessDies); | 219 TestBlockedRequestsProcessDies); |
| 220 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 220 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 221 IncrementOutstandingRequestsMemoryCost); | 221 IncrementOutstandingRequestsMemoryCost); |
| 222 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 222 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // http://crbug.com/90971 - Assists in tracking down use-after-frees on | 420 // http://crbug.com/90971 - Assists in tracking down use-after-frees on |
| 421 // shutdown. | 421 // shutdown. |
| 422 std::set<const ResourceContext*> active_resource_contexts_; | 422 std::set<const ResourceContext*> active_resource_contexts_; |
| 423 | 423 |
| 424 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 424 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 425 }; | 425 }; |
| 426 | 426 |
| 427 } // namespace content | 427 } // namespace content |
| 428 | 428 |
| 429 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 429 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |