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

Side by Side Diff: net/socket/client_socket_factory.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/client_socket_factory.h" 5 #include "net/socket/client_socket_factory.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "net/base/cert_database.h" 9 #include "net/base/cert_database.h"
10 #include "net/socket/client_socket_handle.h" 10 #include "net/socket/client_socket_handle.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if (!g_use_system_ssl) 116 if (!g_use_system_ssl)
117 SSLClientSocketNSS::ClearSessionCache(); 117 SSLClientSocketNSS::ClearSessionCache();
118 #else 118 #else
119 NOTIMPLEMENTED(); 119 NOTIMPLEMENTED();
120 #endif 120 #endif
121 } 121 }
122 122
123 }; 123 };
124 124
125 static base::LazyInstance<DefaultClientSocketFactory> 125 static base::LazyInstance<DefaultClientSocketFactory>
126 g_default_client_socket_factory(base::LINKER_INITIALIZED); 126 g_default_client_socket_factory = LAZY_INSTANCE_INITIALIZER;
127 127
128 } // namespace 128 } // namespace
129 129
130 // Deprecated function (http://crbug.com/37810) that takes a StreamSocket. 130 // Deprecated function (http://crbug.com/37810) that takes a StreamSocket.
131 SSLClientSocket* ClientSocketFactory::CreateSSLClientSocket( 131 SSLClientSocket* ClientSocketFactory::CreateSSLClientSocket(
132 StreamSocket* transport_socket, 132 StreamSocket* transport_socket,
133 const HostPortPair& host_and_port, 133 const HostPortPair& host_and_port,
134 const SSLConfig& ssl_config, 134 const SSLConfig& ssl_config,
135 SSLHostInfo* ssl_host_info, 135 SSLHostInfo* ssl_host_info,
136 const SSLClientSocketContext& context) { 136 const SSLClientSocketContext& context) {
137 ClientSocketHandle* socket_handle = new ClientSocketHandle(); 137 ClientSocketHandle* socket_handle = new ClientSocketHandle();
138 socket_handle->set_socket(transport_socket); 138 socket_handle->set_socket(transport_socket);
139 return CreateSSLClientSocket(socket_handle, host_and_port, ssl_config, 139 return CreateSSLClientSocket(socket_handle, host_and_port, ssl_config,
140 ssl_host_info, context); 140 ssl_host_info, context);
141 } 141 }
142 142
143 // static 143 // static
144 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { 144 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() {
145 return g_default_client_socket_factory.Pointer(); 145 return g_default_client_socket_factory.Pointer();
146 } 146 }
147 147
148 // static 148 // static
149 void ClientSocketFactory::UseSystemSSL() { 149 void ClientSocketFactory::UseSystemSSL() {
150 g_use_system_ssl = true; 150 g_use_system_ssl = true;
151 } 151 }
152 152
153 } // namespace net 153 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698