diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-17 09:42:51 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-17 09:42:51 +0000 |
commit | c1444fef13763a4f19215bdffb148f4d1a6c6098 (patch) | |
tree | 41d97a415045020d3d8ae2ab1f0bf65f8c992637 | |
parent | 0ff1cdfd006075c5b99df01bb0eb74c1e023e65a (diff) | |
download | chromium_src-c1444fef13763a4f19215bdffb148f4d1a6c6098.zip chromium_src-c1444fef13763a4f19215bdffb148f4d1a6c6098.tar.gz chromium_src-c1444fef13763a4f19215bdffb148f4d1a6c6098.tar.bz2 |
Some cleanup to hmac_nss / nss_init. Move the anonymous namespaces out of the base namespace. DCHECK the result to NSS_Shutdown. Remove the comment about nss.h and move to to it's appropiate place.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2301 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/hmac_nss.cc | 4 | ||||
-rw-r--r-- | base/nss_init.cc | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/base/hmac_nss.cc b/base/hmac_nss.cc index 6e8ef9f..9ef1903 100644 --- a/base/hmac_nss.cc +++ b/base/hmac_nss.cc @@ -11,8 +11,6 @@ #include "base/nss_init.h" #include "base/scoped_ptr.h" -namespace base { - namespace { template <typename Type, void (*Destroyer)(Type*)> @@ -37,6 +35,8 @@ typedef scoped_ptr_malloc< } // namespace +namespace base { + struct HMACPlatformData { ScopedNSSSlot slot_; ScopedNSSSymKey sym_key_; diff --git a/base/nss_init.cc b/base/nss_init.cc index 6427e94..c5c10c4 100644 --- a/base/nss_init.cc +++ b/base/nss_init.cc @@ -4,14 +4,10 @@ #include "base/nss_init.h" -#include "base/logging.h" -#include "base/singleton.h" - -// Include this header last, since NSS will define "Lock" in an enum. -// https://bugzilla.mozilla.org/show_bug.cgi?id=455424 #include <nss.h> -namespace base { +#include "base/logging.h" +#include "base/singleton.h" namespace { @@ -22,12 +18,15 @@ class NSSInitSingleton { } ~NSSInitSingleton() { - NSS_Shutdown(); + SECStatus status = NSS_Shutdown(); + DCHECK(status == SECSuccess); } }; } // namespace +namespace base { + void EnsureNSSInit() { Singleton<NSSInitSingleton>::get(); } |