| 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 |
| 11 | 11 |
| 12 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 12 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| 13 #define CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 13 #define CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| 14 | 14 |
| 15 #include <map> | 15 #include <map> |
| 16 #include <set> | 16 #include <set> |
| 17 #include <string> | 17 #include <string> |
| 18 #include <vector> | 18 #include <vector> |
| 19 | 19 |
| 20 #include "base/basictypes.h" | 20 #include "base/basictypes.h" |
| 21 #include "base/gtest_prod_util.h" | 21 #include "base/gtest_prod_util.h" |
| 22 #include "base/memory/linked_ptr.h" | 22 #include "base/memory/linked_ptr.h" |
| 23 #include "base/memory/scoped_ptr.h" | 23 #include "base/memory/scoped_ptr.h" |
| 24 #include "base/observer_list.h" | 24 #include "base/observer_list.h" |
| 25 #include "base/time/time.h" | 25 #include "base/time/time.h" |
| 26 #include "base/timer/timer.h" | 26 #include "base/timer/timer.h" |
| 27 #include "content/browser/download/download_resource_handler.h" | 27 #include "content/browser/download/download_resource_handler.h" |
| 28 #include "content/browser/download/save_types.h" |
| 28 #include "content/browser/loader/global_routing_id.h" | 29 #include "content/browser/loader/global_routing_id.h" |
| 29 #include "content/browser/loader/resource_loader.h" | 30 #include "content/browser/loader/resource_loader.h" |
| 30 #include "content/browser/loader/resource_loader_delegate.h" | 31 #include "content/browser/loader/resource_loader_delegate.h" |
| 31 #include "content/browser/loader/resource_scheduler.h" | 32 #include "content/browser/loader/resource_scheduler.h" |
| 32 #include "content/common/content_export.h" | 33 #include "content/common/content_export.h" |
| 33 #include "content/common/resource_request_body.h" | 34 #include "content/common/resource_request_body.h" |
| 34 #include "content/public/browser/child_process_data.h" | 35 #include "content/public/browser/child_process_data.h" |
| 35 #include "content/public/browser/download_item.h" | 36 #include "content/public/browser/download_item.h" |
| 36 #include "content/public/browser/download_url_parameters.h" | 37 #include "content/public/browser/download_url_parameters.h" |
| 37 #include "content/public/browser/global_request_id.h" | 38 #include "content/public/browser/global_request_id.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 void CancelRequestsForContext(ResourceContext* context); | 122 void CancelRequestsForContext(ResourceContext* context); |
| 122 | 123 |
| 123 // Returns true if the message was a resource message that was processed. | 124 // Returns true if the message was a resource message that was processed. |
| 124 bool OnMessageReceived(const IPC::Message& message, | 125 bool OnMessageReceived(const IPC::Message& message, |
| 125 ResourceMessageFilter* filter); | 126 ResourceMessageFilter* filter); |
| 126 | 127 |
| 127 // Initiates a save file from the browser process (as opposed to a resource | 128 // Initiates a save file from the browser process (as opposed to a resource |
| 128 // request from the renderer or another child process). | 129 // request from the renderer or another child process). |
| 129 void BeginSaveFile(const GURL& url, | 130 void BeginSaveFile(const GURL& url, |
| 130 const Referrer& referrer, | 131 const Referrer& referrer, |
| 131 int save_package_id, | 132 SavePackageId save_package_id, |
| 132 int child_id, | 133 int child_id, |
| 133 int render_view_route_id, | 134 int render_view_route_id, |
| 134 int render_frame_route_id, | 135 int render_frame_route_id, |
| 135 ResourceContext* context); | 136 ResourceContext* context); |
| 136 | 137 |
| 137 // Cancels the given request if it still exists. | 138 // Cancels the given request if it still exists. |
| 138 void CancelRequest(int child_id, int request_id); | 139 void CancelRequest(int child_id, int request_id); |
| 139 | 140 |
| 140 // Marks the request as "parked". This happens if a request is | 141 // Marks the request as "parked". This happens if a request is |
| 141 // redirected cross-site and needs to be resumed by a new render view. | 142 // redirected cross-site and needs to be resumed by a new render view. |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 DelegateMap delegate_map_; | 599 DelegateMap delegate_map_; |
| 599 | 600 |
| 600 scoped_ptr<ResourceScheduler> scheduler_; | 601 scoped_ptr<ResourceScheduler> scheduler_; |
| 601 | 602 |
| 602 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 603 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 603 }; | 604 }; |
| 604 | 605 |
| 605 } // namespace content | 606 } // namespace content |
| 606 | 607 |
| 607 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 608 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |