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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 namespace webkit_blob { | 51 namespace webkit_blob { |
52 class ShareableFileReference; | 52 class ShareableFileReference; |
53 } | 53 } |
54 | 54 |
55 namespace content { | 55 namespace content { |
56 class ResourceContext; | 56 class ResourceContext; |
57 class ResourceDispatcherHostDelegate; | 57 class ResourceDispatcherHostDelegate; |
58 class ResourceMessageDelegate; | 58 class ResourceMessageDelegate; |
59 class ResourceMessageFilter; | 59 class ResourceMessageFilter; |
60 class ResourceRequestInfoImpl; | 60 class ResourceRequestInfoImpl; |
| 61 class StreamResourceHandler; |
61 class SaveFileManager; | 62 class SaveFileManager; |
62 class WebContentsImpl; | 63 class WebContentsImpl; |
63 struct DownloadSaveInfo; | 64 struct DownloadSaveInfo; |
64 struct Referrer; | 65 struct Referrer; |
65 | 66 |
66 class CONTENT_EXPORT ResourceDispatcherHostImpl | 67 class CONTENT_EXPORT ResourceDispatcherHostImpl |
67 : public ResourceDispatcherHost, | 68 : public ResourceDispatcherHost, |
68 public ResourceLoaderDelegate { | 69 public ResourceLoaderDelegate { |
69 public: | 70 public: |
70 ResourceDispatcherHostImpl(); | 71 ResourceDispatcherHostImpl(); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // assignment. | 204 // assignment. |
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 bool must_download, | 208 bool must_download, |
208 uint32 id, | 209 uint32 id, |
209 scoped_ptr<DownloadSaveInfo> save_info, | 210 scoped_ptr<DownloadSaveInfo> save_info, |
210 const DownloadUrlParameters::OnStartedCallback& started_cb); | 211 const DownloadUrlParameters::OnStartedCallback& started_cb); |
211 | 212 |
212 // Must be called after the ResourceRequestInfo has been created | 213 // Must be called after the ResourceRequestInfo has been created |
213 // and associated with the request. | 214 // and associated with the request. If |payload| is set to a non-empty value, |
| 215 // the value will be sent to the old resource handler instead of cancelling |
| 216 // it, except on HTTP errors. |
214 scoped_ptr<ResourceHandler> MaybeInterceptAsStream( | 217 scoped_ptr<ResourceHandler> MaybeInterceptAsStream( |
215 net::URLRequest* request, | 218 net::URLRequest* request, |
216 ResourceResponse* response); | 219 ResourceResponse* response, |
| 220 std::string* payload); |
217 | 221 |
218 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); | 222 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); |
219 | 223 |
220 ResourceScheduler* scheduler() { return scheduler_.get(); } | 224 ResourceScheduler* scheduler() { return scheduler_.get(); } |
221 | 225 |
222 // Called by a ResourceHandler when it's ready to start reading data and | 226 // Called by a ResourceHandler when it's ready to start reading data and |
223 // sending it to the renderer. Returns true if there are enough file | 227 // sending it to the renderer. Returns true if there are enough file |
224 // descriptors available for the shared memory buffer. If false is returned, | 228 // descriptors available for the shared memory buffer. If false is returned, |
225 // the request should cancel. | 229 // the request should cancel. |
226 bool HasSufficientResourcesForRequest(const net::URLRequest* request_); | 230 bool HasSufficientResourcesForRequest(const net::URLRequest* request_); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 DelegateMap delegate_map_; | 506 DelegateMap delegate_map_; |
503 | 507 |
504 scoped_ptr<ResourceScheduler> scheduler_; | 508 scoped_ptr<ResourceScheduler> scheduler_; |
505 | 509 |
506 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 510 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
507 }; | 511 }; |
508 | 512 |
509 } // namespace content | 513 } // namespace content |
510 | 514 |
511 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 515 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |