| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 &response->response_head.appcache_id, | 247 &response->response_head.appcache_id, |
| 248 &response->response_head.appcache_manifest_url); | 248 &response->response_head.appcache_manifest_url); |
| 249 } | 249 } |
| 250 | 250 |
| 251 } // namespace | 251 } // namespace |
| 252 | 252 |
| 253 ResourceDispatcherHost::ResourceDispatcherHost(MessageLoop* io_loop) | 253 ResourceDispatcherHost::ResourceDispatcherHost(MessageLoop* io_loop) |
| 254 : ui_loop_(MessageLoop::current()), | 254 : ui_loop_(MessageLoop::current()), |
| 255 io_loop_(io_loop), | 255 io_loop_(io_loop), |
| 256 ALLOW_THIS_IN_INITIALIZER_LIST( | 256 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 257 download_file_manager_(new DownloadFileManager(ui_loop_, this))), | 257 download_file_manager_(new DownloadFileManager(this))), |
| 258 download_request_manager_(new DownloadRequestManager(io_loop, ui_loop_)), | 258 download_request_manager_(new DownloadRequestManager(io_loop, ui_loop_)), |
| 259 ALLOW_THIS_IN_INITIALIZER_LIST( | 259 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 260 save_file_manager_(new SaveFileManager(ui_loop_, io_loop, this))), | 260 save_file_manager_(new SaveFileManager(ui_loop_, io_loop, this))), |
| 261 ALLOW_THIS_IN_INITIALIZER_LIST(user_script_listener_( | 261 ALLOW_THIS_IN_INITIALIZER_LIST(user_script_listener_( |
| 262 new UserScriptListener(ui_loop_, io_loop, this))), | 262 new UserScriptListener(ui_loop_, io_loop, this))), |
| 263 safe_browsing_(new SafeBrowsingService), | 263 safe_browsing_(new SafeBrowsingService), |
| 264 webkit_thread_(new WebKitThread), | 264 webkit_thread_(new WebKitThread), |
| 265 request_id_(-1), | 265 request_id_(-1), |
| 266 ALLOW_THIS_IN_INITIALIZER_LIST(method_runner_(this)), | 266 ALLOW_THIS_IN_INITIALIZER_LIST(method_runner_(this)), |
| 267 is_shutdown_(false), | 267 is_shutdown_(false), |
| (...skipping 21 matching lines...) Expand all Loading... |
| 289 for (std::set<ProcessRouteIDs>::const_iterator iter = ids.begin(); | 289 for (std::set<ProcessRouteIDs>::const_iterator iter = ids.begin(); |
| 290 iter != ids.end(); ++iter) { | 290 iter != ids.end(); ++iter) { |
| 291 CancelBlockedRequestsForRoute(iter->first, iter->second); | 291 CancelBlockedRequestsForRoute(iter->first, iter->second); |
| 292 } | 292 } |
| 293 | 293 |
| 294 user_script_listener_->OnResourceDispatcherHostGone(); | 294 user_script_listener_->OnResourceDispatcherHostGone(); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void ResourceDispatcherHost::Initialize() { | 297 void ResourceDispatcherHost::Initialize() { |
| 298 DCHECK(MessageLoop::current() == ui_loop_); | 298 DCHECK(MessageLoop::current() == ui_loop_); |
| 299 download_file_manager_->Initialize(); | |
| 300 safe_browsing_->Initialize(io_loop_); | 299 safe_browsing_->Initialize(io_loop_); |
| 301 io_loop_->PostTask( | 300 io_loop_->PostTask( |
| 302 FROM_HERE, | 301 FROM_HERE, |
| 303 NewRunnableFunction(&appcache::AppCacheInterceptor::EnsureRegistered)); | 302 NewRunnableFunction(&appcache::AppCacheInterceptor::EnsureRegistered)); |
| 304 } | 303 } |
| 305 | 304 |
| 306 void ResourceDispatcherHost::Shutdown() { | 305 void ResourceDispatcherHost::Shutdown() { |
| 307 DCHECK(MessageLoop::current() == ui_loop_); | 306 DCHECK(MessageLoop::current() == ui_loop_); |
| 308 io_loop_->PostTask(FROM_HERE, new ShutdownTask(this)); | 307 io_loop_->PostTask(FROM_HERE, new ShutdownTask(this)); |
| 309 } | 308 } |
| (...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 case ViewHostMsg_UploadProgress_ACK::ID: | 1799 case ViewHostMsg_UploadProgress_ACK::ID: |
| 1801 case ViewHostMsg_SyncLoad::ID: | 1800 case ViewHostMsg_SyncLoad::ID: |
| 1802 return true; | 1801 return true; |
| 1803 | 1802 |
| 1804 default: | 1803 default: |
| 1805 break; | 1804 break; |
| 1806 } | 1805 } |
| 1807 | 1806 |
| 1808 return false; | 1807 return false; |
| 1809 } | 1808 } |
| OLD | NEW |