Index: chrome/browser/chrome_browser_main.cc |
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
index c249c89d2afd3d269dae7ee132c0a122f84be03d..724e3111f8d05b06911d005f1cfdfeab5b971c90 100644 |
--- a/chrome/browser/chrome_browser_main.cc |
+++ b/chrome/browser/chrome_browser_main.cc |
@@ -714,6 +714,7 @@ DLLEXPORT void __cdecl RelaunchChromeBrowserWithNewCommandLineIfNeeded() { |
void ChromeBrowserMainParts::PreEarlyInitialization() { |
TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreEarlyInitialization"); |
+ ProfileManager::SetAllowGetDefaultProfile(false); |
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
chrome_extra_parts_[i]->PreEarlyInitialization(); |
} |
@@ -1263,6 +1264,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
browser_process_->profile_manager()->SetWillImport(); |
} |
+ // Called before CreateProfile because creating the profile can trigger |
+ // calls to GetDefaultProfile(). |
+ ProfileManager::SetAllowGetDefaultProfile(true); |
+ |
profile_ = CreateProfile(parameters(), user_data_dir_, parsed_command_line()); |
if (!profile_) |
return content::RESULT_CODE_NORMAL_EXIT; |