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