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

Unified Diff: net/base/x509_certificate_win.cc

Issue 5682008: Make members of Singleton<T> private and only visible to the singleton type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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: net/base/x509_certificate_win.cc
diff --git a/net/base/x509_certificate_win.cc b/net/base/x509_certificate_win.cc
index 75cdf4018816e1475b6f26f3e285aec7b2fc445e..71aa545d4e6780db05fa58bffe934d9b6b7d51a9 100644
--- a/net/base/x509_certificate_win.cc
+++ b/net/base/x509_certificate_win.cc
@@ -4,9 +4,9 @@
#include "net/base/x509_certificate.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/pickle.h"
-#include "base/singleton.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
@@ -529,7 +529,7 @@ class GlobalCertStore {
}
private:
- friend struct DefaultSingletonTraits<GlobalCertStore>;
+ friend struct base::DefaultLazyInstanceTraits<GlobalCertStore>;
GlobalCertStore()
: cert_store_(CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, 0, NULL)) {
@@ -544,9 +544,12 @@ class GlobalCertStore {
DISALLOW_COPY_AND_ASSIGN(GlobalCertStore);
};
+static base::LazyInstance<GlobalCertStore> g_cert_store(
+ base::LINKER_INITIALIZED);
+
// static
HCERTSTORE X509Certificate::cert_store() {
- return Singleton<GlobalCertStore>::get()->cert_store();
+ return g_cert_store.Get().cert_store();
}
int X509Certificate::Verify(const std::string& hostname,

Powered by Google App Engine
This is Rietveld 408576698