| 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 16 matching lines...) Expand all Loading... |
| 27 #include "content/browser/download/download_resource_handler.h" | 27 #include "content/browser/download/download_resource_handler.h" |
| 28 #include "content/browser/download/save_types.h" | 28 #include "content/browser/download/save_types.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.h" | 30 #include "content/browser/loader/resource_loader.h" |
| 31 #include "content/browser/loader/resource_loader_delegate.h" | 31 #include "content/browser/loader/resource_loader_delegate.h" |
| 32 #include "content/browser/loader/resource_scheduler.h" | 32 #include "content/browser/loader/resource_scheduler.h" |
| 33 #include "content/common/content_export.h" | 33 #include "content/common/content_export.h" |
| 34 #include "content/public/browser/global_request_id.h" | 34 #include "content/public/browser/global_request_id.h" |
| 35 #include "content/public/browser/resource_dispatcher_host.h" | 35 #include "content/public/browser/resource_dispatcher_host.h" |
| 36 #include "content/public/browser/web_contents_observer.h" | 36 #include "content/public/browser/web_contents_observer.h" |
| 37 #include "content/public/common/request_context_type.h" |
| 37 #include "content/public/common/resource_type.h" | 38 #include "content/public/common/resource_type.h" |
| 38 #include "ipc/ipc_message.h" | 39 #include "ipc/ipc_message.h" |
| 39 #include "net/base/request_priority.h" | 40 #include "net/base/request_priority.h" |
| 40 #include "net/cookies/canonical_cookie.h" | 41 #include "net/cookies/canonical_cookie.h" |
| 41 #include "net/url_request/url_request.h" | 42 #include "net/url_request/url_request.h" |
| 42 | 43 |
| 43 class ResourceHandler; | 44 class ResourceHandler; |
| 44 | 45 |
| 45 namespace base { | 46 namespace base { |
| 46 class FilePath; | 47 class FilePath; |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 int child_id, | 484 int child_id, |
| 484 ResourceContext* resource_context); | 485 ResourceContext* resource_context); |
| 485 | 486 |
| 486 // Wraps |handler| in the standard resource handlers for normal resource | 487 // Wraps |handler| in the standard resource handlers for normal resource |
| 487 // loading and navigation requests. This adds MimeTypeResourceHandler and | 488 // loading and navigation requests. This adds MimeTypeResourceHandler and |
| 488 // ResourceThrottles. | 489 // ResourceThrottles. |
| 489 std::unique_ptr<ResourceHandler> AddStandardHandlers( | 490 std::unique_ptr<ResourceHandler> AddStandardHandlers( |
| 490 net::URLRequest* request, | 491 net::URLRequest* request, |
| 491 ResourceType resource_type, | 492 ResourceType resource_type, |
| 492 ResourceContext* resource_context, | 493 ResourceContext* resource_context, |
| 494 RequestContextType fetch_request_context_type, |
| 493 AppCacheService* appcache_service, | 495 AppCacheService* appcache_service, |
| 494 int child_id, | 496 int child_id, |
| 495 int route_id, | 497 int route_id, |
| 496 std::unique_ptr<ResourceHandler> handler); | 498 std::unique_ptr<ResourceHandler> handler); |
| 497 | 499 |
| 498 void OnDataDownloadedACK(int request_id); | 500 void OnDataDownloadedACK(int request_id); |
| 499 void OnCancelRequest(int request_id); | 501 void OnCancelRequest(int request_id); |
| 500 void OnReleaseDownloadedFile(int request_id); | 502 void OnReleaseDownloadedFile(int request_id); |
| 501 void OnDidChangePriority(int request_id, | 503 void OnDidChangePriority(int request_id, |
| 502 net::RequestPriority new_priority, | 504 net::RequestPriority new_priority, |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 // Allows tests to use a mock CertStore. If set, the CertStore must | 649 // Allows tests to use a mock CertStore. If set, the CertStore must |
| 648 // outlive this ResourceDispatcherHostImpl. | 650 // outlive this ResourceDispatcherHostImpl. |
| 649 CertStore* cert_store_for_testing_; | 651 CertStore* cert_store_for_testing_; |
| 650 | 652 |
| 651 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 653 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 652 }; | 654 }; |
| 653 | 655 |
| 654 } // namespace content | 656 } // namespace content |
| 655 | 657 |
| 656 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 658 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |