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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 9317095: Fix crash on startup because function returned before creating required (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync and merge, no new changes Created 8 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/chrome_browser_main.cc
===================================================================
--- chrome/browser/chrome_browser_main.cc (revision 120571)
+++ chrome/browser/chrome_browser_main.cc (working copy)
@@ -1111,6 +1111,9 @@
int ChromeBrowserMainParts::PreCreateThreads() {
result_code_ = PreCreateThreadsImpl();
+ // These members must be initialized before returning from this function.
+ DCHECK(master_prefs_.get());
+ DCHECK(browser_init_.get());
return result_code_;
}
@@ -1160,6 +1163,10 @@
local_state_ = InitializeLocalState(parsed_command_line(),
is_first_run_);
+ // These members must be initialized before returning from this function.
+ master_prefs_.reset(new first_run::MasterPrefs);
+ browser_init_.reset(new BrowserInit);
+
// If we're running tests (ui_task is non-null), then the ResourceBundle
// has already been initialized.
if (parameters().ui_task) {
@@ -1195,10 +1202,6 @@
g_set_application_name(l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str());
#endif
- // These members must be initialized before returning from this function.
- master_prefs_.reset(new first_run::MasterPrefs);
- browser_init_.reset(new BrowserInit);
-
std::string try_chrome =
parsed_command_line().GetSwitchValueASCII(switches::kTryChromeAgain);
if (!try_chrome.empty()) {
« 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