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

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

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months 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
« no previous file with comments | « net/server/web_socket_encoder.cc ('k') | net/socket/client_socket_handle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
8
7 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
8 #include "build/build_config.h" 10 #include "build/build_config.h"
9 #include "net/cert/cert_database.h" 11 #include "net/cert/cert_database.h"
10 #include "net/socket/client_socket_handle.h" 12 #include "net/socket/client_socket_handle.h"
11 #include "net/socket/tcp_client_socket.h" 13 #include "net/socket/tcp_client_socket.h"
12 #include "net/udp/udp_client_socket.h" 14 #include "net/udp/udp_client_socket.h"
13 15
14 #if defined(USE_OPENSSL) 16 #if defined(USE_OPENSSL)
15 #include "net/socket/ssl_client_socket_openssl.h" 17 #include "net/socket/ssl_client_socket_openssl.h"
16 #else 18 #else
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return scoped_ptr<StreamSocket>( 65 return scoped_ptr<StreamSocket>(
64 new TCPClientSocket(addresses, net_log, source)); 66 new TCPClientSocket(addresses, net_log, source));
65 } 67 }
66 68
67 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( 69 scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
68 scoped_ptr<ClientSocketHandle> transport_socket, 70 scoped_ptr<ClientSocketHandle> transport_socket,
69 const HostPortPair& host_and_port, 71 const HostPortPair& host_and_port,
70 const SSLConfig& ssl_config, 72 const SSLConfig& ssl_config,
71 const SSLClientSocketContext& context) override { 73 const SSLClientSocketContext& context) override {
72 #if defined(USE_OPENSSL) 74 #if defined(USE_OPENSSL)
73 return scoped_ptr<SSLClientSocket>( 75 return scoped_ptr<SSLClientSocket>(new SSLClientSocketOpenSSL(
74 new SSLClientSocketOpenSSL(transport_socket.Pass(), host_and_port, 76 std::move(transport_socket), host_and_port, ssl_config, context));
75 ssl_config, context));
76 #else 77 #else
77 return scoped_ptr<SSLClientSocket>(new SSLClientSocketNSS( 78 return scoped_ptr<SSLClientSocket>(new SSLClientSocketNSS(
78 transport_socket.Pass(), host_and_port, ssl_config, context)); 79 transport_socket.Pass(), host_and_port, ssl_config, context));
79 #endif 80 #endif
80 } 81 }
81 82
82 void ClearSSLSessionCache() override { SSLClientSocket::ClearSessionCache(); } 83 void ClearSSLSessionCache() override { SSLClientSocket::ClearSessionCache(); }
83 }; 84 };
84 85
85 static base::LazyInstance<DefaultClientSocketFactory>::Leaky 86 static base::LazyInstance<DefaultClientSocketFactory>::Leaky
86 g_default_client_socket_factory = LAZY_INSTANCE_INITIALIZER; 87 g_default_client_socket_factory = LAZY_INSTANCE_INITIALIZER;
87 88
88 } // namespace 89 } // namespace
89 90
90 // static 91 // static
91 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { 92 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() {
92 return g_default_client_socket_factory.Pointer(); 93 return g_default_client_socket_factory.Pointer();
93 } 94 }
94 95
95 } // namespace net 96 } // namespace net
OLDNEW
« no previous file with comments | « net/server/web_socket_encoder.cc ('k') | net/socket/client_socket_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698