summaryrefslogtreecommitdiffstats
path: root/crypto/nss_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/nss_util.cc')
-rw-r--r--crypto/nss_util.cc28
1 files changed, 10 insertions, 18 deletions
diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc
index 9901e3a..e484abe 100644
--- a/crypto/nss_util.cc
+++ b/crypto/nss_util.cc
@@ -155,24 +155,6 @@ void UseLocalCacheOfNSSDatabaseIfNFS(const FilePath& database_dir) {
#endif // defined(OS_LINUX)
}
-// A helper class that acquires the SECMOD list read lock while the
-// AutoSECMODListReadLock is in scope.
-class AutoSECMODListReadLock {
- public:
- AutoSECMODListReadLock()
- : lock_(SECMOD_GetDefaultModuleListLock()) {
- SECMOD_GetReadLock(lock_);
- }
-
- ~AutoSECMODListReadLock() {
- SECMOD_ReleaseReadLock(lock_);
- }
-
- private:
- SECMODListLock* lock_;
- DISALLOW_COPY_AND_ASSIGN(AutoSECMODListReadLock);
-};
-
PK11SlotInfo* FindSlotWithTokenName(const std::string& token_name) {
AutoSECMODListReadLock auto_lock;
SECMODModuleList* head = SECMOD_GetDefaultModuleList();
@@ -670,6 +652,16 @@ AutoNSSWriteLock::~AutoNSSWriteLock() {
lock_->Release();
}
}
+
+AutoSECMODListReadLock::AutoSECMODListReadLock()
+ : lock_(SECMOD_GetDefaultModuleListLock()) {
+ SECMOD_GetReadLock(lock_);
+ }
+
+AutoSECMODListReadLock::~AutoSECMODListReadLock() {
+ SECMOD_ReleaseReadLock(lock_);
+}
+
#endif // defined(USE_NSS)
#if defined(OS_CHROMEOS)