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