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_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ | 12 #ifndef CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ |
13 #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ | 13 #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ |
14 #pragma once | 14 #pragma once |
15 | 15 |
16 #include <map> | 16 #include <map> |
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/scoped_ptr.h" | 22 #include "base/memory/scoped_ptr.h" |
23 #include "base/memory/weak_ptr.h" | 23 #include "base/memory/weak_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/renderer_host/resource_queue.h" | 27 #include "content/browser/renderer_host/resource_queue.h" |
28 #include "content/browser/ssl/ssl_error_handler.h" | |
28 #include "content/common/content_export.h" | 29 #include "content/common/content_export.h" |
29 #include "content/public/browser/child_process_data.h" | 30 #include "content/public/browser/child_process_data.h" |
30 #include "content/public/browser/notification_types.h" | 31 #include "content/public/browser/notification_types.h" |
31 #include "ipc/ipc_message.h" | 32 #include "ipc/ipc_message.h" |
32 #include "net/url_request/url_request.h" | 33 #include "net/url_request/url_request.h" |
33 #include "webkit/glue/resource_type.h" | 34 #include "webkit/glue/resource_type.h" |
34 | 35 |
35 class DownloadFileManager; | 36 class DownloadFileManager; |
36 class ResourceDispatcherHostRequestInfo; | 37 class ResourceDispatcherHostRequestInfo; |
37 class ResourceHandler; | 38 class ResourceHandler; |
(...skipping 12 matching lines...) Expand all Loading... | |
50 | 51 |
51 namespace net { | 52 namespace net { |
52 class CookieList; | 53 class CookieList; |
53 class URLRequestJobFactory; | 54 class URLRequestJobFactory; |
54 } // namespace net | 55 } // namespace net |
55 | 56 |
56 namespace webkit_blob { | 57 namespace webkit_blob { |
57 class DeletableFileReference; | 58 class DeletableFileReference; |
58 } | 59 } |
59 | 60 |
60 class CONTENT_EXPORT ResourceDispatcherHost : public net::URLRequest::Delegate { | 61 class CONTENT_EXPORT ResourceDispatcherHost |
62 : public net::URLRequest::Delegate, | |
63 public SSLErrorHandler::Delegate { | |
61 public: | 64 public: |
62 ResourceDispatcherHost(); | 65 ResourceDispatcherHost(); |
63 virtual ~ResourceDispatcherHost(); | 66 virtual ~ResourceDispatcherHost(); |
64 | 67 |
65 // Returns the current ResourceDispatcherHost. May return NULL if it hasn't | 68 // Returns the current ResourceDispatcherHost. May return NULL if it hasn't |
66 // been created yet. | 69 // been created yet. |
67 static ResourceDispatcherHost* Get(); | 70 static ResourceDispatcherHost* Get(); |
68 | 71 |
69 // Puts the resource dispatcher host in an inactive state (unable to begin | 72 // Puts the resource dispatcher host in an inactive state (unable to begin |
70 // new requests). Cancels all pending requests. | 73 // new requests). Cancels all pending requests. |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 | 280 |
278 scoped_refptr<ResourceHandler> CreateResourceHandlerForDownload( | 281 scoped_refptr<ResourceHandler> CreateResourceHandlerForDownload( |
279 net::URLRequest* request, | 282 net::URLRequest* request, |
280 content::ResourceContext* context, | 283 content::ResourceContext* context, |
281 int child_id, | 284 int child_id, |
282 int route_id, | 285 int route_id, |
283 int request_id, | 286 int request_id, |
284 const DownloadSaveInfo& save_info, | 287 const DownloadSaveInfo& save_info, |
285 const DownloadResourceHandler::OnStartedCallback& started_cb); | 288 const DownloadResourceHandler::OnStartedCallback& started_cb); |
286 | 289 |
290 // SSLErrorHandler::Delegate | |
wtc
2012/02/24 00:44:38
Nit: add ':' at the end of this line. Remove the b
Takashi Toyoshima
2012/02/28 20:55:43
Done.
| |
291 virtual ResourceType::Type ResourceTypeForSSLRequest( | |
292 const content::GlobalRequestID& id) OVERRIDE; | |
293 | |
294 virtual const GURL& URLForSSLRequest( | |
295 const content::GlobalRequestID& id) OVERRIDE; | |
296 | |
297 virtual bool RenderViewForSSLRequest(const content::GlobalRequestID& id, | |
298 int* render_process_host_id, | |
299 int* render_view_host_id) OVERRIDE; | |
300 | |
301 virtual void CancelSSLRequest(const content::GlobalRequestID& id, | |
302 int error, | |
303 const net::SSLInfo* ssl_info) OVERRIDE; | |
304 | |
305 virtual void ContinueSSLRequest(const content::GlobalRequestID& id) OVERRIDE; | |
306 | |
287 private: | 307 private: |
288 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 308 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
289 TestBlockedRequestsProcessDies); | 309 TestBlockedRequestsProcessDies); |
290 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 310 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
291 IncrementOutstandingRequestsMemoryCost); | 311 IncrementOutstandingRequestsMemoryCost); |
292 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, | 312 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, |
293 CalculateApproximateMemoryCost); | 313 CalculateApproximateMemoryCost); |
294 | 314 |
295 class ShutdownTask; | 315 class ShutdownTask; |
296 | 316 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
537 // Maps the request ID of request that is being transferred to a new RVH | 557 // Maps the request ID of request that is being transferred to a new RVH |
538 // to the respective request. | 558 // to the respective request. |
539 typedef std::map<content::GlobalRequestID, net::URLRequest*> | 559 typedef std::map<content::GlobalRequestID, net::URLRequest*> |
540 TransferredNavigations; | 560 TransferredNavigations; |
541 TransferredNavigations transferred_navigations_; | 561 TransferredNavigations transferred_navigations_; |
542 | 562 |
543 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); | 563 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); |
544 }; | 564 }; |
545 | 565 |
546 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ | 566 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ |
OLD | NEW |