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

Unified Diff: net/socket/client_socket_factory.cc

Issue 3747003: net: clean up SSLHostInfo construction. (Closed)
Patch Set: ... Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/client_socket_factory.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_factory.cc
diff --git a/net/socket/client_socket_factory.cc b/net/socket/client_socket_factory.cc
index d0793cb198d143d05a13e4e1ec141a53f4df2a05..05bebc332ab59fdcb5089621d60418864de486d7 100644
--- a/net/socket/client_socket_factory.cc
+++ b/net/socket/client_socket_factory.cc
@@ -6,6 +6,7 @@
#include "base/singleton.h"
#include "build/build_config.h"
+#include "net/base/ssl_host_info.h"
#include "net/socket/client_socket_handle.h"
#if defined(OS_WIN)
#include "net/socket/ssl_client_socket_win.h"
@@ -26,13 +27,16 @@ namespace {
SSLClientSocket* DefaultSSLClientSocketFactory(
ClientSocketHandle* transport_socket,
const std::string& hostname,
- const SSLConfig& ssl_config) {
+ const SSLConfig& ssl_config,
+ SSLHostInfo* ssl_host_info) {
+ scoped_ptr<SSLHostInfo> shi(ssl_host_info);
#if defined(OS_WIN)
return new SSLClientSocketWin(transport_socket, hostname, ssl_config);
#elif defined(USE_OPENSSL)
return new SSLClientSocketOpenSSL(transport_socket, hostname, ssl_config);
#elif defined(USE_NSS)
- return new SSLClientSocketNSS(transport_socket, hostname, ssl_config);
+ return new SSLClientSocketNSS(transport_socket, hostname, ssl_config,
+ shi.release());
#elif defined(OS_MACOSX)
// TODO(wtc): SSLClientSocketNSS can't do SSL client authentication using
// Mac OS X CDSA/CSSM yet (http://crbug.com/45369), so fall back on
@@ -40,7 +44,8 @@ SSLClientSocket* DefaultSSLClientSocketFactory(
if (ssl_config.send_client_cert)
return new SSLClientSocketMac(transport_socket, hostname, ssl_config);
- return new SSLClientSocketNSS(transport_socket, hostname, ssl_config);
+ return new SSLClientSocketNSS(transport_socket, hostname, ssl_config
+ shi.release());
#else
NOTIMPLEMENTED();
return NULL;
@@ -61,8 +66,9 @@ class DefaultClientSocketFactory : public ClientSocketFactory {
virtual SSLClientSocket* CreateSSLClientSocket(
ClientSocketHandle* transport_socket,
const std::string& hostname,
- const SSLConfig& ssl_config) {
- return g_ssl_factory(transport_socket, hostname, ssl_config);
+ const SSLConfig& ssl_config,
+ SSLHostInfo* ssl_host_info) {
+ return g_ssl_factory(transport_socket, hostname, ssl_config, ssl_host_info);
}
};
@@ -83,10 +89,12 @@ void ClientSocketFactory::SetSSLClientSocketFactory(
SSLClientSocket* ClientSocketFactory::CreateSSLClientSocket(
ClientSocket* transport_socket,
const std::string& hostname,
- const SSLConfig& ssl_config) {
+ const SSLConfig& ssl_config,
+ SSLHostInfo* ssl_host_info) {
ClientSocketHandle* socket_handle = new ClientSocketHandle();
socket_handle->set_socket(transport_socket);
- return CreateSSLClientSocket(socket_handle, hostname, ssl_config);
+ return CreateSSLClientSocket(socket_handle, hostname, ssl_config,
+ ssl_host_info);
}
} // namespace net
« no previous file with comments | « net/socket/client_socket_factory.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698