| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "net/base/host_port_pair.h" |
| 14 #include "net/base/host_resolver.h" | 15 #include "net/base/host_resolver.h" |
| 15 #include "net/base/ssl_config_service.h" | 16 #include "net/base/ssl_config_service.h" |
| 16 #include "net/http/http_response_info.h" | 17 #include "net/http/http_response_info.h" |
| 17 #include "net/proxy/proxy_server.h" | 18 #include "net/proxy/proxy_server.h" |
| 18 #include "net/socket/client_socket_pool_base.h" | 19 #include "net/socket/client_socket_pool_base.h" |
| 19 #include "net/socket/client_socket_pool_histograms.h" | 20 #include "net/socket/client_socket_pool_histograms.h" |
| 20 #include "net/socket/client_socket_pool.h" | 21 #include "net/socket/client_socket_pool.h" |
| 21 | 22 |
| 22 namespace net { | 23 namespace net { |
| 23 | 24 |
| 24 class ClientSocketFactory; | 25 class ClientSocketFactory; |
| 25 class ConnectJobFactory; | 26 class ConnectJobFactory; |
| 26 class HttpProxyClientSocketPool; | 27 class HttpProxyClientSocketPool; |
| 27 class HttpProxySocketParams; | 28 class HttpProxySocketParams; |
| 28 class SOCKSClientSocketPool; | 29 class SOCKSClientSocketPool; |
| 29 class SOCKSSocketParams; | 30 class SOCKSSocketParams; |
| 30 class SSLClientSocket; | 31 class SSLClientSocket; |
| 31 class TCPClientSocketPool; | 32 class TCPClientSocketPool; |
| 32 class TCPSocketParams; | 33 class TCPSocketParams; |
| 33 | 34 |
| 34 // SSLSocketParams only needs the socket params for the transport socket | 35 // SSLSocketParams only needs the socket params for the transport socket |
| 35 // that will be used (denoted by |proxy|). | 36 // that will be used (denoted by |proxy|). |
| 36 class SSLSocketParams : public base::RefCounted<SSLSocketParams> { | 37 class SSLSocketParams : public base::RefCounted<SSLSocketParams> { |
| 37 public: | 38 public: |
| 38 SSLSocketParams(const scoped_refptr<TCPSocketParams>& tcp_params, | 39 SSLSocketParams(const scoped_refptr<TCPSocketParams>& tcp_params, |
| 39 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, | 40 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, |
| 40 const scoped_refptr<SOCKSSocketParams>& socks_params, | 41 const scoped_refptr<SOCKSSocketParams>& socks_params, |
| 41 ProxyServer::Scheme proxy, | 42 ProxyServer::Scheme proxy, |
| 42 const std::string& hostname, | 43 const HostPortPair& host_port_pair, |
| 43 const SSLConfig& ssl_config, | 44 const SSLConfig& ssl_config, |
| 44 int load_flags, | 45 int load_flags, |
| 45 bool force_spdy_over_ssl, | 46 bool force_spdy_over_ssl, |
| 46 bool want_spdy_over_npn); | 47 bool want_spdy_over_npn); |
| 47 | 48 |
| 48 const scoped_refptr<TCPSocketParams>& tcp_params() { return tcp_params_; } | 49 const scoped_refptr<TCPSocketParams>& tcp_params() { return tcp_params_; } |
| 49 const scoped_refptr<HttpProxySocketParams>& http_proxy_params() { | 50 const scoped_refptr<HttpProxySocketParams>& http_proxy_params() { |
| 50 return http_proxy_params_; | 51 return http_proxy_params_; |
| 51 } | 52 } |
| 52 const scoped_refptr<SOCKSSocketParams>& socks_params() { | 53 const scoped_refptr<SOCKSSocketParams>& socks_params() { |
| 53 return socks_params_; | 54 return socks_params_; |
| 54 } | 55 } |
| 55 ProxyServer::Scheme proxy() const { return proxy_; } | 56 ProxyServer::Scheme proxy() const { return proxy_; } |
| 56 const std::string& hostname() const { return hostname_; } | 57 const HostPortPair& host_port_pair() const { return host_port_pair_; } |
| 57 const SSLConfig& ssl_config() const { return ssl_config_; } | 58 const SSLConfig& ssl_config() const { return ssl_config_; } |
| 58 int load_flags() const { return load_flags_; } | 59 int load_flags() const { return load_flags_; } |
| 59 bool force_spdy_over_ssl() const { return force_spdy_over_ssl_; } | 60 bool force_spdy_over_ssl() const { return force_spdy_over_ssl_; } |
| 60 bool want_spdy_over_npn() const { return want_spdy_over_npn_; } | 61 bool want_spdy_over_npn() const { return want_spdy_over_npn_; } |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 friend class base::RefCounted<SSLSocketParams>; | 64 friend class base::RefCounted<SSLSocketParams>; |
| 64 ~SSLSocketParams(); | 65 ~SSLSocketParams(); |
| 65 | 66 |
| 66 const scoped_refptr<TCPSocketParams> tcp_params_; | 67 const scoped_refptr<TCPSocketParams> tcp_params_; |
| 67 const scoped_refptr<HttpProxySocketParams> http_proxy_params_; | 68 const scoped_refptr<HttpProxySocketParams> http_proxy_params_; |
| 68 const scoped_refptr<SOCKSSocketParams> socks_params_; | 69 const scoped_refptr<SOCKSSocketParams> socks_params_; |
| 69 const ProxyServer::Scheme proxy_; | 70 const ProxyServer::Scheme proxy_; |
| 70 const std::string hostname_; | 71 const HostPortPair host_port_pair_; |
| 71 const SSLConfig ssl_config_; | 72 const SSLConfig ssl_config_; |
| 72 const int load_flags_; | 73 const int load_flags_; |
| 73 const bool force_spdy_over_ssl_; | 74 const bool force_spdy_over_ssl_; |
| 74 const bool want_spdy_over_npn_; | 75 const bool want_spdy_over_npn_; |
| 75 | 76 |
| 76 DISALLOW_COPY_AND_ASSIGN(SSLSocketParams); | 77 DISALLOW_COPY_AND_ASSIGN(SSLSocketParams); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 // SSLConnectJob handles the SSL handshake after setting up the underlying | 80 // SSLConnectJob handles the SSL handshake after setting up the underlying |
| 80 // connection as specified in the params. | 81 // connection as specified in the params. |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 PoolBase base_; | 243 PoolBase base_; |
| 243 | 244 |
| 244 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool); | 245 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool); |
| 245 }; | 246 }; |
| 246 | 247 |
| 247 REGISTER_SOCKET_PARAMS_FOR_POOL(SSLClientSocketPool, SSLSocketParams); | 248 REGISTER_SOCKET_PARAMS_FOR_POOL(SSLClientSocketPool, SSLSocketParams); |
| 248 | 249 |
| 249 } // namespace net | 250 } // namespace net |
| 250 | 251 |
| 251 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ | 252 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |