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

Unified Diff: chrome/browser/browser_main.cc

Issue 5939002: Error handling added (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: return code CHECK fixed Created 10 years 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
Index: chrome/browser/browser_main.cc
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 8958872415d194533730c89dfbe9c50dd47feab7..805f5f128fb830cdc40b4d258bd47179e8dc017b 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -614,7 +614,8 @@ PrefService* InitializeLocalState(const CommandLine& parsed_command_line,
// Initialize ResourceBundle which handles files loaded from external
// sources. This has to be done before uninstall code path and before prefs
// are registered.
- local_state->RegisterStringPref(prefs::kApplicationLocale, "");
+ local_state->RegisterStringPref(prefs::kApplicationLocale,
+ std::string());
#if !defined(OS_CHROMEOS)
local_state->RegisterBooleanPref(prefs::kMetricsReportingEnabled,
GoogleUpdateSettings::GetCollectStatsConsent());
@@ -1150,9 +1151,10 @@ int BrowserMain(const MainFunctionParams& parameters) {
#else
// On a POSIX OS other than ChromeOS, the parameter that is passed to the
// method InitSharedInstance is ignored.
- std::string app_locale = ResourceBundle::InitSharedInstance(
- local_state->GetString(prefs::kApplicationLocale));
- g_browser_process->SetApplicationLocale(app_locale);
+ std::string locale = local_state->GetString(prefs::kApplicationLocale);
+ const std::string res = ResourceBundle::InitSharedInstance(locale);
Peter Kasting 2010/12/21 18:35:58 Nit: Same nits
glotov 2010/12/21 20:33:34 Done.
+ CHECK(!res.empty()) << "Locale could not be found for " << locale;
+ g_browser_process->SetApplicationLocale(res);
FilePath resources_pack_path;
PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);

Powered by Google App Engine
This is Rietveld 408576698