| 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 14 matching lines...) Expand all Loading... |
| 25 #include "base/memory/ref_counted.h" | 25 #include "base/memory/ref_counted.h" |
| 26 #include "base/observer_list.h" | 26 #include "base/observer_list.h" |
| 27 #include "base/time/time.h" | 27 #include "base/time/time.h" |
| 28 #include "content/browser/loader/global_routing_id.h" | 28 #include "content/browser/loader/global_routing_id.h" |
| 29 #include "content/browser/loader/resource_loader_delegate.h" | 29 #include "content/browser/loader/resource_loader_delegate.h" |
| 30 #include "content/common/content_export.h" | 30 #include "content/common/content_export.h" |
| 31 #include "content/common/url_loader.mojom.h" | 31 #include "content/common/url_loader.mojom.h" |
| 32 #include "content/public/browser/global_request_id.h" | 32 #include "content/public/browser/global_request_id.h" |
| 33 #include "content/public/browser/resource_dispatcher_host.h" | 33 #include "content/public/browser/resource_dispatcher_host.h" |
| 34 #include "content/public/browser/resource_request_info.h" | 34 #include "content/public/browser/resource_request_info.h" |
| 35 #include "content/public/common/previews_state.h" |
| 35 #include "content/public/common/request_context_type.h" | 36 #include "content/public/common/request_context_type.h" |
| 36 #include "content/public/common/resource_type.h" | 37 #include "content/public/common/resource_type.h" |
| 37 #include "ipc/ipc_message.h" | 38 #include "ipc/ipc_message.h" |
| 38 #include "net/base/load_states.h" | 39 #include "net/base/load_states.h" |
| 39 #include "net/base/request_priority.h" | 40 #include "net/base/request_priority.h" |
| 40 #include "url/gurl.h" | 41 #include "url/gurl.h" |
| 41 | 42 |
| 42 namespace base { | 43 namespace base { |
| 43 class FilePath; | 44 class FilePath; |
| 44 class RepeatingTimer; | 45 class RepeatingTimer; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // we mean setting the |referrer| on the |request|, associating the | 315 // we mean setting the |referrer| on the |request|, associating the |
| 315 // ResourceRequestInfoImpl structure with the |request|, etc. | 316 // ResourceRequestInfoImpl structure with the |request|, etc. |
| 316 // This function should be called for invoking the BeginURLRequest() function | 317 // This function should be called for invoking the BeginURLRequest() function |
| 317 // to initiate a URL request. | 318 // to initiate a URL request. |
| 318 void InitializeURLRequest(net::URLRequest* request, | 319 void InitializeURLRequest(net::URLRequest* request, |
| 319 const Referrer& referrer, | 320 const Referrer& referrer, |
| 320 bool is_download, | 321 bool is_download, |
| 321 int render_process_host_id, | 322 int render_process_host_id, |
| 322 int render_view_routing_id, | 323 int render_view_routing_id, |
| 323 int render_frame_routing_id, | 324 int render_frame_routing_id, |
| 325 PreviewsState previews_state, |
| 324 ResourceContext* context); | 326 ResourceContext* context); |
| 325 | 327 |
| 326 // Helper function for initiating a URL request. The |is_download| and | 328 // Helper function for initiating a URL request. The |is_download| and |
| 327 // |is_content_initiated and |do_not_prompt_for_login| parameters are | 329 // |is_content_initiated and |do_not_prompt_for_login| parameters are |
| 328 // specific to download requests. | 330 // specific to download requests. |
| 329 // TODO(ananta) | 331 // TODO(ananta) |
| 330 // Look into a better way of passing these parameters in. | 332 // Look into a better way of passing these parameters in. |
| 331 // Please note that the InitializeURLRequest() function needs to be called | 333 // Please note that the InitializeURLRequest() function needs to be called |
| 332 // called to initialize the request before calling this function. | 334 // called to initialize the request before calling this function. |
| 333 void BeginURLRequest(std::unique_ptr<net::URLRequest> request, | 335 void BeginURLRequest(std::unique_ptr<net::URLRequest> request, |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 int request_id, | 632 int request_id, |
| 631 net::RequestPriority new_priority, | 633 net::RequestPriority new_priority, |
| 632 int intra_priority_value); | 634 int intra_priority_value); |
| 633 | 635 |
| 634 // Creates ResourceRequestInfoImpl for a download or page save. | 636 // Creates ResourceRequestInfoImpl for a download or page save. |
| 635 // |download| should be true if the request is a file download. | 637 // |download| should be true if the request is a file download. |
| 636 ResourceRequestInfoImpl* CreateRequestInfo( | 638 ResourceRequestInfoImpl* CreateRequestInfo( |
| 637 int child_id, | 639 int child_id, |
| 638 int render_view_route_id, | 640 int render_view_route_id, |
| 639 int render_frame_route_id, | 641 int render_frame_route_id, |
| 642 PreviewsState previews_state, |
| 640 bool download, | 643 bool download, |
| 641 ResourceContext* context); | 644 ResourceContext* context); |
| 642 | 645 |
| 643 // Relationship of resource being authenticated with the top level page. | 646 // Relationship of resource being authenticated with the top level page. |
| 644 enum HttpAuthRelationType { | 647 enum HttpAuthRelationType { |
| 645 HTTP_AUTH_RELATION_TOP, // Top-level page itself | 648 HTTP_AUTH_RELATION_TOP, // Top-level page itself |
| 646 HTTP_AUTH_RELATION_SAME_DOMAIN, // Sub-content from same domain | 649 HTTP_AUTH_RELATION_SAME_DOMAIN, // Sub-content from same domain |
| 647 HTTP_AUTH_RELATION_BLOCKED_CROSS, // Blocked Sub-content from cross domain | 650 HTTP_AUTH_RELATION_BLOCKED_CROSS, // Blocked Sub-content from cross domain |
| 648 HTTP_AUTH_RELATION_ALLOWED_CROSS, // Allowed Sub-content per command line | 651 HTTP_AUTH_RELATION_ALLOWED_CROSS, // Allowed Sub-content per command line |
| 649 HTTP_AUTH_RELATION_LAST | 652 HTTP_AUTH_RELATION_LAST |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 | 785 |
| 783 // Points to the registered download handler intercept. | 786 // Points to the registered download handler intercept. |
| 784 CreateDownloadHandlerIntercept create_download_handler_intercept_; | 787 CreateDownloadHandlerIntercept create_download_handler_intercept_; |
| 785 | 788 |
| 786 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 789 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 787 }; | 790 }; |
| 788 | 791 |
| 789 } // namespace content | 792 } // namespace content |
| 790 | 793 |
| 791 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 794 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |