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/profile_impl.cc | |
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/profile_impl.cc')
-rw-r--r-- | chrome/browser/profile_impl.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc index 9d35e6e..f972716 100644 --- a/chrome/browser/profile_impl.cc +++ b/chrome/browser/profile_impl.cc @@ -461,9 +461,13 @@ ProfileImpl::~ProfileImpl() { // shut down the database. template_url_model_.reset(); - // The download manager queries the history system and should be deleted - // before the history is shutdown so it can properly cancel all requests. - download_manager_ = NULL; + // DownloadManager is lazily created, so check before accessing it. + if (download_manager_.get()) { + // The download manager queries the history system and should be shutdown + // before the history is shutdown so it can properly cancel all requests. + download_manager_->Shutdown(); + download_manager_ = NULL; + } // The theme provider provides bitmaps to whoever wants them. theme_provider_.reset(); |