| OLD | NEW |
| 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 "jingle/notifier/base/resolving_client_socket_factory.h" |
| 12 #include "net/base/ssl_config_service.h" |
| 11 | 13 |
| 12 namespace net { | 14 namespace net { |
| 13 class DnsCertProvenanceChecker; | 15 class ClientSocket; |
| 16 class ClientSocketFactory; |
| 17 class ClientSocketHandle; |
| 14 class HostPortPair; | 18 class HostPortPair; |
| 19 class NetLog; |
| 20 class SSLClientSocket; |
| 15 class SSLHostInfo; | 21 class SSLHostInfo; |
| 22 class URLRequestContextGetter; |
| 16 } | 23 } |
| 17 | 24 |
| 18 namespace notifier { | 25 namespace notifier { |
| 19 | 26 |
| 20 class XmppClientSocketFactory : public net::ClientSocketFactory { | 27 class XmppClientSocketFactory : public ResolvingClientSocketFactory { |
| 21 public: | 28 public: |
| 22 // Does not take ownership of |client_socket_factory|. | 29 // Does not take ownership of |client_socket_factory|. |
| 23 XmppClientSocketFactory( | 30 XmppClientSocketFactory( |
| 24 net::ClientSocketFactory* client_socket_factory, | 31 net::ClientSocketFactory* client_socket_factory, |
| 32 const net::SSLConfig& ssl_config, |
| 33 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, |
| 25 bool use_fake_ssl_client_socket); | 34 bool use_fake_ssl_client_socket); |
| 26 | 35 |
| 27 virtual ~XmppClientSocketFactory(); | 36 virtual ~XmppClientSocketFactory(); |
| 28 | 37 |
| 29 // net::ClientSocketFactory implementation. | 38 // ResolvingClientSocketFactory implementation. |
| 30 virtual net::ClientSocket* CreateTransportClientSocket( | 39 virtual net::ClientSocket* CreateTransportClientSocket( |
| 31 const net::AddressList& addresses, net::NetLog* net_log, | 40 const net::HostPortPair& host_and_port, net::NetLog* net_log); |
| 32 const net::NetLog::Source& source); | 41 |
| 33 virtual net::SSLClientSocket* CreateSSLClientSocket( | 42 virtual net::SSLClientSocket* CreateSSLClientSocket( |
| 34 net::ClientSocketHandle* transport_socket, | 43 net::ClientSocketHandle* transport_socket, |
| 35 const net::HostPortPair& host_and_port, const net::SSLConfig& ssl_config, | 44 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 | 45 |
| 40 private: | 46 private: |
| 41 net::ClientSocketFactory* const client_socket_factory_; | 47 net::ClientSocketFactory* const client_socket_factory_; |
| 48 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 49 const net::SSLConfig ssl_config_; |
| 42 const bool use_fake_ssl_client_socket_; | 50 const bool use_fake_ssl_client_socket_; |
| 43 | 51 |
| 44 DISALLOW_COPY_AND_ASSIGN(XmppClientSocketFactory); | 52 DISALLOW_COPY_AND_ASSIGN(XmppClientSocketFactory); |
| 45 }; | 53 }; |
| 46 | 54 |
| 47 } // namespace notifier | 55 } // namespace notifier |
| 48 | 56 |
| 49 #endif // JINGLE_NOTIFIER_BASE_XMPP_CLIENT_SOCKET_FACTORY_H_ | 57 #endif // JINGLE_NOTIFIER_BASE_XMPP_CLIENT_SOCKET_FACTORY_H_ |
| OLD | NEW |