diff options
author | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-17 03:12:58 +0000 |
---|---|---|
committer | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-17 03:12:58 +0000 |
commit | 491bb6962629f1f2352c24d9f8f73c70fe65871b (patch) | |
tree | 2c9882b8bf5119aea628118981df8431b1ba8ebd /app/resource_bundle_posix.cc | |
parent | e652d3283c537705ef04b29e576b51e73519a46b (diff) | |
download | chromium_src-491bb6962629f1f2352c24d9f8f73c70fe65871b.zip chromium_src-491bb6962629f1f2352c24d9f8f73c70fe65871b.tar.gz chromium_src-491bb6962629f1f2352c24d9f8f73c70fe65871b.tar.bz2 |
Changing DCHECKs in ResourceBundle::LoadResources() to CHECK.
Chromium Linux (release build) dies with SIGSEGV on start-up in case when the chrome.pak resource file is missing or broken for some reason:
[17247:17247:499277598478:ERROR:base/file_util.cc(302)] Couldn't open /tmp/chrome.pak
Segmentation fault.
This change changes some DCHECKs to CHECK in order to make the error message readble to user. After this patch, the message would be like this:
[17238:17238:499222545654:ERROR:base/file_util.cc(302)] Couldn't open /home/yusukes/tmp/chrome.pak
[17238:17238:499222545701:FATAL:app/resource_bundle_posix.cc(88)] Check failed: resources_data_. failed to load chrome.pak
Trace/breakpoint trap
BUG=none
TEST=Run "cp src/out/Release/chrome /tmp && ./tmp/chrome" and verify that it is terminated by CHECK failure (and not SIGSEGV).
Review URL: http://codereview.chromium.org/500045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/resource_bundle_posix.cc')
-rw-r--r-- | app/resource_bundle_posix.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/resource_bundle_posix.cc b/app/resource_bundle_posix.cc index 044bc3d..665df25 100644 --- a/app/resource_bundle_posix.cc +++ b/app/resource_bundle_posix.cc @@ -83,9 +83,9 @@ string16 ResourceBundle::GetLocalizedString(int message_id) { std::string ResourceBundle::LoadResources(const std::wstring& pref_locale) { DCHECK(!resources_data_) << "chrome.pak already loaded"; FilePath resources_file_path = GetResourcesFilePath(); - DCHECK(!resources_file_path.empty()) << "chrome.pak not found"; + CHECK(!resources_file_path.empty()) << "chrome.pak not found"; resources_data_ = LoadResourcesDataPak(resources_file_path); - DCHECK(resources_data_) << "failed to load chrome.pak"; + CHECK(resources_data_) << "failed to load chrome.pak"; DCHECK(!locale_resources_data_) << "locale.pak already loaded"; std::string app_locale = l10n_util::GetApplicationLocale(pref_locale); @@ -96,6 +96,6 @@ std::string ResourceBundle::LoadResources(const std::wstring& pref_locale) { return std::string(); } locale_resources_data_ = LoadResourcesDataPak(locale_file_path); - DCHECK(locale_resources_data_) << "failed to load locale.pak"; + CHECK(locale_resources_data_) << "failed to load locale.pak"; return app_locale; } |