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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 namespace content { | 61 namespace content { |
62 class AppCacheService; | 62 class AppCacheService; |
63 class NavigationURLLoaderImplCore; | 63 class NavigationURLLoaderImplCore; |
64 class ResourceContext; | 64 class ResourceContext; |
65 class ResourceDispatcherHostDelegate; | 65 class ResourceDispatcherHostDelegate; |
66 class ResourceMessageDelegate; | 66 class ResourceMessageDelegate; |
67 class ResourceMessageFilter; | 67 class ResourceMessageFilter; |
68 class ResourceRequestInfoImpl; | 68 class ResourceRequestInfoImpl; |
69 class SaveFileManager; | 69 class SaveFileManager; |
| 70 class ServiceWorkerContextWrapper; |
70 class WebContentsImpl; | 71 class WebContentsImpl; |
71 struct CommonNavigationParams; | 72 struct CommonNavigationParams; |
72 struct DownloadSaveInfo; | 73 struct DownloadSaveInfo; |
73 struct NavigationRequestInfo; | 74 struct NavigationRequestInfo; |
74 struct Referrer; | 75 struct Referrer; |
75 | 76 |
76 class CONTENT_EXPORT ResourceDispatcherHostImpl | 77 class CONTENT_EXPORT ResourceDispatcherHostImpl |
77 : public ResourceDispatcherHost, | 78 : public ResourceDispatcherHost, |
78 public ResourceLoaderDelegate { | 79 public ResourceLoaderDelegate { |
79 public: | 80 public: |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // the request should cancel. | 265 // the request should cancel. |
265 bool HasSufficientResourcesForRequest(net::URLRequest* request); | 266 bool HasSufficientResourcesForRequest(net::URLRequest* request); |
266 | 267 |
267 // Called by a ResourceHandler after it has finished its request and is done | 268 // Called by a ResourceHandler after it has finished its request and is done |
268 // using its shared memory buffer. Frees up that file descriptor to be used | 269 // using its shared memory buffer. Frees up that file descriptor to be used |
269 // elsewhere. | 270 // elsewhere. |
270 void FinishedWithResourcesForRequest(net::URLRequest* request); | 271 void FinishedWithResourcesForRequest(net::URLRequest* request); |
271 | 272 |
272 // PlzNavigate: Begins a request for NavigationURLLoader. |loader| is the | 273 // PlzNavigate: Begins a request for NavigationURLLoader. |loader| is the |
273 // loader to attach to the leaf resource handler. | 274 // loader to attach to the leaf resource handler. |
274 void BeginNavigationRequest(ResourceContext* resource_context, | 275 void BeginNavigationRequest( |
275 int frame_tree_node_id, | 276 ResourceContext* resource_context, |
276 const NavigationRequestInfo& info, | 277 int frame_tree_node_id, |
277 NavigationURLLoaderImplCore* loader); | 278 const NavigationRequestInfo& info, |
| 279 NavigationURLLoaderImplCore* loader, |
| 280 ServiceWorkerContextWrapper* service_worker_context); |
278 | 281 |
279 private: | 282 private: |
280 friend class ResourceDispatcherHostTest; | 283 friend class ResourceDispatcherHostTest; |
281 | 284 |
282 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 285 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
283 TestBlockedRequestsProcessDies); | 286 TestBlockedRequestsProcessDies); |
284 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 287 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
285 CalculateApproximateMemoryCost); | 288 CalculateApproximateMemoryCost); |
286 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 289 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
287 DetachableResourceTimesOut); | 290 DetachableResourceTimesOut); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 DelegateMap delegate_map_; | 597 DelegateMap delegate_map_; |
595 | 598 |
596 scoped_ptr<ResourceScheduler> scheduler_; | 599 scoped_ptr<ResourceScheduler> scheduler_; |
597 | 600 |
598 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 601 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
599 }; | 602 }; |
600 | 603 |
601 } // namespace content | 604 } // namespace content |
602 | 605 |
603 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 606 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |