summaryrefslogtreecommitdiffstats
path: root/base/nss_init.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-13 17:35:09 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-13 17:35:09 +0000
commit6e7e806a4eac5b6c0864cf00aa717299d23aca1d (patch)
treeecd8fbd593b31bcc5015d3bb956da4d444f52a9d /base/nss_init.cc
parent13a279ed95dc2e5d2f71172594dca1c3901b1322 (diff)
downloadchromium_src-6e7e806a4eac5b6c0864cf00aa717299d23aca1d.zip
chromium_src-6e7e806a4eac5b6c0864cf00aa717299d23aca1d.tar.gz
chromium_src-6e7e806a4eac5b6c0864cf00aa717299d23aca1d.tar.bz2
Report what went wrong when initializing NSS_NoDB_Init.
BUG=9857 Review URL: http://codereview.chromium.org/71009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/nss_init.cc')
-rw-r--r--base/nss_init.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/base/nss_init.cc b/base/nss_init.cc
index c0114b7..911ff35 100644
--- a/base/nss_init.cc
+++ b/base/nss_init.cc
@@ -6,6 +6,7 @@
#include <nss.h>
#include <plarena.h>
+#include <prerror.h>
#include <prinit.h>
// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424
@@ -40,9 +41,16 @@ SECMODModule *InitDefaultRootCerts() {
class NSSInitSingleton {
public:
NSSInitSingleton() {
-
// Initialize without using a persistant database (e.g. ~/.netscape)
- CHECK(NSS_NoDB_Init(".") == SECSuccess);
+ SECStatus status = NSS_NoDB_Init(".");
+ if (status != SECSuccess) {
+ char buffer[513] = "Couldn't retrieve error";
+ PRInt32 err_length = PR_GetErrorTextLength();
+ if (err_length > 0 && size_t(err_length) < sizeof(buffer))
+ PR_GetErrorText(buffer);
+
+ NOTREACHED() << "Error calling NSS_NoDB_Init: " << buffer;
+ }
root_ = InitDefaultRootCerts();