blob: 3a3bb8404254b943c2bd3042c64a19156a4c8960 [file] [log] [blame]
license.botbf09a502008-08-24 00:55:551// 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.commit586acc5fe2008-07-26 22:42:524
5#ifndef NET_BASE_CLIENT_SOCKET_FACTORY_H_
6#define NET_BASE_CLIENT_SOCKET_FACTORY_H_
7
8#include <string>
9
10namespace net {
11
12class AddressList;
13class ClientSocket;
[email protected]aaead502008-10-15 00:20:1114class SSLClientSocket;
15struct SSLConfig;
initial.commit586acc5fe2008-07-26 22:42:5216
17// An interface used to instantiate ClientSocket objects. Used to facilitate
18// testing code with mock socket implementations.
19class ClientSocketFactory {
20 public:
[email protected]836dff32008-08-05 23:15:3621 virtual ~ClientSocketFactory() {}
22
initial.commit586acc5fe2008-07-26 22:42:5223 virtual ClientSocket* CreateTCPClientSocket(
24 const AddressList& addresses) = 0;
25
[email protected]aaead502008-10-15 00:20:1126 virtual SSLClientSocket* CreateSSLClientSocket(
initial.commit586acc5fe2008-07-26 22:42:5227 ClientSocket* transport_socket,
[email protected]c5949a32008-10-08 17:28:2328 const std::string& hostname,
[email protected]aaead502008-10-15 00:20:1129 const SSLConfig& ssl_config) = 0;
initial.commit586acc5fe2008-07-26 22:42:5230
31 // Returns the default ClientSocketFactory.
32 static ClientSocketFactory* GetDefaultFactory();
33};
34
35} // namespace net
36
37#endif // NET_BASE_CLIENT_SOCKET_FACTORY_H_
license.botbf09a502008-08-24 00:55:5538