summaryrefslogtreecommitdiffstats
path: root/security/manager/ssl/nsNSSComponent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'security/manager/ssl/nsNSSComponent.cpp')
-rw-r--r--security/manager/ssl/nsNSSComponent.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp
index dfff59da9..d505b8aba 100644
--- a/security/manager/ssl/nsNSSComponent.cpp
+++ b/security/manager/ssl/nsNSSComponent.cpp
@@ -12,6 +12,9 @@
#include "SharedSSLState.h"
#include "cert.h"
#include "certdb.h"
+#ifdef NSS_SQLSTORE
+#include "mozStorageCID.h"
+#endif
#include "mozilla/ArrayUtils.h"
#include "mozilla/Casting.h"
#include "mozilla/Preferences.h"
@@ -1970,6 +1973,14 @@ nsNSSComponent::Init()
return NS_ERROR_NOT_SAME_THREAD;
}
+#ifdef NSS_SQLSTORE
+ // To avoid an sqlite3_config race in NSS init, we require the storage service to get initialized first.
+ nsCOMPtr<nsISupports> storageService = do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID);
+ if (!storageService) {
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+#endif
+
nsresult rv = NS_OK;
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Beginning NSS initialization\n"));