| 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_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| 6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 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_port_pair.h" |
| 15 #include "net/base/host_resolver.h" | 15 #include "net/base/host_resolver.h" |
| 16 #include "net/http/http_auth.h" |
| 16 #include "net/proxy/proxy_server.h" | 17 #include "net/proxy/proxy_server.h" |
| 17 #include "net/socket/client_socket_pool_base.h" | 18 #include "net/socket/client_socket_pool_base.h" |
| 18 #include "net/socket/client_socket_pool_histograms.h" | 19 #include "net/socket/client_socket_pool_histograms.h" |
| 19 #include "net/socket/client_socket_pool.h" | 20 #include "net/socket/client_socket_pool.h" |
| 20 #include "net/socket/tcp_client_socket_pool.h" | 21 #include "net/socket/tcp_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 HttpAuthController; | 27 class HttpAuthController; |
| 27 | 28 |
| 28 class HttpProxySocketParams : public base::RefCounted<HttpProxySocketParams> { | 29 class HttpProxySocketParams : public base::RefCounted<HttpProxySocketParams> { |
| 29 public: | 30 public: |
| 30 HttpProxySocketParams(const scoped_refptr<TCPSocketParams>& proxy_server, | 31 HttpProxySocketParams(const scoped_refptr<TCPSocketParams>& proxy_server, |
| 31 const GURL& request_url, HostPortPair endpoint, | 32 const GURL& request_url, HostPortPair endpoint, |
| 32 scoped_refptr<HttpAuthController> auth_controller, | 33 scoped_refptr<HttpAuthController> auth_controller, |
| 33 bool tunnel); | 34 bool tunnel); |
| 34 | 35 |
| 35 const scoped_refptr<TCPSocketParams>& tcp_params() const { | 36 const scoped_refptr<TCPSocketParams>& tcp_params() const { |
| 36 return tcp_params_; | 37 return tcp_params_; |
| 37 } | 38 } |
| 38 const GURL& request_url() const { return request_url_; } | 39 const GURL& request_url() const { return request_url_; } |
| 39 const HostPortPair& endpoint() const { return endpoint_; } | 40 const HostPortPair& endpoint() const { return endpoint_; } |
| 40 const scoped_refptr<HttpAuthController>& auth_controller() const { | 41 const scoped_refptr<HttpAuthController>& auth_controller() { |
| 41 return auth_controller_; | 42 return auth_controller_; |
| 42 } | 43 } |
| 43 bool tunnel() const { return tunnel_; } | 44 bool tunnel() const { return tunnel_; } |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 friend class base::RefCounted<HttpProxySocketParams>; | 47 friend class base::RefCounted<HttpProxySocketParams>; |
| 47 ~HttpProxySocketParams(); | 48 ~HttpProxySocketParams(); |
| 48 | 49 |
| 49 const scoped_refptr<TCPSocketParams> tcp_params_; | 50 const scoped_refptr<TCPSocketParams> tcp_params_; |
| 50 const GURL request_url_; | 51 const GURL request_url_; |
| 51 const HostPortPair endpoint_; | 52 const HostPortPair endpoint_; |
| 52 const scoped_refptr<HttpAuthController> auth_controller_; | 53 const scoped_refptr<HttpAuthController> auth_controller_; |
| 53 const bool tunnel_; | 54 const bool tunnel_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(HttpProxySocketParams); |
| 54 }; | 57 }; |
| 55 | 58 |
| 56 // HttpProxyConnectJob optionally establishes a tunnel through the proxy | 59 // HttpProxyConnectJob optionally establishes a tunnel through the proxy |
| 57 // server after connecting the underlying transport socket. | 60 // server after connecting the underlying transport socket. |
| 58 class HttpProxyConnectJob : public ConnectJob { | 61 class HttpProxyConnectJob : public ConnectJob { |
| 59 public: | 62 public: |
| 60 HttpProxyConnectJob(const std::string& group_name, | 63 HttpProxyConnectJob(const std::string& group_name, |
| 61 const scoped_refptr<HttpProxySocketParams>& params, | 64 const scoped_refptr<HttpProxySocketParams>& params, |
| 62 const base::TimeDelta& timeout_duration, | 65 const base::TimeDelta& timeout_duration, |
| 63 const scoped_refptr<TCPClientSocketPool>& tcp_pool, | 66 const scoped_refptr<TCPClientSocketPool>& tcp_pool, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 195 |
| 193 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); | 196 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); |
| 194 }; | 197 }; |
| 195 | 198 |
| 196 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, | 199 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, |
| 197 HttpProxySocketParams); | 200 HttpProxySocketParams); |
| 198 | 201 |
| 199 } // namespace net | 202 } // namespace net |
| 200 | 203 |
| 201 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 204 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |