 Chromium Code Reviews
 Chromium Code Reviews Issue 4339001:
  Correctly handle SSL Client Authentication requests when connecting...  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src/
    
  
    Issue 4339001:
  Correctly handle SSL Client Authentication requests when connecting...  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src/| OLD | NEW | 
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef NET_SOCKET_CLIENT_SOCKET_FACTORY_H_ | 5 #ifndef NET_SOCKET_CLIENT_SOCKET_FACTORY_H_ | 
| 6 #define NET_SOCKET_CLIENT_SOCKET_FACTORY_H_ | 6 #define NET_SOCKET_CLIENT_SOCKET_FACTORY_H_ | 
| 7 #pragma once | 7 #pragma once | 
| 8 | 8 | 
| 9 #include <string> | 9 #include <string> | 
| 10 | 10 | 
| 11 #include "base/basictypes.h" | |
| 11 #include "net/base/net_log.h" | 12 #include "net/base/net_log.h" | 
| 12 | 13 | 
| 13 namespace net { | 14 namespace net { | 
| 14 | 15 | 
| 15 class AddressList; | 16 class AddressList; | 
| 16 class ClientSocket; | 17 class ClientSocket; | 
| 17 class ClientSocketHandle; | 18 class ClientSocketHandle; | 
| 18 class DnsRRResolver; | 19 class DnsRRResolver; | 
| 19 class SSLClientSocket; | 20 class SSLClientSocket; | 
| 20 struct SSLConfig; | 21 struct SSLConfig; | 
| 21 class SSLHostInfo; | 22 class SSLHostInfo; | 
| 22 | 23 | 
| 23 // Callback function to create new SSLClientSocket objects. | 24 // Callback function to create new SSLClientSocket objects. | 
| 24 typedef SSLClientSocket* (*SSLClientSocketFactory)( | 25 typedef SSLClientSocket* (*SSLClientSocketFactory)( | 
| 25 ClientSocketHandle* transport_socket, | 26 ClientSocketHandle* transport_socket, | 
| 26 const std::string& hostname, | 27 const std::string& hostname, | 
| 28 uint16 port, | |
| 27 const SSLConfig& ssl_config, | 29 const SSLConfig& ssl_config, | 
| 28 SSLHostInfo* ssl_host_info, | 30 SSLHostInfo* ssl_host_info, | 
| 29 DnsRRResolver* dnsrr_resolver); | 31 DnsRRResolver* dnsrr_resolver); | 
| 30 | 32 | 
| 31 // An interface used to instantiate ClientSocket objects. Used to facilitate | 33 // An interface used to instantiate ClientSocket objects. Used to facilitate | 
| 32 // testing code with mock socket implementations. | 34 // testing code with mock socket implementations. | 
| 33 class ClientSocketFactory { | 35 class ClientSocketFactory { | 
| 34 public: | 36 public: | 
| 35 virtual ~ClientSocketFactory() {} | 37 virtual ~ClientSocketFactory() {} | 
| 36 | 38 | 
| 37 // |source| is the NetLog::Source for the entity trying to create the socket, | 39 // |source| is the NetLog::Source for the entity trying to create the socket, | 
| 38 // if it has one. | 40 // if it has one. | 
| 39 virtual ClientSocket* CreateTCPClientSocket( | 41 virtual ClientSocket* CreateTCPClientSocket( | 
| 40 const AddressList& addresses, | 42 const AddressList& addresses, | 
| 41 NetLog* net_log, | 43 NetLog* net_log, | 
| 42 const NetLog::Source& source) = 0; | 44 const NetLog::Source& source) = 0; | 
| 43 | 45 | 
| 44 virtual SSLClientSocket* CreateSSLClientSocket( | 46 virtual SSLClientSocket* CreateSSLClientSocket( | 
| 45 ClientSocketHandle* transport_socket, | 47 ClientSocketHandle* transport_socket, | 
| 46 const std::string& hostname, | 48 const std::string& hostname, | 
| 49 uint16 port, | |
| 
eroman
2010/11/11 19:18:31
Please change the function signature to take a |co
 | |
| 47 const SSLConfig& ssl_config, | 50 const SSLConfig& ssl_config, | 
| 48 SSLHostInfo* ssl_host_info, | 51 SSLHostInfo* ssl_host_info, | 
| 49 DnsRRResolver* dnsrr_resolver) = 0; | 52 DnsRRResolver* dnsrr_resolver) = 0; | 
| 50 | 53 | 
| 51 // Deprecated function (http://crbug.com/37810) that takes a ClientSocket. | 54 // Deprecated function (http://crbug.com/37810) that takes a ClientSocket. | 
| 52 virtual SSLClientSocket* CreateSSLClientSocket(ClientSocket* transport_socket, | 55 virtual SSLClientSocket* CreateSSLClientSocket(ClientSocket* transport_socket, | 
| 53 const std::string& hostname, | 56 const std::string& hostname, | 
| 57 uint16 port, | |
| 54 const SSLConfig& ssl_config, | 58 const SSLConfig& ssl_config, | 
| 55 SSLHostInfo* ssl_host_info); | 59 SSLHostInfo* ssl_host_info); | 
| 56 | 60 | 
| 57 // Returns the default ClientSocketFactory. | 61 // Returns the default ClientSocketFactory. | 
| 58 static ClientSocketFactory* GetDefaultFactory(); | 62 static ClientSocketFactory* GetDefaultFactory(); | 
| 59 | 63 | 
| 60 // Instructs the default ClientSocketFactory to use |factory| to create | 64 // Instructs the default ClientSocketFactory to use |factory| to create | 
| 61 // SSLClientSocket objects. | 65 // SSLClientSocket objects. | 
| 62 static void SetSSLClientSocketFactory(SSLClientSocketFactory factory); | 66 static void SetSSLClientSocketFactory(SSLClientSocketFactory factory); | 
| 63 }; | 67 }; | 
| 64 | 68 | 
| 65 } // namespace net | 69 } // namespace net | 
| 66 | 70 | 
| 67 #endif // NET_SOCKET_CLIENT_SOCKET_FACTORY_H_ | 71 #endif // NET_SOCKET_CLIENT_SOCKET_FACTORY_H_ | 
| OLD | NEW |