| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 namespace net { | 53 namespace net { |
| 54 class URLRequestJobFactory; | 54 class URLRequestJobFactory; |
| 55 } | 55 } |
| 56 | 56 |
| 57 namespace storage { | 57 namespace storage { |
| 58 class ShareableFileReference; | 58 class ShareableFileReference; |
| 59 } | 59 } |
| 60 | 60 |
| 61 namespace content { | 61 namespace content { |
| 62 class AppCacheService; | 62 class AppCacheService; |
| 63 class AsyncRevalidationManager; |
| 63 class NavigationURLLoaderImplCore; | 64 class NavigationURLLoaderImplCore; |
| 64 class ResourceContext; | 65 class ResourceContext; |
| 65 class ResourceDispatcherHostDelegate; | 66 class ResourceDispatcherHostDelegate; |
| 66 class ResourceMessageDelegate; | 67 class ResourceMessageDelegate; |
| 67 class ResourceMessageFilter; | 68 class ResourceMessageFilter; |
| 68 class ResourceRequestInfoImpl; | 69 class ResourceRequestInfoImpl; |
| 69 class SaveFileManager; | 70 class SaveFileManager; |
| 70 class ServiceWorkerNavigationHandleCore; | 71 class ServiceWorkerNavigationHandleCore; |
| 71 class WebContentsImpl; | 72 class WebContentsImpl; |
| 72 struct CommonNavigationParams; | 73 struct CommonNavigationParams; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 void FinishedWithResourcesForRequest(net::URLRequest* request); | 274 void FinishedWithResourcesForRequest(net::URLRequest* request); |
| 274 | 275 |
| 275 // PlzNavigate: Begins a request for NavigationURLLoader. |loader| is the | 276 // PlzNavigate: Begins a request for NavigationURLLoader. |loader| is the |
| 276 // loader to attach to the leaf resource handler. | 277 // loader to attach to the leaf resource handler. |
| 277 void BeginNavigationRequest( | 278 void BeginNavigationRequest( |
| 278 ResourceContext* resource_context, | 279 ResourceContext* resource_context, |
| 279 const NavigationRequestInfo& info, | 280 const NavigationRequestInfo& info, |
| 280 NavigationURLLoaderImplCore* loader, | 281 NavigationURLLoaderImplCore* loader, |
| 281 ServiceWorkerNavigationHandleCore* service_worker_handle_core); | 282 ServiceWorkerNavigationHandleCore* service_worker_handle_core); |
| 282 | 283 |
| 284 // Turns on stale-while-revalidate support, regardless of command-line flags |
| 285 // or experiment status. For unit tests only. |
| 286 void EnableStaleWhileRevalidateForTesting(); |
| 287 |
| 283 private: | 288 private: |
| 284 friend class ResourceDispatcherHostTest; | 289 friend class ResourceDispatcherHostTest; |
| 285 | 290 |
| 286 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 291 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 287 TestBlockedRequestsProcessDies); | 292 TestBlockedRequestsProcessDies); |
| 288 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 293 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 289 CalculateApproximateMemoryCost); | 294 CalculateApproximateMemoryCost); |
| 290 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 295 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 291 DetachableResourceTimesOut); | 296 DetachableResourceTimesOut); |
| 292 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 297 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 base::TimeTicks last_user_gesture_time_; | 586 base::TimeTicks last_user_gesture_time_; |
| 582 | 587 |
| 583 // Used during IPC message dispatching so that the handlers can get a pointer | 588 // Used during IPC message dispatching so that the handlers can get a pointer |
| 584 // to the source of the message. | 589 // to the source of the message. |
| 585 ResourceMessageFilter* filter_; | 590 ResourceMessageFilter* filter_; |
| 586 | 591 |
| 587 ResourceDispatcherHostDelegate* delegate_; | 592 ResourceDispatcherHostDelegate* delegate_; |
| 588 | 593 |
| 589 bool allow_cross_origin_auth_prompt_; | 594 bool allow_cross_origin_auth_prompt_; |
| 590 | 595 |
| 596 // AsyncRevalidationManager is non-NULL if and only if |
| 597 // stale-while-revalidate is enabled. |
| 598 scoped_ptr<AsyncRevalidationManager> async_revalidation_manager_; |
| 599 |
| 591 // http://crbug.com/90971 - Assists in tracking down use-after-frees on | 600 // http://crbug.com/90971 - Assists in tracking down use-after-frees on |
| 592 // shutdown. | 601 // shutdown. |
| 593 std::set<const ResourceContext*> active_resource_contexts_; | 602 std::set<const ResourceContext*> active_resource_contexts_; |
| 594 | 603 |
| 595 typedef std::map<GlobalRequestID, | 604 typedef std::map<GlobalRequestID, |
| 596 base::ObserverList<ResourceMessageDelegate>*> DelegateMap; | 605 base::ObserverList<ResourceMessageDelegate>*> DelegateMap; |
| 597 DelegateMap delegate_map_; | 606 DelegateMap delegate_map_; |
| 598 | 607 |
| 599 scoped_ptr<ResourceScheduler> scheduler_; | 608 scoped_ptr<ResourceScheduler> scheduler_; |
| 600 | 609 |
| 601 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 610 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 602 }; | 611 }; |
| 603 | 612 |
| 604 } // namespace content | 613 } // namespace content |
| 605 | 614 |
| 606 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 615 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |