| 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 <stdint.h> | 15 #include <stdint.h> |
| 16 | 16 |
| 17 #include <map> | 17 #include <map> |
| 18 #include <set> | 18 #include <set> |
| 19 #include <string> | 19 #include <string> |
| 20 #include <vector> | 20 #include <vector> |
| 21 | 21 |
| 22 #include "base/gtest_prod_util.h" | 22 #include "base/gtest_prod_util.h" |
| 23 #include "base/macros.h" | 23 #include "base/macros.h" |
| 24 #include "base/memory/linked_ptr.h" | 24 #include "base/memory/linked_ptr.h" |
| 25 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
| 26 #include "base/observer_list.h" | 26 #include "base/observer_list.h" |
| 27 #include "base/time/time.h" | 27 #include "base/time/time.h" |
| 28 #include "base/timer/timer.h" | 28 #include "base/timer/timer.h" |
| 29 #include "content/browser/download/download_resource_handler.h" | 29 #include "content/browser/download/download_resource_handler.h" |
| 30 #include "content/browser/download/save_types.h" |
| 30 #include "content/browser/loader/global_routing_id.h" | 31 #include "content/browser/loader/global_routing_id.h" |
| 31 #include "content/browser/loader/resource_loader.h" | 32 #include "content/browser/loader/resource_loader.h" |
| 32 #include "content/browser/loader/resource_loader_delegate.h" | 33 #include "content/browser/loader/resource_loader_delegate.h" |
| 33 #include "content/browser/loader/resource_scheduler.h" | 34 #include "content/browser/loader/resource_scheduler.h" |
| 34 #include "content/common/content_export.h" | 35 #include "content/common/content_export.h" |
| 35 #include "content/common/resource_request_body.h" | 36 #include "content/common/resource_request_body.h" |
| 36 #include "content/public/browser/child_process_data.h" | 37 #include "content/public/browser/child_process_data.h" |
| 37 #include "content/public/browser/download_item.h" | 38 #include "content/public/browser/download_item.h" |
| 38 #include "content/public/browser/download_url_parameters.h" | 39 #include "content/public/browser/download_url_parameters.h" |
| 39 #include "content/public/browser/global_request_id.h" | 40 #include "content/public/browser/global_request_id.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void CancelRequestsForContext(ResourceContext* context); | 125 void CancelRequestsForContext(ResourceContext* context); |
| 125 | 126 |
| 126 // Returns true if the message was a resource message that was processed. | 127 // Returns true if the message was a resource message that was processed. |
| 127 bool OnMessageReceived(const IPC::Message& message, | 128 bool OnMessageReceived(const IPC::Message& message, |
| 128 ResourceMessageFilter* filter); | 129 ResourceMessageFilter* filter); |
| 129 | 130 |
| 130 // Initiates a save file from the browser process (as opposed to a resource | 131 // Initiates a save file from the browser process (as opposed to a resource |
| 131 // request from the renderer or another child process). | 132 // request from the renderer or another child process). |
| 132 void BeginSaveFile(const GURL& url, | 133 void BeginSaveFile(const GURL& url, |
| 133 const Referrer& referrer, | 134 const Referrer& referrer, |
| 134 int save_item_id, | 135 SaveItemId save_item_id, |
| 135 int save_package_id, | 136 SavePackageId save_package_id, |
| 136 int child_id, | 137 int child_id, |
| 137 int render_view_route_id, | 138 int render_view_route_id, |
| 138 int render_frame_route_id, | 139 int render_frame_route_id, |
| 139 ResourceContext* context); | 140 ResourceContext* context); |
| 140 | 141 |
| 141 // Cancels the given request if it still exists. | 142 // Cancels the given request if it still exists. |
| 142 void CancelRequest(int child_id, int request_id); | 143 void CancelRequest(int child_id, int request_id); |
| 143 | 144 |
| 144 // Marks the request as "parked". This happens if a request is | 145 // Marks the request as "parked". This happens if a request is |
| 145 // redirected cross-site and needs to be resumed by a new render view. | 146 // redirected cross-site and needs to be resumed by a new render view. |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 DelegateMap delegate_map_; | 611 DelegateMap delegate_map_; |
| 611 | 612 |
| 612 scoped_ptr<ResourceScheduler> scheduler_; | 613 scoped_ptr<ResourceScheduler> scheduler_; |
| 613 | 614 |
| 614 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 615 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 615 }; | 616 }; |
| 616 | 617 |
| 617 } // namespace content | 618 } // namespace content |
| 618 | 619 |
| 619 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 620 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |