OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 class SSLClientSocket; | 32 class SSLClientSocket; |
33 class TransportClientSocketPool; | 33 class TransportClientSocketPool; |
34 class TransportSecurityState; | 34 class TransportSecurityState; |
35 class TransportSocketParams; | 35 class TransportSocketParams; |
36 | 36 |
37 // SSLSocketParams only needs the socket params for the transport socket | 37 // SSLSocketParams only needs the socket params for the transport socket |
38 // that will be used (denoted by |proxy|). | 38 // that will be used (denoted by |proxy|). |
39 class NET_EXPORT_PRIVATE SSLSocketParams | 39 class NET_EXPORT_PRIVATE SSLSocketParams |
40 : public base::RefCounted<SSLSocketParams> { | 40 : public base::RefCounted<SSLSocketParams> { |
41 public: | 41 public: |
42 SSLSocketParams(const scoped_refptr<TransportSocketParams>& transport_params, | 42 static scoped_refptr<SSLSocketParams> CreateForDirectConnection( |
43 const scoped_refptr<SOCKSSocketParams>& socks_params, | 43 const scoped_refptr<TransportSocketParams>& transport_params, |
44 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, | 44 const HostPortPair& host_and_port, |
45 ProxyServer::Scheme proxy, | 45 const SSLConfig& ssl_config, |
46 const HostPortPair& host_and_port, | 46 int load_flags, |
47 const SSLConfig& ssl_config, | 47 bool force_spdy_over_ssl, |
48 int load_flags, | 48 bool want_spdy_over_npn); |
49 bool force_spdy_over_ssl, | 49 |
50 bool want_spdy_over_npn); | 50 static scoped_refptr<SSLSocketParams> CreateForHttpProxy( |
| 51 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, |
| 52 ProxyServer::Scheme proxy, |
| 53 const HostPortPair& host_and_port, |
| 54 const SSLConfig& ssl_config, |
| 55 int load_flags, |
| 56 bool force_spdy_over_ssl, |
| 57 bool want_spdy_over_npn); |
| 58 |
| 59 static scoped_refptr<SSLSocketParams> CreateForSocksProxy( |
| 60 const scoped_refptr<SOCKSSocketParams>& socks_params_, |
| 61 ProxyServer::Scheme proxy, |
| 62 const HostPortPair& host_and_port, |
| 63 const SSLConfig& ssl_config, |
| 64 int load_flags, |
| 65 bool force_spdy_over_ssl, |
| 66 bool want_spdy_over_npn); |
51 | 67 |
52 const scoped_refptr<TransportSocketParams>& transport_params() { | 68 const scoped_refptr<TransportSocketParams>& transport_params() { |
53 return transport_params_; | 69 return transport_params_; |
54 } | 70 } |
55 const scoped_refptr<HttpProxySocketParams>& http_proxy_params() { | 71 const scoped_refptr<HttpProxySocketParams>& http_proxy_params() { |
56 return http_proxy_params_; | 72 return http_proxy_params_; |
57 } | 73 } |
58 const scoped_refptr<SOCKSSocketParams>& socks_params() { | 74 const scoped_refptr<SOCKSSocketParams>& socks_params() { |
59 return socks_params_; | 75 return socks_params_; |
60 } | 76 } |
61 ProxyServer::Scheme proxy() const { return proxy_; } | 77 ProxyServer::Scheme proxy() const { return proxy_; } |
62 const HostPortPair& host_and_port() const { return host_and_port_; } | 78 const HostPortPair& host_and_port() const { return host_and_port_; } |
63 const SSLConfig& ssl_config() const { return ssl_config_; } | 79 const SSLConfig& ssl_config() const { return ssl_config_; } |
64 int load_flags() const { return load_flags_; } | 80 int load_flags() const { return load_flags_; } |
65 bool force_spdy_over_ssl() const { return force_spdy_over_ssl_; } | 81 bool force_spdy_over_ssl() const { return force_spdy_over_ssl_; } |
66 bool want_spdy_over_npn() const { return want_spdy_over_npn_; } | 82 bool want_spdy_over_npn() const { return want_spdy_over_npn_; } |
67 bool ignore_limits() const { return ignore_limits_; } | 83 bool ignore_limits() const { return ignore_limits_; } |
68 | 84 |
69 private: | 85 private: |
70 friend class base::RefCounted<SSLSocketParams>; | 86 friend class base::RefCounted<SSLSocketParams>; |
| 87 SSLSocketParams( |
| 88 const scoped_refptr<TransportSocketParams>& transport_params, |
| 89 const scoped_refptr<SOCKSSocketParams>& socks_params, |
| 90 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, |
| 91 ProxyServer::Scheme proxy, |
| 92 const HostPortPair& host_and_port, |
| 93 const SSLConfig& ssl_config, |
| 94 int load_flags, |
| 95 bool force_spdy_over_ssl, |
| 96 bool want_spdy_over_npn, |
| 97 bool ignore_limits); |
71 ~SSLSocketParams(); | 98 ~SSLSocketParams(); |
72 | 99 |
73 const scoped_refptr<TransportSocketParams> transport_params_; | 100 const scoped_refptr<TransportSocketParams> transport_params_; |
74 const scoped_refptr<HttpProxySocketParams> http_proxy_params_; | 101 const scoped_refptr<HttpProxySocketParams> http_proxy_params_; |
75 const scoped_refptr<SOCKSSocketParams> socks_params_; | 102 const scoped_refptr<SOCKSSocketParams> socks_params_; |
76 const ProxyServer::Scheme proxy_; | 103 const ProxyServer::Scheme proxy_; |
77 const HostPortPair host_and_port_; | 104 const HostPortPair host_and_port_; |
78 const SSLConfig ssl_config_; | 105 const SSLConfig ssl_config_; |
79 const int load_flags_; | 106 const int load_flags_; |
80 const bool force_spdy_over_ssl_; | 107 const bool force_spdy_over_ssl_; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 const scoped_refptr<SSLConfigService> ssl_config_service_; | 311 const scoped_refptr<SSLConfigService> ssl_config_service_; |
285 | 312 |
286 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool); | 313 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool); |
287 }; | 314 }; |
288 | 315 |
289 REGISTER_SOCKET_PARAMS_FOR_POOL(SSLClientSocketPool, SSLSocketParams); | 316 REGISTER_SOCKET_PARAMS_FOR_POOL(SSLClientSocketPool, SSLSocketParams); |
290 | 317 |
291 } // namespace net | 318 } // namespace net |
292 | 319 |
293 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ | 320 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ |
OLD | NEW |