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