summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_impl.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 22:50:41 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 22:50:41 +0000
commited0cf569f40ba5e11402c691c6bef6304d3d45c6 (patch)
treea8fba11647de7bcd0c58f690444759044421a52c /chrome/browser/browser_process_impl.cc
parent12f74a94c21e19c74208dacf1dc5ef46f8a27f53 (diff)
downloadchromium_src-ed0cf569f40ba5e11402c691c6bef6304d3d45c6.zip
chromium_src-ed0cf569f40ba5e11402c691c6bef6304d3d45c6.tar.gz
chromium_src-ed0cf569f40ba5e11402c691c6bef6304d3d45c6.tar.bz2
Check for the existance of a profile manager. Might not exist during early shutdown.
BUG=34652 TEST=Execute chrome. Run chrome --uninstall. Should not crash. Review URL: http://codereview.chromium.org/572043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r--chrome/browser/browser_process_impl.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 2e4d345..db2a310 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -268,6 +268,13 @@ bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) {
FilePath user_data_dir;
Profile* profile;
+ // Check for the existance of a profile manager. When quitting early,
+ // e.g. because another chrome instance is running, or when invoked with
+ // options such as --uninstall or --try-chrome-again=0, the profile manager
+ // does not exist yet.
+ if (!profile_manager_.get())
+ return false;
+
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
profile = profile_manager_->GetDefaultProfile(user_data_dir);
*profile_path = profile->GetPath();