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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // assignment. | 203 // assignment. |
204 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( | 204 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( |
205 net::URLRequest* request, | 205 net::URLRequest* request, |
206 bool is_content_initiated, | 206 bool is_content_initiated, |
207 bool must_download, | 207 bool must_download, |
208 uint32 id, | 208 uint32 id, |
209 scoped_ptr<DownloadSaveInfo> save_info, | 209 scoped_ptr<DownloadSaveInfo> save_info, |
210 const DownloadUrlParameters::OnStartedCallback& started_cb); | 210 const DownloadUrlParameters::OnStartedCallback& started_cb); |
211 | 211 |
212 // Must be called after the ResourceRequestInfo has been created | 212 // Must be called after the ResourceRequestInfo has been created |
213 // and associated with the request. | 213 // and associated with the request. If |payload| is set to a non-empty value, |
| 214 // the value will be sent to the old resource handler instead of cancelling |
| 215 // it, except on HTTP errors. |
214 scoped_ptr<ResourceHandler> MaybeInterceptAsStream( | 216 scoped_ptr<ResourceHandler> MaybeInterceptAsStream( |
215 net::URLRequest* request, | 217 net::URLRequest* request, |
216 ResourceResponse* response); | 218 ResourceResponse* response, |
| 219 std::string* payload); |
217 | 220 |
218 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); | 221 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); |
219 | 222 |
220 ResourceScheduler* scheduler() { return scheduler_.get(); } | 223 ResourceScheduler* scheduler() { return scheduler_.get(); } |
221 | 224 |
222 // Called by a ResourceHandler when it's ready to start reading data and | 225 // 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 | 226 // sending it to the renderer. Returns true if there are enough file |
224 // descriptors available for the shared memory buffer. If false is returned, | 227 // descriptors available for the shared memory buffer. If false is returned, |
225 // the request should cancel. | 228 // the request should cancel. |
226 bool HasSufficientResourcesForRequest(const net::URLRequest* request_); | 229 bool HasSufficientResourcesForRequest(const net::URLRequest* request_); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 DelegateMap delegate_map_; | 505 DelegateMap delegate_map_; |
503 | 506 |
504 scoped_ptr<ResourceScheduler> scheduler_; | 507 scoped_ptr<ResourceScheduler> scheduler_; |
505 | 508 |
506 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 509 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
507 }; | 510 }; |
508 | 511 |
509 } // namespace content | 512 } // namespace content |
510 | 513 |
511 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 514 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |