| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 class RenderFrameHostImpl; | 62 class RenderFrameHostImpl; |
| 63 class ResourceContext; | 63 class ResourceContext; |
| 64 class ResourceDispatcherHostDelegate; | 64 class ResourceDispatcherHostDelegate; |
| 65 class ResourceLoader; | 65 class ResourceLoader; |
| 66 class ResourceHandler; | 66 class ResourceHandler; |
| 67 class ResourceMessageDelegate; | 67 class ResourceMessageDelegate; |
| 68 class ResourceMessageFilter; | 68 class ResourceMessageFilter; |
| 69 class ResourceRequesterInfo; | 69 class ResourceRequesterInfo; |
| 70 class ResourceRequestInfoImpl; | 70 class ResourceRequestInfoImpl; |
| 71 class ResourceScheduler; | 71 class ResourceScheduler; |
| 72 class ServiceWorkerContextWrapper; |
| 72 class ServiceWorkerNavigationHandleCore; | 73 class ServiceWorkerNavigationHandleCore; |
| 73 struct NavigationRequestInfo; | 74 struct NavigationRequestInfo; |
| 74 struct Referrer; | 75 struct Referrer; |
| 75 struct ResourceRequest; | 76 struct ResourceRequest; |
| 76 | 77 |
| 77 using CreateDownloadHandlerIntercept = | 78 using CreateDownloadHandlerIntercept = |
| 78 base::Callback<std::unique_ptr<ResourceHandler>(net::URLRequest*)>; | 79 base::Callback<std::unique_ptr<ResourceHandler>(net::URLRequest*)>; |
| 79 | 80 |
| 80 class CONTENT_EXPORT ResourceDispatcherHostImpl | 81 class CONTENT_EXPORT ResourceDispatcherHostImpl |
| 81 : public ResourceDispatcherHost, | 82 : public ResourceDispatcherHost, |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 int routing_id, | 308 int routing_id, |
| 308 int request_id, | 309 int request_id, |
| 309 const ResourceRequest& request_data, | 310 const ResourceRequest& request_data, |
| 310 const SyncLoadResultCallback& result_handler); | 311 const SyncLoadResultCallback& result_handler); |
| 311 | 312 |
| 312 // Helper function for initializing the |request| passed in. By initializing | 313 // Helper function for initializing the |request| passed in. By initializing |
| 313 // we mean setting the |referrer| on the |request|, associating the | 314 // we mean setting the |referrer| on the |request|, associating the |
| 314 // ResourceRequestInfoImpl structure with the |request|, etc. | 315 // ResourceRequestInfoImpl structure with the |request|, etc. |
| 315 // This function should be called for invoking the BeginURLRequest() function | 316 // This function should be called for invoking the BeginURLRequest() function |
| 316 // to initiate a URL request. | 317 // to initiate a URL request. |
| 317 void InitializeURLRequest(net::URLRequest* request, | 318 void InitializeURLRequest( |
| 318 const Referrer& referrer, | 319 net::URLRequest* request, |
| 319 bool is_download, | 320 const Referrer& referrer, |
| 320 int render_process_host_id, | 321 bool is_download, |
| 321 int render_view_routing_id, | 322 int render_process_host_id, |
| 322 int render_frame_routing_id, | 323 int render_view_routing_id, |
| 323 ResourceContext* context); | 324 int render_frame_routing_id, |
| 325 int service_worker_provider_id, |
| 326 ResourceContext* context, |
| 327 ServiceWorkerContextWrapper* service_worker_context); |
| 324 | 328 |
| 325 // Helper function for initiating a URL request. The |is_download| and | 329 // Helper function for initiating a URL request. The |is_download| and |
| 326 // |is_content_initiated and |do_not_prompt_for_login| parameters are | 330 // |is_content_initiated and |do_not_prompt_for_login| parameters are |
| 327 // specific to download requests. | 331 // specific to download requests. |
| 328 // TODO(ananta) | 332 // TODO(ananta) |
| 329 // Look into a better way of passing these parameters in. | 333 // Look into a better way of passing these parameters in. |
| 330 // Please note that the InitializeURLRequest() function needs to be called | 334 // Please note that the InitializeURLRequest() function needs to be called |
| 331 // called to initialize the request before calling this function. | 335 // called to initialize the request before calling this function. |
| 332 void BeginURLRequest(std::unique_ptr<net::URLRequest> request, | 336 void BeginURLRequest(std::unique_ptr<net::URLRequest> request, |
| 333 std::unique_ptr<ResourceHandler> handler, | 337 std::unique_ptr<ResourceHandler> handler, |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 int request_id, | 629 int request_id, |
| 626 net::RequestPriority new_priority, | 630 net::RequestPriority new_priority, |
| 627 int intra_priority_value); | 631 int intra_priority_value); |
| 628 | 632 |
| 629 // Creates ResourceRequestInfoImpl for a download or page save. | 633 // Creates ResourceRequestInfoImpl for a download or page save. |
| 630 // |download| should be true if the request is a file download. | 634 // |download| should be true if the request is a file download. |
| 631 ResourceRequestInfoImpl* CreateRequestInfo( | 635 ResourceRequestInfoImpl* CreateRequestInfo( |
| 632 int child_id, | 636 int child_id, |
| 633 int render_view_route_id, | 637 int render_view_route_id, |
| 634 int render_frame_route_id, | 638 int render_frame_route_id, |
| 639 int service_worker_provider_id, |
| 635 bool download, | 640 bool download, |
| 636 ResourceContext* context); | 641 ResourceContext* context, |
| 642 ServiceWorkerContextWrapper* service_worker_context); |
| 637 | 643 |
| 638 // Relationship of resource being authenticated with the top level page. | 644 // Relationship of resource being authenticated with the top level page. |
| 639 enum HttpAuthRelationType { | 645 enum HttpAuthRelationType { |
| 640 HTTP_AUTH_RELATION_TOP, // Top-level page itself | 646 HTTP_AUTH_RELATION_TOP, // Top-level page itself |
| 641 HTTP_AUTH_RELATION_SAME_DOMAIN, // Sub-content from same domain | 647 HTTP_AUTH_RELATION_SAME_DOMAIN, // Sub-content from same domain |
| 642 HTTP_AUTH_RELATION_BLOCKED_CROSS, // Blocked Sub-content from cross domain | 648 HTTP_AUTH_RELATION_BLOCKED_CROSS, // Blocked Sub-content from cross domain |
| 643 HTTP_AUTH_RELATION_ALLOWED_CROSS, // Allowed Sub-content per command line | 649 HTTP_AUTH_RELATION_ALLOWED_CROSS, // Allowed Sub-content per command line |
| 644 HTTP_AUTH_RELATION_LAST | 650 HTTP_AUTH_RELATION_LAST |
| 645 }; | 651 }; |
| 646 | 652 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 | 783 |
| 778 // Points to the registered download handler intercept. | 784 // Points to the registered download handler intercept. |
| 779 CreateDownloadHandlerIntercept create_download_handler_intercept_; | 785 CreateDownloadHandlerIntercept create_download_handler_intercept_; |
| 780 | 786 |
| 781 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 787 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 782 }; | 788 }; |
| 783 | 789 |
| 784 } // namespace content | 790 } // namespace content |
| 785 | 791 |
| 786 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 792 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |