license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame^] | 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 |
| 3 | // found in the LICENSE file. |
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 4 | |
| 5 | #ifndef NET_BASE_CLIENT_SOCKET_FACTORY_H_ |
| 6 | #define NET_BASE_CLIENT_SOCKET_FACTORY_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | namespace net { |
| 11 | |
| 12 | class AddressList; |
| 13 | class ClientSocket; |
| 14 | |
| 15 | // An interface used to instantiate ClientSocket objects. Used to facilitate |
| 16 | // testing code with mock socket implementations. |
| 17 | class ClientSocketFactory { |
| 18 | public: |
[email protected] | 836dff3 | 2008-08-05 23:15:36 | [diff] [blame] | 19 | virtual ~ClientSocketFactory() {} |
| 20 | |
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 21 | virtual ClientSocket* CreateTCPClientSocket( |
| 22 | const AddressList& addresses) = 0; |
| 23 | |
| 24 | virtual ClientSocket* CreateSSLClientSocket( |
| 25 | ClientSocket* transport_socket, |
| 26 | const std::string& hostname) = 0; |
| 27 | |
| 28 | // Returns the default ClientSocketFactory. |
| 29 | static ClientSocketFactory* GetDefaultFactory(); |
| 30 | }; |
| 31 | |
| 32 | } // namespace net |
| 33 | |
| 34 | #endif // NET_BASE_CLIENT_SOCKET_FACTORY_H_ |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame^] | 35 | |