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

Unified Diff: net/socket/ssl_client_socket_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/socket/ssl_client_socket_win.cc
diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc
index fbe49132079c48de5ab7e84937af5397a636695e..19c3814abec58c5fc6a9674d04f8cf028a7bebf1 100644
--- a/net/socket/ssl_client_socket_win.cc
+++ b/net/socket/ssl_client_socket_win.cc
@@ -8,8 +8,8 @@
#include <map>
#include "base/compiler_specific.h"
+#include "base/lazy_instance.h"
#include "base/lock.h"
-#include "base/singleton.h"
#include "base/stl_util-inl.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
@@ -194,6 +194,9 @@ class CredHandleTable {
CredHandleMap client_cert_creds_;
};
+static base::LazyInstance<CredHandleTable> g_cred_handle_table(
+ base::LINKER_INITIALIZED);
+
// static
int CredHandleTable::InitializeHandle(CredHandle* handle,
PCCERT_CONTEXT client_cert,
@@ -285,9 +288,9 @@ static int GetCredHandle(PCCERT_CONTEXT client_cert,
NOTREACHED();
return ERR_UNEXPECTED;
}
- return Singleton<CredHandleTable>::get()->GetHandle(client_cert,
- ssl_version_mask,
- handle_ptr);
+ return g_cred_handle_table.Get().GetHandle(client_cert,
+ ssl_version_mask,
+ handle_ptr);
}
//-----------------------------------------------------------------------------
@@ -356,6 +359,9 @@ class ClientCertStore {
HCERTSTORE store_;
};
+static base::LazyInstance<ClientCertStore> g_client_cert_store(
+ base::LINKER_INITIALIZED);
+
//-----------------------------------------------------------------------------
// Size of recv_buffer_
@@ -507,7 +513,7 @@ void SSLClientSocketWin::GetSSLCertRequestInfo(
// Copy it to our own certificate store, so that we can close the "MY"
// certificate store before returning from this function.
PCCERT_CONTEXT cert_context2 =
- Singleton<ClientCertStore>::get()->CopyCertContext(cert_context);
+ g_client_cert_store.Get().CopyCertContext(cert_context);
if (!cert_context2) {
NOTREACHED();
continue;

Powered by Google App Engine
This is Rietveld 408576698