| 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 |
| 11 | 11 |
| 12 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 12 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| 13 #define CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 13 #define CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| 14 | 14 |
| 15 #include <map> | 15 #include <map> |
| 16 #include <set> | 16 #include <set> |
| 17 #include <string> | 17 #include <string> |
| 18 #include <vector> | 18 #include <vector> |
| 19 | 19 |
| 20 #include "base/basictypes.h" | 20 #include "base/basictypes.h" |
| 21 #include "base/gtest_prod_util.h" | 21 #include "base/gtest_prod_util.h" |
| 22 #include "base/memory/linked_ptr.h" | 22 #include "base/memory/linked_ptr.h" |
| 23 #include "base/memory/scoped_ptr.h" | 23 #include "base/memory/scoped_ptr.h" |
| 24 #include "base/time.h" | 24 #include "base/time.h" |
| 25 #include "base/timer.h" | 25 #include "base/timer.h" |
| 26 #include "content/browser/download/download_resource_handler.h" | 26 #include "content/browser/download/download_resource_handler.h" |
| 27 #include "content/browser/loader/resource_loader.h" | 27 #include "content/browser/loader/resource_loader.h" |
| 28 #include "content/browser/loader/resource_loader_delegate.h" | 28 #include "content/browser/loader/resource_loader_delegate.h" |
| 29 #include "content/browser/loader/resource_scheduler.h" |
| 29 #include "content/common/content_export.h" | 30 #include "content/common/content_export.h" |
| 30 #include "content/public/browser/child_process_data.h" | 31 #include "content/public/browser/child_process_data.h" |
| 31 #include "content/public/browser/notification_types.h" | 32 #include "content/public/browser/notification_types.h" |
| 32 #include "content/public/browser/resource_dispatcher_host.h" | 33 #include "content/public/browser/resource_dispatcher_host.h" |
| 33 #include "ipc/ipc_message.h" | 34 #include "ipc/ipc_message.h" |
| 34 #include "net/cookies/canonical_cookie.h" | 35 #include "net/cookies/canonical_cookie.h" |
| 35 #include "net/url_request/url_request.h" | 36 #include "net/url_request/url_request.h" |
| 36 #include "webkit/glue/resource_type.h" | 37 #include "webkit/glue/resource_type.h" |
| 37 | 38 |
| 38 class ResourceHandler; | 39 class ResourceHandler; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // Must be called after the ResourceRequestInfo has been created | 203 // Must be called after the ResourceRequestInfo has been created |
| 203 // and associated with the request. | 204 // and associated with the request. |
| 204 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( | 205 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( |
| 205 net::URLRequest* request, | 206 net::URLRequest* request, |
| 206 bool is_content_initiated, | 207 bool is_content_initiated, |
| 207 scoped_ptr<DownloadSaveInfo> save_info, | 208 scoped_ptr<DownloadSaveInfo> save_info, |
| 208 const DownloadResourceHandler::OnStartedCallback& started_cb); | 209 const DownloadResourceHandler::OnStartedCallback& started_cb); |
| 209 | 210 |
| 210 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); | 211 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); |
| 211 | 212 |
| 213 ResourceScheduler* scheduler() { return &scheduler_; } |
| 214 |
| 212 private: | 215 private: |
| 213 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 216 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 214 TestBlockedRequestsProcessDies); | 217 TestBlockedRequestsProcessDies); |
| 215 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 218 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 216 IncrementOutstandingRequestsMemoryCost); | 219 IncrementOutstandingRequestsMemoryCost); |
| 217 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 220 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
| 218 CalculateApproximateMemoryCost); | 221 CalculateApproximateMemoryCost); |
| 219 | 222 |
| 220 class ShutdownTask; | 223 class ShutdownTask; |
| 221 | 224 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 ResourceMessageFilter* filter_; | 409 ResourceMessageFilter* filter_; |
| 407 | 410 |
| 408 ResourceDispatcherHostDelegate* delegate_; | 411 ResourceDispatcherHostDelegate* delegate_; |
| 409 | 412 |
| 410 bool allow_cross_origin_auth_prompt_; | 413 bool allow_cross_origin_auth_prompt_; |
| 411 | 414 |
| 412 // http://crbug.com/90971 - Assists in tracking down use-after-frees on | 415 // http://crbug.com/90971 - Assists in tracking down use-after-frees on |
| 413 // shutdown. | 416 // shutdown. |
| 414 std::set<const ResourceContext*> active_resource_contexts_; | 417 std::set<const ResourceContext*> active_resource_contexts_; |
| 415 | 418 |
| 419 ResourceScheduler scheduler_; |
| 420 |
| 416 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 421 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 417 }; | 422 }; |
| 418 | 423 |
| 419 } // namespace content | 424 } // namespace content |
| 420 | 425 |
| 421 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 426 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |