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 27 matching lines...) Expand all Loading... | |
38 #include "content/public/browser/notification_types.h" | 38 #include "content/public/browser/notification_types.h" |
39 #include "content/public/browser/resource_dispatcher_host.h" | 39 #include "content/public/browser/resource_dispatcher_host.h" |
40 #include "content/public/common/resource_type.h" | 40 #include "content/public/common/resource_type.h" |
41 #include "ipc/ipc_message.h" | 41 #include "ipc/ipc_message.h" |
42 #include "net/cookies/canonical_cookie.h" | 42 #include "net/cookies/canonical_cookie.h" |
43 #include "net/url_request/url_request.h" | 43 #include "net/url_request/url_request.h" |
44 | 44 |
45 class ResourceHandler; | 45 class ResourceHandler; |
46 struct ResourceHostMsg_Request; | 46 struct ResourceHostMsg_Request; |
47 | 47 |
48 namespace base { | |
49 class FilePath; | |
50 } | |
51 | |
48 namespace net { | 52 namespace net { |
49 class URLRequestJobFactory; | 53 class URLRequestJobFactory; |
50 } | 54 } |
51 | 55 |
52 namespace storage { | 56 namespace storage { |
53 class ShareableFileReference; | 57 class ShareableFileReference; |
54 } | 58 } |
55 | 59 |
56 namespace content { | 60 namespace content { |
57 class AppCacheService; | 61 class AppCacheService; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 bool is_content_initiated, | 234 bool is_content_initiated, |
231 bool must_download, | 235 bool must_download, |
232 uint32 id, | 236 uint32 id, |
233 scoped_ptr<DownloadSaveInfo> save_info, | 237 scoped_ptr<DownloadSaveInfo> save_info, |
234 const DownloadUrlParameters::OnStartedCallback& started_cb); | 238 const DownloadUrlParameters::OnStartedCallback& started_cb); |
235 | 239 |
236 // Must be called after the ResourceRequestInfo has been created | 240 // Must be called after the ResourceRequestInfo has been created |
237 // and associated with the request. If |payload| is set to a non-empty value, | 241 // and associated with the request. If |payload| is set to a non-empty value, |
238 // the value will be sent to the old resource handler instead of canceling | 242 // the value will be sent to the old resource handler instead of canceling |
239 // it, except on HTTP errors. This is marked virtual so it can be overriden in | 243 // it, except on HTTP errors. This is marked virtual so it can be overriden in |
240 // testing. | 244 // testing. |
mmenke
2015/06/05 18:45:50
Can we document what this method actually does, ra
raymes
2015/06/09 00:10:46
Done.
| |
241 virtual scoped_ptr<ResourceHandler> MaybeInterceptAsStream( | 245 virtual scoped_ptr<ResourceHandler> MaybeInterceptAsStream( |
246 const base::FilePath& plugin_path, | |
242 net::URLRequest* request, | 247 net::URLRequest* request, |
243 ResourceResponse* response, | 248 ResourceResponse* response, |
244 std::string* payload); | 249 std::string* payload); |
245 | 250 |
246 ResourceScheduler* scheduler() { return scheduler_.get(); } | 251 ResourceScheduler* scheduler() { return scheduler_.get(); } |
247 | 252 |
248 // Called by a ResourceHandler when it's ready to start reading data and | 253 // Called by a ResourceHandler when it's ready to start reading data and |
249 // sending it to the renderer. Returns true if there are enough file | 254 // sending it to the renderer. Returns true if there are enough file |
250 // descriptors available for the shared memory buffer. If false is returned, | 255 // descriptors available for the shared memory buffer. If false is returned, |
251 // the request should cancel. | 256 // the request should cancel. |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
578 DelegateMap delegate_map_; | 583 DelegateMap delegate_map_; |
579 | 584 |
580 scoped_ptr<ResourceScheduler> scheduler_; | 585 scoped_ptr<ResourceScheduler> scheduler_; |
581 | 586 |
582 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 587 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
583 }; | 588 }; |
584 | 589 |
585 } // namespace content | 590 } // namespace content |
586 | 591 |
587 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 592 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |