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 | |
52 namespace net { | 48 namespace net { |
53 class URLRequestJobFactory; | 49 class URLRequestJobFactory; |
54 } | 50 } |
55 | 51 |
56 namespace storage { | 52 namespace storage { |
57 class ShareableFileReference; | 53 class ShareableFileReference; |
58 } | 54 } |
59 | 55 |
60 namespace content { | 56 namespace content { |
61 class AppCacheService; | 57 class AppCacheService; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 uint32 id, | 235 uint32 id, |
240 scoped_ptr<DownloadSaveInfo> save_info, | 236 scoped_ptr<DownloadSaveInfo> save_info, |
241 const DownloadUrlParameters::OnStartedCallback& started_cb); | 237 const DownloadUrlParameters::OnStartedCallback& started_cb); |
242 | 238 |
243 // Must be called after the ResourceRequestInfo has been created | 239 // Must be called after the ResourceRequestInfo has been created |
244 // and associated with the request. If |payload| is set to a non-empty value, | 240 // and associated with the request. If |payload| is set to a non-empty value, |
245 // the value will be sent to the old resource handler instead of canceling | 241 // the value will be sent to the old resource handler instead of canceling |
246 // it, except on HTTP errors. This is marked virtual so it can be overriden in | 242 // it, except on HTTP errors. This is marked virtual so it can be overriden in |
247 // testing. | 243 // testing. |
248 virtual scoped_ptr<ResourceHandler> MaybeInterceptAsStream( | 244 virtual scoped_ptr<ResourceHandler> MaybeInterceptAsStream( |
249 const base::FilePath& plugin_path, | |
250 net::URLRequest* request, | 245 net::URLRequest* request, |
251 ResourceResponse* response, | 246 ResourceResponse* response, |
252 std::string* payload); | 247 std::string* payload); |
253 | 248 |
254 ResourceScheduler* scheduler() { return scheduler_.get(); } | 249 ResourceScheduler* scheduler() { return scheduler_.get(); } |
255 | 250 |
256 // Called by a ResourceHandler when it's ready to start reading data and | 251 // Called by a ResourceHandler when it's ready to start reading data and |
257 // sending it to the renderer. Returns true if there are enough file | 252 // sending it to the renderer. Returns true if there are enough file |
258 // descriptors available for the shared memory buffer. If false is returned, | 253 // descriptors available for the shared memory buffer. If false is returned, |
259 // the request should cancel. | 254 // the request should cancel. |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 DelegateMap delegate_map_; | 581 DelegateMap delegate_map_; |
587 | 582 |
588 scoped_ptr<ResourceScheduler> scheduler_; | 583 scoped_ptr<ResourceScheduler> scheduler_; |
589 | 584 |
590 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 585 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
591 }; | 586 }; |
592 | 587 |
593 } // namespace content | 588 } // namespace content |
594 | 589 |
595 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 590 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |