Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: jingle/notifier/base/xmpp_client_socket_factory.h

Issue 6833031: Changed the jingle network code in ChromeAsyncSocket to use the client socket pool. This also all... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Review comments addressed Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef JINGLE_NOTIFIER_BASE_XMPP_CLIENT_SOCKET_FACTORY_H_ 5 #ifndef JINGLE_NOTIFIER_BASE_XMPP_CLIENT_SOCKET_FACTORY_H_
6 #define JINGLE_NOTIFIER_BASE_XMPP_CLIENT_SOCKET_FACTORY_H_ 6 #define JINGLE_NOTIFIER_BASE_XMPP_CLIENT_SOCKET_FACTORY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "net/socket/client_socket_factory.h" 10 #include "base/memory/ref_counted.h"
11 #include "net/base/ssl_config_service.h"
11 12
12 namespace net { 13 namespace net {
13 class DnsCertProvenanceChecker; 14 class ClientSocket;
15 class ClientSocketFactory;
16 class ClientSocketHandle;
14 class HostPortPair; 17 class HostPortPair;
18 class NetLog;
19 class SSLClientSocket;
15 class SSLHostInfo; 20 class SSLHostInfo;
21 class URLRequestContextGetter;
16 } 22 }
17 23
18 namespace notifier { 24 namespace notifier {
19 25
20 class XmppClientSocketFactory : public net::ClientSocketFactory { 26 // Interface for a ClientSocketFactory that creates ClientSockets that can
27 // resolve host names and tunnel through proxies.
akalin 2011/04/15 01:47:33 can you put this into its own file, and add a TODO
sanjeevr 2011/04/15 04:23:35 Done.
28 class ResolvingClientSocketFactory {
29 public:
30 virtual ~ResolvingClientSocketFactory() { }
31 // Method to create a transport socket using a HostPortPair.
32 virtual net::ClientSocket* CreateTransportClientSocket(
33 const net::HostPortPair& host_and_port, net::NetLog* net_log) = 0;
34
35 virtual net::SSLClientSocket* CreateSSLClientSocket(
36 net::ClientSocketHandle* transport_socket,
37 const net::HostPortPair& host_and_port) = 0;
38 };
39
40
41 class XmppClientSocketFactory : public ResolvingClientSocketFactory {
21 public: 42 public:
22 // Does not take ownership of |client_socket_factory|. 43 // Does not take ownership of |client_socket_factory|.
23 XmppClientSocketFactory( 44 XmppClientSocketFactory(
24 net::ClientSocketFactory* client_socket_factory, 45 net::ClientSocketFactory* client_socket_factory,
46 const net::SSLConfig& ssl_config,
47 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter,
25 bool use_fake_ssl_client_socket); 48 bool use_fake_ssl_client_socket);
26 49
27 virtual ~XmppClientSocketFactory(); 50 virtual ~XmppClientSocketFactory();
28 51
29 // net::ClientSocketFactory implementation. 52 // ResolvingClientSocketFactory implementation.
30 virtual net::ClientSocket* CreateTransportClientSocket( 53 virtual net::ClientSocket* CreateTransportClientSocket(
31 const net::AddressList& addresses, net::NetLog* net_log, 54 const net::HostPortPair& host_and_port, net::NetLog* net_log);
32 const net::NetLog::Source& source); 55
33 virtual net::SSLClientSocket* CreateSSLClientSocket( 56 virtual net::SSLClientSocket* CreateSSLClientSocket(
34 net::ClientSocketHandle* transport_socket, 57 net::ClientSocketHandle* transport_socket,
35 const net::HostPortPair& host_and_port, const net::SSLConfig& ssl_config, 58 const net::HostPortPair& host_and_port);
36 net::SSLHostInfo* ssl_host_info, net::CertVerifier* cert_verifier,
37 net::DnsCertProvenanceChecker* dns_cert_checker);
38 virtual void ClearSSLSessionCache();
39 59
40 private: 60 private:
41 net::ClientSocketFactory* const client_socket_factory_; 61 net::ClientSocketFactory* const client_socket_factory_;
62 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
63 const net::SSLConfig ssl_config_;
42 const bool use_fake_ssl_client_socket_; 64 const bool use_fake_ssl_client_socket_;
43 65
44 DISALLOW_COPY_AND_ASSIGN(XmppClientSocketFactory); 66 DISALLOW_COPY_AND_ASSIGN(XmppClientSocketFactory);
45 }; 67 };
46 68
47 } // namespace notifier 69 } // namespace notifier
48 70
49 #endif // JINGLE_NOTIFIER_BASE_XMPP_CLIENT_SOCKET_FACTORY_H_ 71 #endif // JINGLE_NOTIFIER_BASE_XMPP_CLIENT_SOCKET_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698