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

Unified Diff: net/socket/ssl_client_socket_mac.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_mac.cc
diff --git a/net/socket/ssl_client_socket_mac.cc b/net/socket/ssl_client_socket_mac.cc
index fb0c26eceb882867058dc3d7bb7239e307bf82aa..488beebb2474b5994d1c8afe8aee9146ddf2b86c 100644
--- a/net/socket/ssl_client_socket_mac.cc
+++ b/net/socket/ssl_client_socket_mac.cc
@@ -11,8 +11,8 @@
#include <algorithm>
+#include "base/lazy_instance.h"
#include "base/mac/scoped_cftyperef.h"
-#include "base/singleton.h"
#include "base/string_util.h"
#include "net/base/address_list.h"
#include "net/base/cert_verifier.h"
@@ -475,7 +475,7 @@ class EnabledCipherSuites {
const std::vector<SSLCipherSuite>& ciphers() const { return ciphers_; }
private:
- friend struct DefaultSingletonTraits<EnabledCipherSuites>;
+ friend struct base::DefaultLazyInstanceTraits<EnabledCipherSuites>;
EnabledCipherSuites();
~EnabledCipherSuites() {}
@@ -484,6 +484,9 @@ class EnabledCipherSuites {
DISALLOW_COPY_AND_ASSIGN(EnabledCipherSuites);
};
+static base::LazyInstance<EnabledCipherSuites> g_enabled_cipher_suites(
+ base::LINKER_INITIALIZED);
+
EnabledCipherSuites::EnabledCipherSuites() {
SSLContextRef ssl_context;
OSStatus status = SSLNewContext(false, &ssl_context);
@@ -786,7 +789,7 @@ int SSLClientSocketMac::InitializeSSLContext() {
return NetErrorFromOSStatus(status);
std::vector<SSLCipherSuite> enabled_ciphers =
- Singleton<EnabledCipherSuites>::get()->ciphers();
+ g_enabled_cipher_suites.Get().ciphers();
CipherSuiteIsDisabledFunctor is_disabled_cipher(
ssl_config_.disabled_cipher_suites);

Powered by Google App Engine
This is Rietveld 408576698