diff options
author | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-17 08:35:13 +0000 |
---|---|---|
committer | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-17 08:35:13 +0000 |
commit | e1399c972c8643dea3e8109c958597141369ea6a (patch) | |
tree | aefa9da99118205371bd699c7327474bb2ce1451 /crypto/nss_util.h | |
parent | ca6966bf908defc280bef151c6964a4fc1429708 (diff) | |
download | chromium_src-e1399c972c8643dea3e8109c958597141369ea6a.zip chromium_src-e1399c972c8643dea3e8109c958597141369ea6a.tar.gz chromium_src-e1399c972c8643dea3e8109c958597141369ea6a.tar.bz2 |
Implement ScopedTestNSSDB instead of OpenTestNSSDB()
BUG=136950
Review URL: https://chromiumcodereview.appspot.com/11174006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/nss_util.h')
-rw-r--r-- | crypto/nss_util.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/crypto/nss_util.h b/crypto/nss_util.h index 88d7d05..9e09d6d 100644 --- a/crypto/nss_util.h +++ b/crypto/nss_util.h @@ -128,11 +128,21 @@ CRYPTO_EXPORT int64 BaseTimeToPRTime(base::Time time); #if defined(USE_NSS) // Exposed for unittests only. -// TODO(mattm): when https://bugzilla.mozilla.org/show_bug.cgi?id=588269 is -// fixed, switch back to using a separate userdb for each test. (Maybe refactor -// to provide a ScopedTestNSSDB instead of open/close methods.) -CRYPTO_EXPORT bool OpenTestNSSDB(); -// NOTE: due to NSS bug 588269, mentioned above, there is no CloseTestNSSDB. +// TODO(mattm): When NSS 3.14 is the minimum version required, +// switch back to using a separate user DB for each test. +// Because of https://bugzilla.mozilla.org/show_bug.cgi?id=588269 , the +// opened user DB is not automatically closed. +class CRYPTO_EXPORT_PRIVATE ScopedTestNSSDB { + public: + ScopedTestNSSDB(); + ~ScopedTestNSSDB(); + + bool is_open() { return is_open_; } + + private: + bool is_open_; + DISALLOW_COPY_AND_ASSIGN(ScopedTestNSSDB); +}; // NSS has a bug which can cause a deadlock or stall in some cases when writing // to the certDB and keyDB. It also has a bug which causes concurrent key pair |