| 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 15 matching lines...) Expand all Loading... |
| 26 #include "base/observer_list.h" | 26 #include "base/observer_list.h" |
| 27 #include "base/single_thread_task_runner.h" | 27 #include "base/single_thread_task_runner.h" |
| 28 #include "base/time/time.h" | 28 #include "base/time/time.h" |
| 29 #include "content/browser/loader/global_routing_id.h" | 29 #include "content/browser/loader/global_routing_id.h" |
| 30 #include "content/browser/loader/resource_loader_delegate.h" | 30 #include "content/browser/loader/resource_loader_delegate.h" |
| 31 #include "content/common/content_export.h" | 31 #include "content/common/content_export.h" |
| 32 #include "content/common/url_loader.mojom.h" | 32 #include "content/common/url_loader.mojom.h" |
| 33 #include "content/public/browser/global_request_id.h" | 33 #include "content/public/browser/global_request_id.h" |
| 34 #include "content/public/browser/resource_dispatcher_host.h" | 34 #include "content/public/browser/resource_dispatcher_host.h" |
| 35 #include "content/public/browser/resource_request_info.h" | 35 #include "content/public/browser/resource_request_info.h" |
| 36 #include "content/public/browser/stream_handle.h" |
| 36 #include "content/public/common/previews_state.h" | 37 #include "content/public/common/previews_state.h" |
| 37 #include "content/public/common/request_context_type.h" | 38 #include "content/public/common/request_context_type.h" |
| 38 #include "content/public/common/resource_type.h" | 39 #include "content/public/common/resource_type.h" |
| 39 #include "ipc/ipc_message.h" | 40 #include "ipc/ipc_message.h" |
| 40 #include "net/base/load_states.h" | 41 #include "net/base/load_states.h" |
| 41 #include "net/base/request_priority.h" | 42 #include "net/base/request_priority.h" |
| 42 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" | 43 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" |
| 43 #include "url/gurl.h" | 44 #include "url/gurl.h" |
| 44 | 45 |
| 45 namespace base { | 46 namespace base { |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 const SyncLoadResultCallback& sync_result_handler, | 591 const SyncLoadResultCallback& sync_result_handler, |
| 591 int route_id, | 592 int route_id, |
| 592 int child_id, | 593 int child_id, |
| 593 ResourceContext* resource_context, | 594 ResourceContext* resource_context, |
| 594 mojom::URLLoaderAssociatedRequest mojo_request, | 595 mojom::URLLoaderAssociatedRequest mojo_request, |
| 595 mojom::URLLoaderClientPtr url_loader_client); | 596 mojom::URLLoaderClientPtr url_loader_client); |
| 596 | 597 |
| 597 // Wraps |handler| in the standard resource handlers for normal resource | 598 // Wraps |handler| in the standard resource handlers for normal resource |
| 598 // loading and navigation requests. This adds MimeTypeResourceHandler and | 599 // loading and navigation requests. This adds MimeTypeResourceHandler and |
| 599 // ResourceThrottles. | 600 // ResourceThrottles. |
| 601 // PlzNavigate: |navigation_loader_core| and |stream_handle| are used to |
| 602 // properly initialized the NavigationResourceHandler placed in navigation |
| 603 // requests. They should be non-null in that case. |
| 600 std::unique_ptr<ResourceHandler> AddStandardHandlers( | 604 std::unique_ptr<ResourceHandler> AddStandardHandlers( |
| 601 net::URLRequest* request, | 605 net::URLRequest* request, |
| 602 ResourceType resource_type, | 606 ResourceType resource_type, |
| 603 ResourceContext* resource_context, | 607 ResourceContext* resource_context, |
| 604 RequestContextType fetch_request_context_type, | 608 RequestContextType fetch_request_context_type, |
| 605 blink::WebMixedContentContextType fetch_mixed_content_context_type, | 609 blink::WebMixedContentContextType fetch_mixed_content_context_type, |
| 606 AppCacheService* appcache_service, | 610 AppCacheService* appcache_service, |
| 607 int child_id, | 611 int child_id, |
| 608 int route_id, | 612 int route_id, |
| 609 std::unique_ptr<ResourceHandler> handler); | 613 std::unique_ptr<ResourceHandler> handler, |
| 614 NavigationURLLoaderImplCore* navigation_loader_core, |
| 615 std::unique_ptr<StreamHandle> stream_handle); |
| 610 | 616 |
| 611 void OnCancelRequest(ResourceRequesterInfo* requester_info, int request_id); | 617 void OnCancelRequest(ResourceRequesterInfo* requester_info, int request_id); |
| 612 void OnReleaseDownloadedFile(ResourceRequesterInfo* requester_info, | 618 void OnReleaseDownloadedFile(ResourceRequesterInfo* requester_info, |
| 613 int request_id); | 619 int request_id); |
| 614 void OnDidChangePriority(ResourceRequesterInfo* requester_info, | 620 void OnDidChangePriority(ResourceRequesterInfo* requester_info, |
| 615 int request_id, | 621 int request_id, |
| 616 net::RequestPriority new_priority, | 622 net::RequestPriority new_priority, |
| 617 int intra_priority_value); | 623 int intra_priority_value); |
| 618 | 624 |
| 619 // Creates ResourceRequestInfoImpl for a download or page save. | 625 // Creates ResourceRequestInfoImpl for a download or page save. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 | 782 |
| 777 // Task runner for the IO thead. | 783 // Task runner for the IO thead. |
| 778 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; | 784 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; |
| 779 | 785 |
| 780 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 786 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 781 }; | 787 }; |
| 782 | 788 |
| 783 } // namespace content | 789 } // namespace content |
| 784 | 790 |
| 785 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 791 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |