OLD | NEW |
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 Loading... |
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 |
OLD | NEW |