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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 SSLSocketParams(const scoped_refptr<TCPSocketParams>& tcp_params, | 35 SSLSocketParams(const scoped_refptr<TCPSocketParams>& tcp_params, |
36 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, | 36 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, |
37 const scoped_refptr<SOCKSSocketParams>& socks_params, | 37 const scoped_refptr<SOCKSSocketParams>& socks_params, |
38 ProxyServer::Scheme proxy, | 38 ProxyServer::Scheme proxy, |
39 const std::string& hostname, | 39 const std::string& hostname, |
40 const SSLConfig& ssl_config, | 40 const SSLConfig& ssl_config, |
41 int load_flags, | 41 int load_flags, |
42 bool want_spdy); | 42 bool want_spdy); |
43 | 43 |
44 const scoped_refptr<TCPSocketParams>& tcp_params() { return tcp_params_; } | 44 const scoped_refptr<TCPSocketParams>& tcp_params() { return tcp_params_; } |
45 const scoped_refptr<HttpProxySocketParams>& http_proxy_params () { | 45 const scoped_refptr<HttpProxySocketParams>& http_proxy_params() { |
46 return http_proxy_params_; | 46 return http_proxy_params_; |
47 } | 47 } |
48 const scoped_refptr<SOCKSSocketParams>& socks_params() { | 48 const scoped_refptr<SOCKSSocketParams>& socks_params() { |
49 return socks_params_; | 49 return socks_params_; |
50 } | 50 } |
51 ProxyServer::Scheme proxy() const { return proxy_; } | 51 ProxyServer::Scheme proxy() const { return proxy_; } |
52 const std::string& hostname() const { return hostname_; } | 52 const std::string& hostname() const { return hostname_; } |
53 const SSLConfig& ssl_config() const { return ssl_config_; } | 53 const SSLConfig& ssl_config() const { return ssl_config_; } |
54 int load_flags() const { return load_flags_; } | 54 int load_flags() const { return load_flags_; } |
55 bool want_spdy() const { return want_spdy_; } | 55 bool want_spdy() const { return want_spdy_; } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 STATE_SSL_CONNECT, | 103 STATE_SSL_CONNECT, |
104 STATE_SSL_CONNECT_COMPLETE, | 104 STATE_SSL_CONNECT_COMPLETE, |
105 STATE_NONE, | 105 STATE_NONE, |
106 }; | 106 }; |
107 | 107 |
108 // Starts the SSL connection process. Returns OK on success and | 108 // Starts the SSL connection process. Returns OK on success and |
109 // ERR_IO_PENDING if it cannot immediately service the request. | 109 // ERR_IO_PENDING if it cannot immediately service the request. |
110 // Otherwise, it returns a net error code. | 110 // Otherwise, it returns a net error code. |
111 virtual int ConnectInternal(); | 111 virtual int ConnectInternal(); |
112 | 112 |
113 void DetermineFirstState(); | |
114 | |
115 void OnIOComplete(int result); | 113 void OnIOComplete(int result); |
116 | 114 |
117 // Runs the state transition loop. | 115 // Runs the state transition loop. |
118 int DoLoop(int result); | 116 int DoLoop(int result); |
119 | 117 |
120 int DoTCPConnect(); | 118 int DoTCPConnect(); |
121 int DoTCPConnectComplete(int result); | 119 int DoTCPConnectComplete(int result); |
122 int DoSOCKSConnect(); | 120 int DoSOCKSConnect(); |
123 int DoSOCKSConnectComplete(int result); | 121 int DoSOCKSConnectComplete(int result); |
124 int DoTunnelConnect(); | 122 int DoTunnelConnect(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 PoolBase base_; | 236 PoolBase base_; |
239 | 237 |
240 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool); | 238 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool); |
241 }; | 239 }; |
242 | 240 |
243 REGISTER_SOCKET_PARAMS_FOR_POOL(SSLClientSocketPool, SSLSocketParams); | 241 REGISTER_SOCKET_PARAMS_FOR_POOL(SSLClientSocketPool, SSLSocketParams); |
244 | 242 |
245 } // namespace net | 243 } // namespace net |
246 | 244 |
247 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ | 245 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ |
OLD | NEW |