summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 16:00:21 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 16:00:21 +0000
commit007f512466aa904ff48ee082c5b42c40486dc130 (patch)
treec2137a3ef2116528c1444180fdd4aeecedb2e152 /crypto
parente97b1ef49f5eda6bcc465b03666f23f496d89033 (diff)
downloadchromium_src-007f512466aa904ff48ee082c5b42c40486dc130.zip
chromium_src-007f512466aa904ff48ee082c5b42c40486dc130.tar.gz
chromium_src-007f512466aa904ff48ee082c5b42c40486dc130.tar.bz2
Always force a crash with error info on NSS_NoDB_Init failure.
R=eroman@chromium.org,rsleevi@chromium.org BUG=153281 TEST=none Review URL: https://chromiumcodereview.appspot.com/11415074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto')
-rw-r--r--crypto/nss_util.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc
index e923b12..ff2b0c8 100644
--- a/crypto/nss_util.cc
+++ b/crypto/nss_util.cc
@@ -226,10 +226,14 @@ base::LazyInstance<NSPRInitSingleton>::Leaky
base::LazyInstance<base::ScopedTempDir> g_test_nss_db_dir =
LAZY_INSTANCE_INITIALIZER;
-// Force a crash to debug http://crbug.com/153281.
-void CrashWithErrors(int nss_error, int os_error) {
+// Force a crash with error info on NSS_NoDB_Init failure.
+void CrashOnNSSInitFailure() {
+ int nss_error = PR_GetError();
+ int os_error = PR_GetOSError();
base::debug::Alias(&nss_error);
base::debug::Alias(&os_error);
+ LOG(ERROR) << "Error initializing NSS without a persistent database: "
+ << GetNSSErrorMessage();
LOG(FATAL) << "nss_error=" << nss_error << ", os_error=" << os_error;
}
@@ -458,12 +462,7 @@ class NSSInitSingleton {
if (nodb_init) {
status = NSS_NoDB_Init(NULL);
if (status != SECSuccess) {
- // Force a crash with error info to debug http://crbug.com/153281.
- int nss_error = PR_GetError();
- int os_error = PR_GetOSError();
- LOG(ERROR) << "Error initializing NSS without a persistent "
- "database: " << GetNSSErrorMessage();
- CrashWithErrors(nss_error, os_error);
+ CrashOnNSSInitFailure();
return;
}
#if defined(OS_IOS)
@@ -497,8 +496,7 @@ class NSSInitSingleton {
VLOG(1) << "Initializing NSS without a persistent database.";
status = NSS_NoDB_Init(NULL);
if (status != SECSuccess) {
- LOG(ERROR) << "Error initializing NSS without a persistent "
- "database: " << GetNSSErrorMessage();
+ CrashOnNSSInitFailure();
return;
}
}