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