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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class HttpRequestHeaders; | 51 class HttpRequestHeaders; |
52 } | 52 } |
53 | 53 |
54 namespace storage { | 54 namespace storage { |
55 class ShareableFileReference; | 55 class ShareableFileReference; |
56 } | 56 } |
57 | 57 |
58 namespace content { | 58 namespace content { |
59 class AppCacheNavigationHandleCore; | 59 class AppCacheNavigationHandleCore; |
60 class AppCacheService; | 60 class AppCacheService; |
61 class AsyncRevalidationManager; | |
62 class LoaderDelegate; | 61 class LoaderDelegate; |
63 class NavigationURLLoaderImplCore; | 62 class NavigationURLLoaderImplCore; |
64 class NavigationUIData; | 63 class NavigationUIData; |
65 class RenderFrameHostImpl; | 64 class RenderFrameHostImpl; |
66 class ResourceContext; | 65 class ResourceContext; |
67 class ResourceDispatcherHostDelegate; | 66 class ResourceDispatcherHostDelegate; |
68 class ResourceLoader; | 67 class ResourceLoader; |
69 class ResourceHandler; | 68 class ResourceHandler; |
70 class ResourceMessageDelegate; | 69 class ResourceMessageDelegate; |
71 class ResourceRequesterInfo; | 70 class ResourceRequesterInfo; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 const NavigationRequestInfo& info, | 280 const NavigationRequestInfo& info, |
282 std::unique_ptr<NavigationUIData> navigation_ui_data, | 281 std::unique_ptr<NavigationUIData> navigation_ui_data, |
283 NavigationURLLoaderImplCore* loader, | 282 NavigationURLLoaderImplCore* loader, |
284 ServiceWorkerNavigationHandleCore* service_worker_handle_core, | 283 ServiceWorkerNavigationHandleCore* service_worker_handle_core, |
285 AppCacheNavigationHandleCore* appcache_handle_core); | 284 AppCacheNavigationHandleCore* appcache_handle_core); |
286 | 285 |
287 int num_in_flight_requests_for_testing() const { | 286 int num_in_flight_requests_for_testing() const { |
288 return num_in_flight_requests_; | 287 return num_in_flight_requests_; |
289 } | 288 } |
290 | 289 |
291 // Turns on stale-while-revalidate support, regardless of command-line flags | |
292 // or experiment status. For unit tests only. | |
293 void EnableStaleWhileRevalidateForTesting(); | |
294 | |
295 // Sets the LoaderDelegate, which must outlive this object. Ownership is not | 290 // Sets the LoaderDelegate, which must outlive this object. Ownership is not |
296 // transferred. The LoaderDelegate should be interacted with on the IO thread. | 291 // transferred. The LoaderDelegate should be interacted with on the IO thread. |
297 void SetLoaderDelegate(LoaderDelegate* loader_delegate); | 292 void SetLoaderDelegate(LoaderDelegate* loader_delegate); |
298 | 293 |
299 void OnRenderFrameDeleted(const GlobalFrameRoutingId& global_routing_id); | 294 void OnRenderFrameDeleted(const GlobalFrameRoutingId& global_routing_id); |
300 | 295 |
301 // Called when loading a request with mojo. | 296 // Called when loading a request with mojo. |
302 void OnRequestResourceWithMojo(ResourceRequesterInfo* requester_info, | 297 void OnRequestResourceWithMojo(ResourceRequesterInfo* requester_info, |
303 int routing_id, | 298 int routing_id, |
304 int request_id, | 299 int request_id, |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 // flag to requests occurring soon after a gesture to indicate they | 759 // flag to requests occurring soon after a gesture to indicate they |
765 // may be because of explicit user action. | 760 // may be because of explicit user action. |
766 base::TimeTicks last_user_gesture_time_; | 761 base::TimeTicks last_user_gesture_time_; |
767 | 762 |
768 ResourceDispatcherHostDelegate* delegate_; | 763 ResourceDispatcherHostDelegate* delegate_; |
769 | 764 |
770 LoaderDelegate* loader_delegate_; | 765 LoaderDelegate* loader_delegate_; |
771 | 766 |
772 bool allow_cross_origin_auth_prompt_; | 767 bool allow_cross_origin_auth_prompt_; |
773 | 768 |
774 // AsyncRevalidationManager is non-NULL if and only if | |
775 // stale-while-revalidate is enabled. | |
776 std::unique_ptr<AsyncRevalidationManager> async_revalidation_manager_; | |
777 | |
778 typedef std::map<GlobalRequestID, | 769 typedef std::map<GlobalRequestID, |
779 base::ObserverList<ResourceMessageDelegate>*> DelegateMap; | 770 base::ObserverList<ResourceMessageDelegate>*> DelegateMap; |
780 DelegateMap delegate_map_; | 771 DelegateMap delegate_map_; |
781 | 772 |
782 std::unique_ptr<ResourceScheduler> scheduler_; | 773 std::unique_ptr<ResourceScheduler> scheduler_; |
783 | 774 |
784 // Used to invoke an interceptor for the HTTP header. | 775 // Used to invoke an interceptor for the HTTP header. |
785 HeaderInterceptorMap http_header_interceptor_map_; | 776 HeaderInterceptorMap http_header_interceptor_map_; |
786 | 777 |
787 // Points to the registered download handler intercept. | 778 // Points to the registered download handler intercept. |
788 CreateDownloadHandlerIntercept create_download_handler_intercept_; | 779 CreateDownloadHandlerIntercept create_download_handler_intercept_; |
789 | 780 |
790 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 781 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
791 }; | 782 }; |
792 | 783 |
793 } // namespace content | 784 } // namespace content |
794 | 785 |
795 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 786 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |