Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1040)

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 572043: Check for the existance of a profile manager. Might not exist during early shutdown. (Closed)
Patch Set: added comment Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 2e4d34511357128c0ee4cbf9855772fe37ea4cc8..db2a310edb911c1bb83b3726b8e33351068daa43 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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698