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

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

Issue 573041: Add the ssl_client_socket_nss_factory.h header and declare... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Sync with the current trunk. Created 10 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/client_socket_factory.h ('k') | net/socket/ssl_client_socket_nss_factory.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/singleton.h" 7 #include "base/singleton.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include "net/socket/ssl_client_socket_win.h" 10 #include "net/socket/ssl_client_socket_win.h"
(...skipping 17 matching lines...) Expand all
28 #elif defined(USE_NSS) 28 #elif defined(USE_NSS)
29 return new SSLClientSocketNSS(transport_socket, hostname, ssl_config); 29 return new SSLClientSocketNSS(transport_socket, hostname, ssl_config);
30 #elif defined(OS_MACOSX) 30 #elif defined(OS_MACOSX)
31 return new SSLClientSocketMac(transport_socket, hostname, ssl_config); 31 return new SSLClientSocketMac(transport_socket, hostname, ssl_config);
32 #else 32 #else
33 NOTIMPLEMENTED(); 33 NOTIMPLEMENTED();
34 return NULL; 34 return NULL;
35 #endif 35 #endif
36 } 36 }
37 37
38 // True if we should use NSS instead of the system SSL library for SSL.
39 SSLClientSocketFactory g_ssl_factory = DefaultSSLClientSocketFactory; 38 SSLClientSocketFactory g_ssl_factory = DefaultSSLClientSocketFactory;
40 39
41 class DefaultClientSocketFactory : public ClientSocketFactory { 40 class DefaultClientSocketFactory : public ClientSocketFactory {
42 public: 41 public:
43 virtual ClientSocket* CreateTCPClientSocket( 42 virtual ClientSocket* CreateTCPClientSocket(
44 const AddressList& addresses) { 43 const AddressList& addresses) {
45 return new TCPClientSocket(addresses); 44 return new TCPClientSocket(addresses);
46 } 45 }
47 46
48 virtual SSLClientSocket* CreateSSLClientSocket( 47 virtual SSLClientSocket* CreateSSLClientSocket(
(...skipping 11 matching lines...) Expand all
60 return Singleton<DefaultClientSocketFactory>::get(); 59 return Singleton<DefaultClientSocketFactory>::get();
61 } 60 }
62 61
63 // static 62 // static
64 void ClientSocketFactory::SetSSLClientSocketFactory( 63 void ClientSocketFactory::SetSSLClientSocketFactory(
65 SSLClientSocketFactory factory) { 64 SSLClientSocketFactory factory) {
66 g_ssl_factory = factory; 65 g_ssl_factory = factory;
67 } 66 }
68 67
69 } // namespace net 68 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_factory.h ('k') | net/socket/ssl_client_socket_nss_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698