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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // dialog boxes. | 219 // dialog boxes. |
220 bool allow_cross_origin_auth_prompt(); | 220 bool allow_cross_origin_auth_prompt(); |
221 | 221 |
222 ResourceDispatcherHostDelegate* delegate() { | 222 ResourceDispatcherHostDelegate* delegate() { |
223 return delegate_; | 223 return delegate_; |
224 } | 224 } |
225 | 225 |
226 // Must be called after the ResourceRequestInfo has been created | 226 // Must be called after the ResourceRequestInfo has been created |
227 // and associated with the request. | 227 // and associated with the request. |
228 // |id| should be |content::DownloadItem::kInvalidId| to request automatic | 228 // |id| should be |content::DownloadItem::kInvalidId| to request automatic |
229 // assignment. | 229 // assignment. This is marked virtual so it can be overriden in testing. |
230 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( | 230 virtual scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( |
231 net::URLRequest* request, | 231 net::URLRequest* request, |
232 bool is_content_initiated, | 232 bool is_content_initiated, |
233 bool must_download, | 233 bool must_download, |
234 uint32 id, | 234 uint32 id, |
235 scoped_ptr<DownloadSaveInfo> save_info, | 235 scoped_ptr<DownloadSaveInfo> save_info, |
236 const DownloadUrlParameters::OnStartedCallback& started_cb); | 236 const DownloadUrlParameters::OnStartedCallback& started_cb); |
237 | 237 |
238 // Must be called after the ResourceRequestInfo has been created | 238 // Must be called after the ResourceRequestInfo has been created |
239 // and associated with the request. If |payload| is set to a non-empty value, | 239 // and associated with the request. If |payload| is set to a non-empty value, |
240 // the value will be sent to the old resource handler instead of canceling | 240 // the value will be sent to the old resource handler instead of canceling |
241 // it, except on HTTP errors. | 241 // it, except on HTTP errors. This is marked virtual so it can be overriden in |
242 scoped_ptr<ResourceHandler> MaybeInterceptAsStream( | 242 // testing. |
| 243 virtual scoped_ptr<ResourceHandler> MaybeInterceptAsStream( |
243 net::URLRequest* request, | 244 net::URLRequest* request, |
244 ResourceResponse* response, | 245 ResourceResponse* response, |
245 std::string* payload); | 246 std::string* payload); |
246 | 247 |
247 ResourceScheduler* scheduler() { return scheduler_.get(); } | 248 ResourceScheduler* scheduler() { return scheduler_.get(); } |
248 | 249 |
249 // Called by a ResourceHandler when it's ready to start reading data and | 250 // Called by a ResourceHandler when it's ready to start reading data and |
250 // sending it to the renderer. Returns true if there are enough file | 251 // sending it to the renderer. Returns true if there are enough file |
251 // descriptors available for the shared memory buffer. If false is returned, | 252 // descriptors available for the shared memory buffer. If false is returned, |
252 // the request should cancel. | 253 // the request should cancel. |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 DelegateMap delegate_map_; | 549 DelegateMap delegate_map_; |
549 | 550 |
550 scoped_ptr<ResourceScheduler> scheduler_; | 551 scoped_ptr<ResourceScheduler> scheduler_; |
551 | 552 |
552 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 553 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
553 }; | 554 }; |
554 | 555 |
555 } // namespace content | 556 } // namespace content |
556 | 557 |
557 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 558 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |