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

Unified Diff: crypto/nss_util.cc

Issue 11174006: Implement ScopedTestNSSDB instead of OpenTestNSSDB() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another test Created 8 years, 2 months 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: crypto/nss_util.cc
diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc
index db89a7003a0ad0a490a6659dd83c272a591fca90..9c7bf94d5d3b471e5fa34fda4f6948c96086cfe3 100644
--- a/crypto/nss_util.cc
+++ b/crypto/nss_util.cc
@@ -702,8 +702,14 @@ bool CheckNSSVersion(const char* version) {
}
#if defined(USE_NSS)
-bool OpenTestNSSDB() {
- return g_nss_singleton.Get().OpenTestNSSDB();
+ScopedTestNSSDB::ScopedTestNSSDB()
+ : is_open_(g_nss_singleton.Get().OpenTestNSSDB()) {
+ DCHECK(is_open_);
Ryan Sleevi 2012/10/16 18:19:02 Do not DCHECK here - this will crash tests in debu
Takashi Toyoshima 2012/10/17 04:58:53 Done.
+}
+
+ScopedTestNSSDB::~ScopedTestNSSDB() {
+ // TODO(mattm): Close dababase after
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=588269 is fixed.
Ryan Sleevi 2012/10/16 18:19:02 // TODO(mattm): Close the database once NSS 3.14 i
Takashi Toyoshima 2012/10/17 04:58:53 Done.
}
base::Lock* GetNSSWriteLock() {

Powered by Google App Engine
This is Rietveld 408576698