OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( | 69 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( |
70 scoped_ptr<ClientSocketHandle> transport_socket, | 70 scoped_ptr<ClientSocketHandle> transport_socket, |
71 const HostPortPair& host_and_port, | 71 const HostPortPair& host_and_port, |
72 const SSLConfig& ssl_config, | 72 const SSLConfig& ssl_config, |
73 const SSLClientSocketContext& context) override { | 73 const SSLClientSocketContext& context) override { |
74 #if defined(USE_OPENSSL) | 74 #if defined(USE_OPENSSL) |
75 return scoped_ptr<SSLClientSocket>(new SSLClientSocketOpenSSL( | 75 return scoped_ptr<SSLClientSocket>(new SSLClientSocketOpenSSL( |
76 std::move(transport_socket), host_and_port, ssl_config, context)); | 76 std::move(transport_socket), host_and_port, ssl_config, context)); |
77 #else | 77 #else |
78 return scoped_ptr<SSLClientSocket>(new SSLClientSocketNSS( | 78 return scoped_ptr<SSLClientSocket>(new SSLClientSocketNSS( |
79 transport_socket.Pass(), host_and_port, ssl_config, context)); | 79 std::move(transport_socket), host_and_port, ssl_config, context)); |
80 #endif | 80 #endif |
81 } | 81 } |
82 | 82 |
83 void ClearSSLSessionCache() override { SSLClientSocket::ClearSessionCache(); } | 83 void ClearSSLSessionCache() override { SSLClientSocket::ClearSessionCache(); } |
84 }; | 84 }; |
85 | 85 |
86 static base::LazyInstance<DefaultClientSocketFactory>::Leaky | 86 static base::LazyInstance<DefaultClientSocketFactory>::Leaky |
87 g_default_client_socket_factory = LAZY_INSTANCE_INITIALIZER; | 87 g_default_client_socket_factory = LAZY_INSTANCE_INITIALIZER; |
88 | 88 |
89 } // namespace | 89 } // namespace |
90 | 90 |
91 // static | 91 // static |
92 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { | 92 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { |
93 return g_default_client_socket_factory.Pointer(); | 93 return g_default_client_socket_factory.Pointer(); |
94 } | 94 } |
95 | 95 |
96 } // namespace net | 96 } // namespace net |
OLD | NEW |