| 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 14 matching lines...) Expand all Loading... |
| 25 #include "content/browser/cert_store.h" | 25 #include "content/browser/cert_store.h" |
| 26 #include "content/browser/child_process_security_policy.h" | 26 #include "content/browser/child_process_security_policy.h" |
| 27 #include "content/browser/chrome_blob_storage_context.h" | 27 #include "content/browser/chrome_blob_storage_context.h" |
| 28 #include "content/browser/cross_site_request_manager.h" | 28 #include "content/browser/cross_site_request_manager.h" |
| 29 #include "content/browser/download/download_file_manager.h" | 29 #include "content/browser/download/download_file_manager.h" |
| 30 #include "content/browser/download/download_id_factory.h" | 30 #include "content/browser/download/download_id_factory.h" |
| 31 #include "content/browser/download/download_manager.h" | 31 #include "content/browser/download/download_manager.h" |
| 32 #include "content/browser/download/download_resource_handler.h" | 32 #include "content/browser/download/download_resource_handler.h" |
| 33 #include "content/browser/download/save_file_manager.h" | 33 #include "content/browser/download/save_file_manager.h" |
| 34 #include "content/browser/download/save_file_resource_handler.h" | 34 #include "content/browser/download/save_file_resource_handler.h" |
| 35 #include "content/browser/in_process_webkit/webkit_thread.h" | |
| 36 #include "content/browser/plugin_service.h" | 35 #include "content/browser/plugin_service.h" |
| 37 #include "content/browser/renderer_host/async_resource_handler.h" | 36 #include "content/browser/renderer_host/async_resource_handler.h" |
| 38 #include "content/browser/renderer_host/buffered_resource_handler.h" | 37 #include "content/browser/renderer_host/buffered_resource_handler.h" |
| 39 #include "content/browser/renderer_host/cross_site_resource_handler.h" | 38 #include "content/browser/renderer_host/cross_site_resource_handler.h" |
| 40 #include "content/browser/renderer_host/global_request_id.h" | 39 #include "content/browser/renderer_host/global_request_id.h" |
| 41 #include "content/browser/renderer_host/redirect_to_file_resource_handler.h" | 40 #include "content/browser/renderer_host/redirect_to_file_resource_handler.h" |
| 42 #include "content/browser/renderer_host/render_view_host.h" | 41 #include "content/browser/renderer_host/render_view_host.h" |
| 43 #include "content/browser/renderer_host/render_view_host_delegate.h" | 42 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 44 #include "content/browser/renderer_host/resource_dispatcher_host_login_delegate.
h" | 43 #include "content/browser/renderer_host/resource_dispatcher_host_login_delegate.
h" |
| 45 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 44 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 288 } |
| 290 | 289 |
| 291 } // namespace | 290 } // namespace |
| 292 | 291 |
| 293 ResourceDispatcherHost::ResourceDispatcherHost( | 292 ResourceDispatcherHost::ResourceDispatcherHost( |
| 294 const ResourceQueue::DelegateSet& resource_queue_delegates) | 293 const ResourceQueue::DelegateSet& resource_queue_delegates) |
| 295 : ALLOW_THIS_IN_INITIALIZER_LIST( | 294 : ALLOW_THIS_IN_INITIALIZER_LIST( |
| 296 download_file_manager_(new DownloadFileManager(this))), | 295 download_file_manager_(new DownloadFileManager(this))), |
| 297 ALLOW_THIS_IN_INITIALIZER_LIST( | 296 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 298 save_file_manager_(new SaveFileManager(this))), | 297 save_file_manager_(new SaveFileManager(this))), |
| 299 webkit_thread_(new WebKitThread), | |
| 300 request_id_(-1), | 298 request_id_(-1), |
| 301 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 299 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
| 302 is_shutdown_(false), | 300 is_shutdown_(false), |
| 303 max_outstanding_requests_cost_per_process_( | 301 max_outstanding_requests_cost_per_process_( |
| 304 kMaxOutstandingRequestsCostPerProcess), | 302 kMaxOutstandingRequestsCostPerProcess), |
| 305 filter_(NULL), | 303 filter_(NULL), |
| 306 delegate_(NULL), | 304 delegate_(NULL), |
| 307 allow_cross_origin_auth_prompt_(false) { | 305 allow_cross_origin_auth_prompt_(false) { |
| 308 resource_queue_.Initialize(resource_queue_delegates); | 306 resource_queue_.Initialize(resource_queue_delegates); |
| 309 | 307 |
| 310 ANNOTATE_BENIGN_RACE( | 308 ANNOTATE_BENIGN_RACE( |
| 311 &last_user_gesture_time_, | 309 &last_user_gesture_time_, |
| 312 "We don't care about the precise value, see http://crbug.com/92889"); | 310 "We don't care about the precise value, see http://crbug.com/92889"); |
| 313 } | 311 } |
| 314 | 312 |
| 315 ResourceDispatcherHost::~ResourceDispatcherHost() { | 313 ResourceDispatcherHost::~ResourceDispatcherHost() { |
| 316 AsyncResourceHandler::GlobalCleanup(); | 314 AsyncResourceHandler::GlobalCleanup(); |
| 317 STLDeleteValues(&pending_requests_); | 315 STLDeleteValues(&pending_requests_); |
| 318 } | 316 } |
| 319 | 317 |
| 320 void ResourceDispatcherHost::Initialize() { | 318 void ResourceDispatcherHost::Initialize() { |
| 321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 319 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 322 webkit_thread_->Initialize(); | |
| 323 BrowserThread::PostTask( | 320 BrowserThread::PostTask( |
| 324 BrowserThread::IO, FROM_HERE, | 321 BrowserThread::IO, FROM_HERE, |
| 325 base::Bind(&appcache::AppCacheInterceptor::EnsureRegistered)); | 322 base::Bind(&appcache::AppCacheInterceptor::EnsureRegistered)); |
| 326 } | 323 } |
| 327 | 324 |
| 328 void ResourceDispatcherHost::Shutdown() { | 325 void ResourceDispatcherHost::Shutdown() { |
| 329 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 326 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 330 BrowserThread::PostTask(BrowserThread::IO, | 327 BrowserThread::PostTask(BrowserThread::IO, |
| 331 FROM_HERE, | 328 FROM_HERE, |
| 332 base::Bind(&ResourceDispatcherHost::OnShutdown, | 329 base::Bind(&ResourceDispatcherHost::OnShutdown, |
| (...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2175 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; | 2172 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; |
| 2176 } | 2173 } |
| 2177 | 2174 |
| 2178 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt() { | 2175 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt() { |
| 2179 return allow_cross_origin_auth_prompt_; | 2176 return allow_cross_origin_auth_prompt_; |
| 2180 } | 2177 } |
| 2181 | 2178 |
| 2182 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { | 2179 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { |
| 2183 allow_cross_origin_auth_prompt_ = value; | 2180 allow_cross_origin_auth_prompt_ = value; |
| 2184 } | 2181 } |
| OLD | NEW |