| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 namespace net { | 48 namespace net { |
| 49 class URLRequestJobFactory; | 49 class URLRequestJobFactory; |
| 50 } | 50 } |
| 51 | 51 |
| 52 namespace storage { | 52 namespace storage { |
| 53 class ShareableFileReference; | 53 class ShareableFileReference; |
| 54 } | 54 } |
| 55 | 55 |
| 56 namespace content { | 56 namespace content { |
| 57 class NavigationURLLoaderCore; |
| 57 class ResourceContext; | 58 class ResourceContext; |
| 58 class ResourceDispatcherHostDelegate; | 59 class ResourceDispatcherHostDelegate; |
| 59 class ResourceMessageDelegate; | 60 class ResourceMessageDelegate; |
| 60 class ResourceMessageFilter; | 61 class ResourceMessageFilter; |
| 61 class ResourceRequestInfoImpl; | 62 class ResourceRequestInfoImpl; |
| 62 class SaveFileManager; | 63 class SaveFileManager; |
| 63 class WebContentsImpl; | 64 class WebContentsImpl; |
| 64 struct CommonNavigationParams; | 65 struct CommonNavigationParams; |
| 65 struct DownloadSaveInfo; | 66 struct DownloadSaveInfo; |
| 66 struct NavigationRequestInfo; | 67 struct NavigationRequestInfo; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // sending it to the renderer. Returns true if there are enough file | 250 // sending it to the renderer. Returns true if there are enough file |
| 250 // descriptors available for the shared memory buffer. If false is returned, | 251 // descriptors available for the shared memory buffer. If false is returned, |
| 251 // the request should cancel. | 252 // the request should cancel. |
| 252 bool HasSufficientResourcesForRequest(const net::URLRequest* request_); | 253 bool HasSufficientResourcesForRequest(const net::URLRequest* request_); |
| 253 | 254 |
| 254 // Called by a ResourceHandler after it has finished its request and is done | 255 // Called by a ResourceHandler after it has finished its request and is done |
| 255 // using its shared memory buffer. Frees up that file descriptor to be used | 256 // using its shared memory buffer. Frees up that file descriptor to be used |
| 256 // elsewhere. | 257 // elsewhere. |
| 257 void FinishedWithResourcesForRequest(const net::URLRequest* request_); | 258 void FinishedWithResourcesForRequest(const net::URLRequest* request_); |
| 258 | 259 |
| 259 // PlzNavigate | 260 // PlzNavigate: Begins a request for NavigationURLLoader. |loader| is the |
| 260 // Called by NavigationRequest to start a navigation request in the node | 261 // loader to attach to the leaf resource handler. |
| 261 // identified by |frame_node_id|. | 262 void BeginNavigationRequest(ResourceContext* resource_context, |
| 262 void StartNavigationRequest(const CommonNavigationParams& common_params, | 263 int64 frame_tree_node_id, |
| 264 const CommonNavigationParams& common_params, |
| 263 const NavigationRequestInfo& info, | 265 const NavigationRequestInfo& info, |
| 264 scoped_refptr<ResourceRequestBody> request_body, | 266 scoped_refptr<ResourceRequestBody> request_body, |
| 265 int64 navigation_request_id, | 267 NavigationURLLoaderCore* loader); |
| 266 int64 frame_node_id); | |
| 267 | |
| 268 // PlzNavigate | |
| 269 // Called by NavigationRequest to cancel a navigation request with the | |
| 270 // provided |navigation_request_id| in the node identified by | |
| 271 // |frame_node_id|. | |
| 272 void CancelNavigationRequest(int64 navigation_request_id, | |
| 273 int64 frame_node_id); | |
| 274 | 268 |
| 275 private: | 269 private: |
| 276 friend class ResourceDispatcherHostTest; | 270 friend class ResourceDispatcherHostTest; |
| 277 | 271 |
| 278 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 272 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 279 TestBlockedRequestsProcessDies); | 273 TestBlockedRequestsProcessDies); |
| 280 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 274 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 281 CalculateApproximateMemoryCost); | 275 CalculateApproximateMemoryCost); |
| 282 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 276 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 283 DetachableResourceTimesOut); | 277 DetachableResourceTimesOut); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 DelegateMap delegate_map_; | 538 DelegateMap delegate_map_; |
| 545 | 539 |
| 546 scoped_ptr<ResourceScheduler> scheduler_; | 540 scoped_ptr<ResourceScheduler> scheduler_; |
| 547 | 541 |
| 548 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 542 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 549 }; | 543 }; |
| 550 | 544 |
| 551 } // namespace content | 545 } // namespace content |
| 552 | 546 |
| 553 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 547 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |