| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #include "content/browser/renderer_host/render_view_host_delegate.h" | 40 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 41 #include "content/browser/renderer_host/resource_dispatcher_host_login_delegate.
h" | 41 #include "content/browser/renderer_host/resource_dispatcher_host_login_delegate.
h" |
| 42 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 42 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| 43 #include "content/browser/renderer_host/resource_message_filter.h" | 43 #include "content/browser/renderer_host/resource_message_filter.h" |
| 44 #include "content/browser/renderer_host/resource_queue.h" | 44 #include "content/browser/renderer_host/resource_queue.h" |
| 45 #include "content/browser/renderer_host/resource_request_details.h" | 45 #include "content/browser/renderer_host/resource_request_details.h" |
| 46 #include "content/browser/renderer_host/sync_resource_handler.h" | 46 #include "content/browser/renderer_host/sync_resource_handler.h" |
| 47 #include "content/browser/resource_context.h" | 47 #include "content/browser/resource_context.h" |
| 48 #include "content/browser/ssl/ssl_client_auth_handler.h" | 48 #include "content/browser/ssl/ssl_client_auth_handler.h" |
| 49 #include "content/browser/ssl/ssl_manager.h" | 49 #include "content/browser/ssl/ssl_manager.h" |
| 50 #include "content/browser/worker_host/worker_service.h" | 50 #include "content/browser/worker_host/worker_service_impl.h" |
| 51 #include "content/common/resource_messages.h" | 51 #include "content/common/resource_messages.h" |
| 52 #include "content/common/view_messages.h" | 52 #include "content/common/view_messages.h" |
| 53 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
| 54 #include "content/public/browser/content_browser_client.h" | 54 #include "content/public/browser/content_browser_client.h" |
| 55 #include "content/public/browser/download_manager.h" | 55 #include "content/public/browser/download_manager.h" |
| 56 #include "content/public/browser/global_request_id.h" | 56 #include "content/public/browser/global_request_id.h" |
| 57 #include "content/public/browser/notification_service.h" | 57 #include "content/public/browser/notification_service.h" |
| 58 #include "content/public/browser/resource_dispatcher_host_delegate.h" | 58 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
| 59 #include "content/public/common/content_switches.h" | 59 #include "content/public/common/content_switches.h" |
| 60 #include "content/public/common/process_type.h" | 60 #include "content/public/common/process_type.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 81 #include "webkit/blob/blob_storage_controller.h" | 81 #include "webkit/blob/blob_storage_controller.h" |
| 82 #include "webkit/blob/deletable_file_reference.h" | 82 #include "webkit/blob/deletable_file_reference.h" |
| 83 | 83 |
| 84 using base::Time; | 84 using base::Time; |
| 85 using base::TimeDelta; | 85 using base::TimeDelta; |
| 86 using base::TimeTicks; | 86 using base::TimeTicks; |
| 87 using content::BrowserThread; | 87 using content::BrowserThread; |
| 88 using content::GlobalRequestID; | 88 using content::GlobalRequestID; |
| 89 using content::ResourceResponse; | 89 using content::ResourceResponse; |
| 90 using content::WebContents; | 90 using content::WebContents; |
| 91 using content::WorkerServiceImpl; |
| 91 using webkit_blob::DeletableFileReference; | 92 using webkit_blob::DeletableFileReference; |
| 92 | 93 |
| 93 // ---------------------------------------------------------------------------- | 94 // ---------------------------------------------------------------------------- |
| 94 | 95 |
| 95 namespace { | 96 namespace { |
| 96 | 97 |
| 97 // The interval for calls to ResourceDispatcherHost::UpdateLoadStates | 98 // The interval for calls to ResourceDispatcherHost::UpdateLoadStates |
| 98 const int kUpdateLoadStatesIntervalMsec = 100; | 99 const int kUpdateLoadStatesIntervalMsec = 100; |
| 99 | 100 |
| 100 // Maximum number of pending data messages sent to the renderer at any | 101 // Maximum number of pending data messages sent to the renderer at any |
| (...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1902 if (!info) { | 1903 if (!info) { |
| 1903 *render_process_host_id = -1; | 1904 *render_process_host_id = -1; |
| 1904 *render_view_host_id = -1; | 1905 *render_view_host_id = -1; |
| 1905 return false; | 1906 return false; |
| 1906 } | 1907 } |
| 1907 | 1908 |
| 1908 // If the request is from the worker process, find a tab that owns the worker. | 1909 // If the request is from the worker process, find a tab that owns the worker. |
| 1909 if (info->process_type() == content::PROCESS_TYPE_WORKER) { | 1910 if (info->process_type() == content::PROCESS_TYPE_WORKER) { |
| 1910 // Need to display some related UI for this network request - pick an | 1911 // Need to display some related UI for this network request - pick an |
| 1911 // arbitrary parent to do so. | 1912 // arbitrary parent to do so. |
| 1912 if (!WorkerService::GetInstance()->GetRendererForWorker( | 1913 if (!WorkerServiceImpl::GetInstance()->GetRendererForWorker( |
| 1913 info->child_id(), render_process_host_id, render_view_host_id)) { | 1914 info->child_id(), render_process_host_id, render_view_host_id)) { |
| 1914 *render_process_host_id = -1; | 1915 *render_process_host_id = -1; |
| 1915 *render_view_host_id = -1; | 1916 *render_view_host_id = -1; |
| 1916 return false; | 1917 return false; |
| 1917 } | 1918 } |
| 1918 } else { | 1919 } else { |
| 1919 *render_process_host_id = info->child_id(); | 1920 *render_process_host_id = info->child_id(); |
| 1920 *render_view_host_id = info->route_id(); | 1921 *render_view_host_id = info->route_id(); |
| 1921 } | 1922 } |
| 1922 return true; | 1923 return true; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2235 | 2236 |
| 2236 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { | 2237 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { |
| 2237 allow_cross_origin_auth_prompt_ = value; | 2238 allow_cross_origin_auth_prompt_ = value; |
| 2238 } | 2239 } |
| 2239 | 2240 |
| 2240 void ResourceDispatcherHost::MarkAsTransferredNavigation( | 2241 void ResourceDispatcherHost::MarkAsTransferredNavigation( |
| 2241 const GlobalRequestID& transferred_request_id, | 2242 const GlobalRequestID& transferred_request_id, |
| 2242 net::URLRequest* ransferred_request) { | 2243 net::URLRequest* ransferred_request) { |
| 2243 transferred_navigations_[transferred_request_id] = ransferred_request; | 2244 transferred_navigations_[transferred_request_id] = ransferred_request; |
| 2244 } | 2245 } |
| OLD | NEW |