summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-23 18:39:42 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-23 18:39:42 +0000
commit7adf048c1cdd2b15bd8ddfc542e0d5803edc47de (patch)
tree7184828f5f332ef840b65fcce62c1c76eb507ef4 /chrome/browser
parent9fe44f54a25b803b1b47ad168cf1d4cd008640d4 (diff)
downloadchromium_src-7adf048c1cdd2b15bd8ddfc542e0d5803edc47de.zip
chromium_src-7adf048c1cdd2b15bd8ddfc542e0d5803edc47de.tar.gz
chromium_src-7adf048c1cdd2b15bd8ddfc542e0d5803edc47de.tar.bz2
Don't initialize the download manager when trying to shut down.
BUG=56598 TEST=none Review URL: http://codereview.chromium.org/3419016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index f777f25..06253d0 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -3794,14 +3794,20 @@ bool Browser::CanCloseWithInProgressDownloads() {
bool normal_downloads_are_present = false;
bool incognito_downloads_are_present = false;
// If there are no download in-progress, our job is done.
- DownloadManager* download_manager = profile_->GetDownloadManager();
+ DownloadManager* download_manager = NULL;
+ // But first we need to check for the existance of the download manager, as
+ // GetDownloadManager() will unnecessarily try to create one if it does not
+ // exist.
+ if (profile_->HasCreatedDownloadManager())
+ download_manager = profile_->GetDownloadManager();
if (profile_->IsOffTheRecord()) {
// Browser is incognito and so download_manager if present is for incognito
// downloads.
incognito_downloads_are_present =
(download_manager && download_manager->in_progress_count() != 0);
// Check original profile.
- download_manager = profile_->GetOriginalProfile()->GetDownloadManager();
+ if (profile_->GetOriginalProfile()->HasCreatedDownloadManager())
+ download_manager = profile_->GetOriginalProfile()->GetDownloadManager();
}
normal_downloads_are_present =