| OLD | NEW |
| 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/base/client_socket_factory.h" | 5 #include "net/base/client_socket_factory.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" |
| 7 #include "base/singleton.h" | 8 #include "base/singleton.h" |
| 9 // TODO(port): Enable when ssl_client socket is ported. |
| 10 #if defined(OS_WIN) |
| 8 #include "net/base/ssl_client_socket.h" | 11 #include "net/base/ssl_client_socket.h" |
| 12 #endif |
| 9 #include "net/base/tcp_client_socket.h" | 13 #include "net/base/tcp_client_socket.h" |
| 10 | 14 |
| 11 namespace net { | 15 namespace net { |
| 12 | 16 |
| 13 class DefaultClientSocketFactory : public ClientSocketFactory { | 17 class DefaultClientSocketFactory : public ClientSocketFactory { |
| 14 public: | 18 public: |
| 15 virtual ClientSocket* CreateTCPClientSocket( | 19 virtual ClientSocket* CreateTCPClientSocket( |
| 16 const AddressList& addresses) { | 20 const AddressList& addresses) { |
| 17 return new TCPClientSocket(addresses); | 21 return new TCPClientSocket(addresses); |
| 18 } | 22 } |
| 19 | 23 |
| 24 // TODO(port): Enable when ssl_client socket is ported. |
| 25 #if defined(OS_WIN) |
| 20 virtual ClientSocket* CreateSSLClientSocket( | 26 virtual ClientSocket* CreateSSLClientSocket( |
| 21 ClientSocket* transport_socket, | 27 ClientSocket* transport_socket, |
| 22 const std::string& hostname) { | 28 const std::string& hostname) { |
| 23 return new SSLClientSocket(transport_socket, hostname); | 29 return new SSLClientSocket(transport_socket, hostname); |
| 24 } | 30 } |
| 31 #endif |
| 25 }; | 32 }; |
| 26 | 33 |
| 27 // static | 34 // static |
| 28 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { | 35 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { |
| 29 return Singleton<DefaultClientSocketFactory>::get(); | 36 return Singleton<DefaultClientSocketFactory>::get(); |
| 30 } | 37 } |
| 31 | 38 |
| 32 } // namespace net | 39 } // namespace net |
| 33 | 40 |
| OLD | NEW |