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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // sending it to the renderer. Returns true if there are enough file | 244 // sending it to the renderer. Returns true if there are enough file |
244 // descriptors available for the shared memory buffer. If false is returned, | 245 // descriptors available for the shared memory buffer. If false is returned, |
245 // the request should cancel. | 246 // the request should cancel. |
246 bool HasSufficientResourcesForRequest(const net::URLRequest* request_); | 247 bool HasSufficientResourcesForRequest(const net::URLRequest* request_); |
247 | 248 |
248 // Called by a ResourceHandler after it has finished its request and is done | 249 // Called by a ResourceHandler after it has finished its request and is done |
249 // using its shared memory buffer. Frees up that file descriptor to be used | 250 // using its shared memory buffer. Frees up that file descriptor to be used |
250 // elsewhere. | 251 // elsewhere. |
251 void FinishedWithResourcesForRequest(const net::URLRequest* request_); | 252 void FinishedWithResourcesForRequest(const net::URLRequest* request_); |
252 | 253 |
253 // PlzNavigate | 254 // PlzNavigate: Begins a request for NavigationURLLoader. |loader| is the |
254 // Called by NavigationRequest to start a navigation request in the node | 255 // loader to attach to the leaf resource handler. |
255 // identified by |frame_node_id|. | 256 void BeginNavigationRequest(ResourceContext* resource_context, |
256 void StartNavigationRequest(const CommonNavigationParams& common_params, | 257 int64 frame_tree_node_id, |
| 258 const CommonNavigationParams& common_params, |
257 const NavigationRequestInfo& info, | 259 const NavigationRequestInfo& info, |
258 scoped_refptr<ResourceRequestBody> request_body, | 260 scoped_refptr<ResourceRequestBody> request_body, |
259 int64 navigation_request_id, | 261 NavigationURLLoaderCore* loader); |
260 int64 frame_node_id); | |
261 | |
262 // PlzNavigate | |
263 // Called by NavigationRequest to cancel a navigation request with the | |
264 // provided |navigation_request_id| in the node identified by | |
265 // |frame_node_id|. | |
266 void CancelNavigationRequest(int64 navigation_request_id, | |
267 int64 frame_node_id); | |
268 | 262 |
269 private: | 263 private: |
270 friend class ResourceDispatcherHostTest; | 264 friend class ResourceDispatcherHostTest; |
271 | 265 |
272 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 266 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
273 TestBlockedRequestsProcessDies); | 267 TestBlockedRequestsProcessDies); |
274 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 268 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
275 CalculateApproximateMemoryCost); | 269 CalculateApproximateMemoryCost); |
276 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 270 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
277 DetachableResourceTimesOut); | 271 DetachableResourceTimesOut); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 DelegateMap delegate_map_; | 532 DelegateMap delegate_map_; |
539 | 533 |
540 scoped_ptr<ResourceScheduler> scheduler_; | 534 scoped_ptr<ResourceScheduler> scheduler_; |
541 | 535 |
542 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 536 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
543 }; | 537 }; |
544 | 538 |
545 } // namespace content | 539 } // namespace content |
546 | 540 |
547 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 541 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |