blob: e5a6956b3ffb7b539d4f078194f8ed0432371237 [file] [log] [blame]
[email protected]f8986012011-05-19 21:53:581// Copyright (c) 2011 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// 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
[email protected]f7984fc62009-06-22 23:26:445#ifndef NET_SOCKET_CLIENT_SOCKET_FACTORY_H_
6#define NET_SOCKET_CLIENT_SOCKET_FACTORY_H_
[email protected]32b76ef2010-07-26 23:08:247#pragma once
initial.commit586acc5fe2008-07-26 22:42:528
9#include <string>
10
[email protected]4f4de7e62010-11-12 19:55:2711#include "base/basictypes.h"
[email protected]f8986012011-05-19 21:53:5812#include "net/base/net_api.h"
[email protected]0a0b7682010-08-25 17:08:0713#include "net/base/net_log.h"
14
initial.commit586acc5fe2008-07-26 22:42:5215namespace net {
16
17class AddressList;
[email protected]822581d2010-12-16 17:27:1518class CertVerifier;
[email protected]e60e47a2010-07-14 03:37:1819class ClientSocketHandle;
[email protected]98b0e582011-06-22 14:31:4120class DatagramClientSocket;
[email protected]345c613b2010-11-22 19:33:1821class DnsCertProvenanceChecker;
[email protected]4f4de7e62010-11-12 19:55:2722class HostPortPair;
[email protected]aaead502008-10-15 00:20:1123class SSLClientSocket;
24struct SSLConfig;
[email protected]7ab5bbd12010-10-19 13:33:2125class SSLHostInfo;
[email protected]3268023f2011-05-05 00:08:1026class StreamSocket;
initial.commit586acc5fe2008-07-26 22:42:5227
[email protected]3268023f2011-05-05 00:08:1028// An interface used to instantiate StreamSocket objects. Used to facilitate
initial.commit586acc5fe2008-07-26 22:42:5229// testing code with mock socket implementations.
[email protected]f8986012011-05-19 21:53:5830class NET_API ClientSocketFactory {
initial.commit586acc5fe2008-07-26 22:42:5231 public:
[email protected]836dff32008-08-05 23:15:3632 virtual ~ClientSocketFactory() {}
33
[email protected]0a0b7682010-08-25 17:08:0734 // |source| is the NetLog::Source for the entity trying to create the socket,
35 // if it has one.
[email protected]98b0e582011-06-22 14:31:4136 virtual DatagramClientSocket* CreateDatagramClientSocket(
37 NetLog* net_log,
38 const NetLog::Source& source) = 0;
39
[email protected]3268023f2011-05-05 00:08:1040 virtual StreamSocket* CreateTransportClientSocket(
[email protected]0a0b7682010-08-25 17:08:0741 const AddressList& addresses,
42 NetLog* net_log,
43 const NetLog::Source& source) = 0;
initial.commit586acc5fe2008-07-26 22:42:5244
[email protected]aaead502008-10-15 00:20:1145 virtual SSLClientSocket* CreateSSLClientSocket(
[email protected]e60e47a2010-07-14 03:37:1846 ClientSocketHandle* transport_socket,
[email protected]4f4de7e62010-11-12 19:55:2747 const HostPortPair& host_and_port,
[email protected]7ab5bbd12010-10-19 13:33:2148 const SSLConfig& ssl_config,
[email protected]d8fbf582010-11-04 21:51:1249 SSLHostInfo* ssl_host_info,
[email protected]822581d2010-12-16 17:27:1550 CertVerifier* cert_verifier,
[email protected]345c613b2010-11-22 19:33:1851 DnsCertProvenanceChecker* dns_cert_checker) = 0;
[email protected]e60e47a2010-07-14 03:37:1852
[email protected]3268023f2011-05-05 00:08:1053 // Deprecated function (http://crbug.com/37810) that takes a StreamSocket.
[email protected]4f4de7e62010-11-12 19:55:2754 virtual SSLClientSocket* CreateSSLClientSocket(
[email protected]3268023f2011-05-05 00:08:1055 StreamSocket* transport_socket,
[email protected]4f4de7e62010-11-12 19:55:2756 const HostPortPair& host_and_port,
57 const SSLConfig& ssl_config,
[email protected]822581d2010-12-16 17:27:1558 SSLHostInfo* ssl_host_info,
59 CertVerifier* cert_verifier);
[email protected]e60e47a2010-07-14 03:37:1860
[email protected]25f47352011-02-25 16:31:5961 // Clears cache used for SSL session resumption.
62 virtual void ClearSSLSessionCache() = 0;
63
initial.commit586acc5fe2008-07-26 22:42:5264 // Returns the default ClientSocketFactory.
65 static ClientSocketFactory* GetDefaultFactory();
[email protected]abe48d32010-02-03 02:09:3666
[email protected]2380f372011-02-23 21:35:1967 // Instructs the default ClientSocketFactory to use the system SSL library.
68 static void UseSystemSSL();
initial.commit586acc5fe2008-07-26 22:42:5269};
70
71} // namespace net
72
[email protected]f7984fc62009-06-22 23:26:4473#endif // NET_SOCKET_CLIENT_SOCKET_FACTORY_H_