diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:21:13 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:21:13 +0000 |
commit | 326a6a9153ad69dc7b62db8e218df7c9d0440a00 (patch) | |
tree | d418b49b4832b0b8dfb200ff90e349714b0aeebf /chrome/browser/renderer_host | |
parent | 670e362c28e8a92dda5dd537cca662d283ffc2a8 (diff) | |
download | chromium_src-326a6a9153ad69dc7b62db8e218df7c9d0440a00.zip chromium_src-326a6a9153ad69dc7b62db8e218df7c9d0440a00.tar.gz chromium_src-326a6a9153ad69dc7b62db8e218df7c9d0440a00.tar.bz2 |
GTTF: Clean up DownloadFileManager
This removes a lot of duplication, locking, and thread jumping.
Most of the operations run on the FILE thread, and we do not duplicate
so much information. Each DownloadFile keeps track of its DownloadManager
(each Profile has its own DownloadManager). This allows us to remove
many maps from DownloadFileManager that were duplicating that information.
There is still SaveFileManager, but hopefully I will be able
to merge those two in small steps.
Hopefully, this is http://codereview.chromium.org/3245005 done right.
TEST=unit_tests, browser_tests, ui_tests
BUG=48913
Review URL: http://codereview.chromium.org/3347018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r-- | chrome/browser/renderer_host/download_resource_handler.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc index 911edf8..3e5f3c0 100644 --- a/chrome/browser/renderer_host/download_resource_handler.cc +++ b/chrome/browser/renderer_host/download_resource_handler.cc @@ -92,9 +92,14 @@ bool DownloadResourceHandler::OnResponseStarted(int request_id, info->referrer_charset = request_->context()->referrer_charset(); info->save_info = save_info_; ChromeThread::PostTask( - ChromeThread::FILE, FROM_HERE, + ChromeThread::UI, FROM_HERE, NewRunnableMethod( download_file_manager_, &DownloadFileManager::StartDownload, info)); + + // We can't start saving the data before we create the file on disk. + // The request will be un-paused in DownloadFileManager::CreateDownloadFile. + rdh_->PauseRequest(global_id_.child_id, global_id_.request_id, true); + return true; } |