| 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 URLRequestJobFactory; | 51 class URLRequestJobFactory; |
| 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 AppCacheService; | 59 class AppCacheService; |
| 60 class AsyncRevalidationManager; | 60 class AsyncRevalidationManager; |
| 61 class CertStore; | |
| 62 class LoaderDelegate; | 61 class LoaderDelegate; |
| 63 class NavigationURLLoaderImplCore; | 62 class NavigationURLLoaderImplCore; |
| 64 class RenderFrameHostImpl; | 63 class RenderFrameHostImpl; |
| 65 class ResourceContext; | 64 class ResourceContext; |
| 66 class ResourceDispatcherHostDelegate; | 65 class ResourceDispatcherHostDelegate; |
| 67 class ResourceHandler; | 66 class ResourceHandler; |
| 68 class ResourceMessageDelegate; | 67 class ResourceMessageDelegate; |
| 69 class ResourceMessageFilter; | 68 class ResourceMessageFilter; |
| 70 class ResourceRequestInfoImpl; | 69 class ResourceRequestInfoImpl; |
| 71 class ServiceWorkerNavigationHandleCore; | 70 class ServiceWorkerNavigationHandleCore; |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 // specified |id|. | 604 // specified |id|. |
| 606 void RegisterResourceMessageDelegate(const GlobalRequestID& id, | 605 void RegisterResourceMessageDelegate(const GlobalRequestID& id, |
| 607 ResourceMessageDelegate* delegate); | 606 ResourceMessageDelegate* delegate); |
| 608 void UnregisterResourceMessageDelegate(const GlobalRequestID& id, | 607 void UnregisterResourceMessageDelegate(const GlobalRequestID& id, |
| 609 ResourceMessageDelegate* delegate); | 608 ResourceMessageDelegate* delegate); |
| 610 | 609 |
| 611 int BuildLoadFlagsForRequest(const ResourceRequest& request_data, | 610 int BuildLoadFlagsForRequest(const ResourceRequest& request_data, |
| 612 int child_id, | 611 int child_id, |
| 613 bool is_sync_load); | 612 bool is_sync_load); |
| 614 | 613 |
| 615 // The certificate on a ResourceResponse is associated with a | |
| 616 // particular renderer process. As a transfer to a new process | |
| 617 // completes, the stored certificate has to be updated to reflect the | |
| 618 // new renderer process. | |
| 619 void UpdateResponseCertificateForTransfer(ResourceResponse* response, | |
| 620 net::URLRequest* request, | |
| 621 ResourceRequestInfoImpl* info); | |
| 622 | |
| 623 CertStore* GetCertStore(); | |
| 624 | |
| 625 // Consults the RendererSecurity policy to determine whether the | 614 // Consults the RendererSecurity policy to determine whether the |
| 626 // ResourceDispatcherHostImpl should service this request. A request might | 615 // ResourceDispatcherHostImpl should service this request. A request might |
| 627 // be disallowed if the renderer is not authorized to retrieve the request | 616 // be disallowed if the renderer is not authorized to retrieve the request |
| 628 // URL or if the renderer is attempting to upload an unauthorized file. | 617 // URL or if the renderer is attempting to upload an unauthorized file. |
| 629 bool ShouldServiceRequest(int process_type, | 618 bool ShouldServiceRequest(int process_type, |
| 630 int child_id, | 619 int child_id, |
| 631 const ResourceRequest& request_data, | 620 const ResourceRequest& request_data, |
| 632 const net::HttpRequestHeaders& headers, | 621 const net::HttpRequestHeaders& headers, |
| 633 ResourceMessageFilter* filter, | 622 ResourceMessageFilter* filter, |
| 634 ResourceContext* resource_context); | 623 ResourceContext* resource_context); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 // AsyncRevalidationManager is non-NULL if and only if | 713 // AsyncRevalidationManager is non-NULL if and only if |
| 725 // stale-while-revalidate is enabled. | 714 // stale-while-revalidate is enabled. |
| 726 std::unique_ptr<AsyncRevalidationManager> async_revalidation_manager_; | 715 std::unique_ptr<AsyncRevalidationManager> async_revalidation_manager_; |
| 727 | 716 |
| 728 typedef std::map<GlobalRequestID, | 717 typedef std::map<GlobalRequestID, |
| 729 base::ObserverList<ResourceMessageDelegate>*> DelegateMap; | 718 base::ObserverList<ResourceMessageDelegate>*> DelegateMap; |
| 730 DelegateMap delegate_map_; | 719 DelegateMap delegate_map_; |
| 731 | 720 |
| 732 std::unique_ptr<ResourceScheduler> scheduler_; | 721 std::unique_ptr<ResourceScheduler> scheduler_; |
| 733 | 722 |
| 734 // Allows tests to use a mock CertStore. If set, the CertStore must | |
| 735 // outlive this ResourceDispatcherHostImpl. | |
| 736 CertStore* cert_store_for_testing_; | |
| 737 | |
| 738 // Used to invoke an interceptor for the HTTP header. | 723 // Used to invoke an interceptor for the HTTP header. |
| 739 HeaderInterceptorMap http_header_interceptor_map_; | 724 HeaderInterceptorMap http_header_interceptor_map_; |
| 740 | 725 |
| 741 // Points to the registered download handler intercept. | 726 // Points to the registered download handler intercept. |
| 742 CreateDownloadHandlerIntercept create_download_handler_intercept_; | 727 CreateDownloadHandlerIntercept create_download_handler_intercept_; |
| 743 | 728 |
| 744 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 729 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 745 }; | 730 }; |
| 746 | 731 |
| 747 } // namespace content | 732 } // namespace content |
| 748 | 733 |
| 749 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 734 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |