| 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 11 matching lines...) Expand all Loading... |
| 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/loader/global_routing_id.h" | 28 #include "content/browser/loader/global_routing_id.h" |
| 29 #include "content/browser/loader/resource_loader.h" | 29 #include "content/browser/loader/resource_loader.h" |
| 30 #include "content/browser/loader/resource_loader_delegate.h" | 30 #include "content/browser/loader/resource_loader_delegate.h" |
| 31 #include "content/browser/loader/resource_scheduler.h" | 31 #include "content/browser/loader/resource_scheduler.h" |
| 32 #include "content/browser/renderer_host/render_widget_host_delegate.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" |
| 38 #include "content/public/browser/notification_types.h" | 39 #include "content/public/browser/notification_types.h" |
| 39 #include "content/public/browser/resource_dispatcher_host.h" | 40 #include "content/public/browser/resource_dispatcher_host.h" |
| 40 #include "content/public/common/resource_type.h" | 41 #include "content/public/common/resource_type.h" |
| 41 #include "ipc/ipc_message.h" | 42 #include "ipc/ipc_message.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 158 |
| 158 // The average private bytes increase of the browser for each new pending | 159 // The average private bytes increase of the browser for each new pending |
| 159 // request. Experimentally obtained. | 160 // request. Experimentally obtained. |
| 160 static const int kAvgBytesPerOutstandingRequest = 4400; | 161 static const int kAvgBytesPerOutstandingRequest = 4400; |
| 161 | 162 |
| 162 SaveFileManager* save_file_manager() const { | 163 SaveFileManager* save_file_manager() const { |
| 163 return save_file_manager_.get(); | 164 return save_file_manager_.get(); |
| 164 } | 165 } |
| 165 | 166 |
| 166 // Called when a RenderViewHost is created. | 167 // Called when a RenderViewHost is created. |
| 167 void OnRenderViewHostCreated(int child_id, int route_id); | 168 void OnRenderViewHostCreated(int child_id, |
| 169 int route_id, |
| 170 RenderWidgetHostDelegate* widget_delegate); |
| 168 | 171 |
| 169 // Called when a RenderViewHost is deleted. | 172 // Called when a RenderViewHost is deleted. |
| 170 void OnRenderViewHostDeleted(int child_id, int route_id); | 173 void OnRenderViewHostDeleted(int child_id, int route_id); |
| 171 | 174 |
| 172 // Force cancels any pending requests for the given process. | 175 // Force cancels any pending requests for the given process. |
| 173 void CancelRequestsForProcess(int child_id); | 176 void CancelRequestsForProcess(int child_id); |
| 174 | 177 |
| 175 void OnUserGesture(WebContentsImpl* contents); | 178 void OnUserGesture(WebContentsImpl* contents); |
| 176 | 179 |
| 177 // Retrieves a net::URLRequest. Must be called from the IO thread. | 180 // Retrieves a net::URLRequest. Must be called from the IO thread. |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 DelegateMap delegate_map_; | 519 DelegateMap delegate_map_; |
| 517 | 520 |
| 518 scoped_ptr<ResourceScheduler> scheduler_; | 521 scoped_ptr<ResourceScheduler> scheduler_; |
| 519 | 522 |
| 520 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 523 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 521 }; | 524 }; |
| 522 | 525 |
| 523 } // namespace content | 526 } // namespace content |
| 524 | 527 |
| 525 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 528 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |