| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "net/base/host_port_pair.h" | 15 #include "net/base/host_port_pair.h" |
| 16 #include "net/base/host_resolver.h" | 16 #include "net/base/host_resolver.h" |
| 17 #include "net/http/http_auth.h" | 17 #include "net/http/http_auth.h" |
| 18 #include "net/proxy/proxy_server.h" | 18 #include "net/proxy/proxy_server.h" |
| 19 #include "net/socket/client_socket_pool_base.h" | 19 #include "net/socket/client_socket_pool_base.h" |
| 20 #include "net/socket/client_socket_pool_histograms.h" | 20 #include "net/socket/client_socket_pool_histograms.h" |
| 21 #include "net/socket/client_socket_pool.h" | 21 #include "net/socket/client_socket_pool.h" |
| 22 #include "net/socket/tcp_client_socket_pool.h" | 22 #include "net/socket/tcp_client_socket_pool.h" |
| 23 | 23 |
| 24 namespace net { | 24 namespace net { |
| 25 | 25 |
| 26 class ClientSocketFactory; | 26 class ClientSocketFactory; |
| 27 class ConnectJobFactory; | 27 class ConnectJobFactory; |
| 28 class HttpAuthController; | 28 class HttpAuthController; |
| 29 class HttpNetworkSession; | |
| 30 | 29 |
| 31 class HttpProxySocketParams : public base::RefCounted<HttpProxySocketParams> { | 30 class HttpProxySocketParams : public base::RefCounted<HttpProxySocketParams> { |
| 32 public: | 31 public: |
| 33 HttpProxySocketParams(const scoped_refptr<TCPSocketParams>& proxy_server, | 32 HttpProxySocketParams(const scoped_refptr<TCPSocketParams>& proxy_server, |
| 34 const GURL& request_url, HostPortPair endpoint, | 33 const GURL& request_url, HostPortPair endpoint, |
| 35 scoped_refptr<HttpNetworkSession> session, | 34 scoped_refptr<HttpAuthController> auth_controller, |
| 36 bool tunnel); | 35 bool tunnel); |
| 37 | 36 |
| 38 const scoped_refptr<TCPSocketParams>& tcp_params() const { | 37 const scoped_refptr<TCPSocketParams>& tcp_params() const { |
| 39 return tcp_params_; | 38 return tcp_params_; |
| 40 } | 39 } |
| 41 const GURL& request_url() const { return request_url_; } | 40 const GURL& request_url() const { return request_url_; } |
| 42 const HostPortPair& endpoint() const { return endpoint_; } | 41 const HostPortPair& endpoint() const { return endpoint_; } |
| 43 const scoped_refptr<HttpNetworkSession>& session() { | 42 const scoped_refptr<HttpAuthController>& auth_controller() { |
| 44 return session_; | 43 return auth_controller_; |
| 45 } | 44 } |
| 46 bool tunnel() const { return tunnel_; } | 45 bool tunnel() const { return tunnel_; } |
| 47 | 46 |
| 48 private: | 47 private: |
| 49 friend class base::RefCounted<HttpProxySocketParams>; | 48 friend class base::RefCounted<HttpProxySocketParams>; |
| 50 ~HttpProxySocketParams(); | 49 ~HttpProxySocketParams(); |
| 51 | 50 |
| 52 const scoped_refptr<TCPSocketParams> tcp_params_; | 51 const scoped_refptr<TCPSocketParams> tcp_params_; |
| 53 const GURL request_url_; | 52 const GURL request_url_; |
| 54 const HostPortPair endpoint_; | 53 const HostPortPair endpoint_; |
| 55 const scoped_refptr<HttpNetworkSession> session_; | 54 const scoped_refptr<HttpAuthController> auth_controller_; |
| 56 const bool tunnel_; | 55 const bool tunnel_; |
| 57 | 56 |
| 58 DISALLOW_COPY_AND_ASSIGN(HttpProxySocketParams); | 57 DISALLOW_COPY_AND_ASSIGN(HttpProxySocketParams); |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 // HttpProxyConnectJob optionally establishes a tunnel through the proxy | 60 // HttpProxyConnectJob optionally establishes a tunnel through the proxy |
| 62 // server after connecting the underlying transport socket. | 61 // server after connecting the underlying transport socket. |
| 63 class HttpProxyConnectJob : public ConnectJob { | 62 class HttpProxyConnectJob : public ConnectJob { |
| 64 public: | 63 public: |
| 65 HttpProxyConnectJob(const std::string& group_name, | 64 HttpProxyConnectJob(const std::string& group_name, |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 196 |
| 198 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); | 197 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); |
| 199 }; | 198 }; |
| 200 | 199 |
| 201 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, | 200 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, |
| 202 HttpProxySocketParams); | 201 HttpProxySocketParams); |
| 203 | 202 |
| 204 } // namespace net | 203 } // namespace net |
| 205 | 204 |
| 206 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 205 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |