summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_factory.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/socket/client_socket_factory.h')
-rw-r--r--net/socket/client_socket_factory.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/net/socket/client_socket_factory.h b/net/socket/client_socket_factory.h
new file mode 100644
index 0000000..6f4ff17
--- /dev/null
+++ b/net/socket/client_socket_factory.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_SOCKET_CLIENT_SOCKET_FACTORY_H_
+#define NET_SOCKET_CLIENT_SOCKET_FACTORY_H_
+
+#include <string>
+
+namespace net {
+
+class AddressList;
+class ClientSocket;
+class SSLClientSocket;
+struct SSLConfig;
+
+// An interface used to instantiate ClientSocket objects. Used to facilitate
+// testing code with mock socket implementations.
+class ClientSocketFactory {
+ public:
+ virtual ~ClientSocketFactory() {}
+
+ virtual ClientSocket* CreateTCPClientSocket(
+ const AddressList& addresses) = 0;
+
+ virtual SSLClientSocket* CreateSSLClientSocket(
+ ClientSocket* transport_socket,
+ const std::string& hostname,
+ const SSLConfig& ssl_config) = 0;
+
+ // Returns the default ClientSocketFactory.
+ static ClientSocketFactory* GetDefaultFactory();
+};
+
+} // namespace net
+
+#endif // NET_SOCKET_CLIENT_SOCKET_FACTORY_H_