Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: net/http/http_proxy_client_socket_pool.h

Issue 517693002: Add embedder-specific headers to HTTP CONNECT tunnel request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reworked HaveAuth test Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_proxy_client_socket.cc ('k') | net/http/http_proxy_client_socket_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_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"
(...skipping 10 matching lines...) Expand all
21 #include "net/socket/client_socket_pool_base.h" 21 #include "net/socket/client_socket_pool_base.h"
22 #include "net/socket/client_socket_pool_histograms.h" 22 #include "net/socket/client_socket_pool_histograms.h"
23 #include "net/socket/ssl_client_socket.h" 23 #include "net/socket/ssl_client_socket.h"
24 #include "net/spdy/spdy_session.h" 24 #include "net/spdy/spdy_session.h"
25 25
26 namespace net { 26 namespace net {
27 27
28 class HostResolver; 28 class HostResolver;
29 class HttpAuthCache; 29 class HttpAuthCache;
30 class HttpAuthHandlerFactory; 30 class HttpAuthHandlerFactory;
31 class ProxyDelegate;
31 class SSLClientSocketPool; 32 class SSLClientSocketPool;
32 class SSLSocketParams; 33 class SSLSocketParams;
33 class SpdySessionPool; 34 class SpdySessionPool;
34 class SpdyStream; 35 class SpdyStream;
35 class TransportClientSocketPool; 36 class TransportClientSocketPool;
36 class TransportSocketParams; 37 class TransportSocketParams;
37 38
38 // HttpProxySocketParams only needs the socket params for one of the proxy 39 // HttpProxySocketParams only needs the socket params for one of the proxy
39 // types. The other param must be NULL. When using an HTTP Proxy, 40 // types. The other param must be NULL. When using an HTTP Proxy,
40 // |transport_params| must be set. When using an HTTPS Proxy, |ssl_params| 41 // |transport_params| must be set. When using an HTTPS Proxy, |ssl_params|
41 // must be set. 42 // must be set.
42 class NET_EXPORT_PRIVATE HttpProxySocketParams 43 class NET_EXPORT_PRIVATE HttpProxySocketParams
43 : public base::RefCounted<HttpProxySocketParams> { 44 : public base::RefCounted<HttpProxySocketParams> {
44 public: 45 public:
45 HttpProxySocketParams( 46 HttpProxySocketParams(
46 const scoped_refptr<TransportSocketParams>& transport_params, 47 const scoped_refptr<TransportSocketParams>& transport_params,
47 const scoped_refptr<SSLSocketParams>& ssl_params, 48 const scoped_refptr<SSLSocketParams>& ssl_params,
48 const GURL& request_url, 49 const GURL& request_url,
49 const std::string& user_agent, 50 const std::string& user_agent,
50 const HostPortPair& endpoint, 51 const HostPortPair& endpoint,
51 HttpAuthCache* http_auth_cache, 52 HttpAuthCache* http_auth_cache,
52 HttpAuthHandlerFactory* http_auth_handler_factory, 53 HttpAuthHandlerFactory* http_auth_handler_factory,
53 SpdySessionPool* spdy_session_pool, 54 SpdySessionPool* spdy_session_pool,
54 bool tunnel); 55 bool tunnel,
56 ProxyDelegate* proxy_delegate);
55 57
56 const scoped_refptr<TransportSocketParams>& transport_params() const { 58 const scoped_refptr<TransportSocketParams>& transport_params() const {
57 return transport_params_; 59 return transport_params_;
58 } 60 }
59 const scoped_refptr<SSLSocketParams>& ssl_params() const { 61 const scoped_refptr<SSLSocketParams>& ssl_params() const {
60 return ssl_params_; 62 return ssl_params_;
61 } 63 }
62 const GURL& request_url() const { return request_url_; } 64 const GURL& request_url() const { return request_url_; }
63 const std::string& user_agent() const { return user_agent_; } 65 const std::string& user_agent() const { return user_agent_; }
64 const HostPortPair& endpoint() const { return endpoint_; } 66 const HostPortPair& endpoint() const { return endpoint_; }
65 HttpAuthCache* http_auth_cache() const { return http_auth_cache_; } 67 HttpAuthCache* http_auth_cache() const { return http_auth_cache_; }
66 HttpAuthHandlerFactory* http_auth_handler_factory() const { 68 HttpAuthHandlerFactory* http_auth_handler_factory() const {
67 return http_auth_handler_factory_; 69 return http_auth_handler_factory_;
68 } 70 }
69 SpdySessionPool* spdy_session_pool() { 71 SpdySessionPool* spdy_session_pool() {
70 return spdy_session_pool_; 72 return spdy_session_pool_;
71 } 73 }
72 const HostResolver::RequestInfo& destination() const; 74 const HostResolver::RequestInfo& destination() const;
73 bool tunnel() const { return tunnel_; } 75 bool tunnel() const { return tunnel_; }
74 bool ignore_limits() const { return ignore_limits_; } 76 bool ignore_limits() const { return ignore_limits_; }
75 77
78 ProxyDelegate* proxy_delegate() const {
79 return proxy_delegate_;
80 }
81
76 private: 82 private:
77 friend class base::RefCounted<HttpProxySocketParams>; 83 friend class base::RefCounted<HttpProxySocketParams>;
78 ~HttpProxySocketParams(); 84 ~HttpProxySocketParams();
79 85
80 const scoped_refptr<TransportSocketParams> transport_params_; 86 const scoped_refptr<TransportSocketParams> transport_params_;
81 const scoped_refptr<SSLSocketParams> ssl_params_; 87 const scoped_refptr<SSLSocketParams> ssl_params_;
82 SpdySessionPool* spdy_session_pool_; 88 SpdySessionPool* spdy_session_pool_;
83 const GURL request_url_; 89 const GURL request_url_;
84 const std::string user_agent_; 90 const std::string user_agent_;
85 const HostPortPair endpoint_; 91 const HostPortPair endpoint_;
86 HttpAuthCache* const http_auth_cache_; 92 HttpAuthCache* const http_auth_cache_;
87 HttpAuthHandlerFactory* const http_auth_handler_factory_; 93 HttpAuthHandlerFactory* const http_auth_handler_factory_;
88 const bool tunnel_; 94 const bool tunnel_;
89 bool ignore_limits_; 95 bool ignore_limits_;
96 ProxyDelegate* proxy_delegate_;
90 97
91 DISALLOW_COPY_AND_ASSIGN(HttpProxySocketParams); 98 DISALLOW_COPY_AND_ASSIGN(HttpProxySocketParams);
92 }; 99 };
93 100
94 // HttpProxyConnectJob optionally establishes a tunnel through the proxy 101 // HttpProxyConnectJob optionally establishes a tunnel through the proxy
95 // server after connecting the underlying transport socket. 102 // server after connecting the underlying transport socket.
96 class HttpProxyConnectJob : public ConnectJob { 103 class HttpProxyConnectJob : public ConnectJob {
97 public: 104 public:
98 HttpProxyConnectJob(const std::string& group_name, 105 HttpProxyConnectJob(const std::string& group_name,
99 RequestPriority priority, 106 RequestPriority priority,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 public: 187 public:
181 typedef HttpProxySocketParams SocketParams; 188 typedef HttpProxySocketParams SocketParams;
182 189
183 HttpProxyClientSocketPool( 190 HttpProxyClientSocketPool(
184 int max_sockets, 191 int max_sockets,
185 int max_sockets_per_group, 192 int max_sockets_per_group,
186 ClientSocketPoolHistograms* histograms, 193 ClientSocketPoolHistograms* histograms,
187 HostResolver* host_resolver, 194 HostResolver* host_resolver,
188 TransportClientSocketPool* transport_pool, 195 TransportClientSocketPool* transport_pool,
189 SSLClientSocketPool* ssl_pool, 196 SSLClientSocketPool* ssl_pool,
197 const ProxyDelegate* proxy_delegate,
190 NetLog* net_log); 198 NetLog* net_log);
191 199
192 virtual ~HttpProxyClientSocketPool(); 200 virtual ~HttpProxyClientSocketPool();
193 201
194 // ClientSocketPool implementation. 202 // ClientSocketPool implementation.
195 virtual int RequestSocket(const std::string& group_name, 203 virtual int RequestSocket(const std::string& group_name,
196 const void* connect_params, 204 const void* connect_params,
197 RequestPriority priority, 205 RequestPriority priority,
198 ClientSocketHandle* handle, 206 ClientSocketHandle* handle,
199 const CompletionCallback& callback, 207 const CompletionCallback& callback,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 253
246 private: 254 private:
247 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase; 255 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase;
248 256
249 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory { 257 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory {
250 public: 258 public:
251 HttpProxyConnectJobFactory( 259 HttpProxyConnectJobFactory(
252 TransportClientSocketPool* transport_pool, 260 TransportClientSocketPool* transport_pool,
253 SSLClientSocketPool* ssl_pool, 261 SSLClientSocketPool* ssl_pool,
254 HostResolver* host_resolver, 262 HostResolver* host_resolver,
263 const ProxyDelegate* proxy_delegate,
255 NetLog* net_log); 264 NetLog* net_log);
256 265
257 // ClientSocketPoolBase::ConnectJobFactory methods. 266 // ClientSocketPoolBase::ConnectJobFactory methods.
258 virtual scoped_ptr<ConnectJob> NewConnectJob( 267 virtual scoped_ptr<ConnectJob> NewConnectJob(
259 const std::string& group_name, 268 const std::string& group_name,
260 const PoolBase::Request& request, 269 const PoolBase::Request& request,
261 ConnectJob::Delegate* delegate) const OVERRIDE; 270 ConnectJob::Delegate* delegate) const OVERRIDE;
262 271
263 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE; 272 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
264 273
265 private: 274 private:
266 TransportClientSocketPool* const transport_pool_; 275 TransportClientSocketPool* const transport_pool_;
267 SSLClientSocketPool* const ssl_pool_; 276 SSLClientSocketPool* const ssl_pool_;
268 HostResolver* const host_resolver_; 277 HostResolver* const host_resolver_;
278 const ProxyDelegate* proxy_delegate_;
269 NetLog* net_log_; 279 NetLog* net_log_;
270 base::TimeDelta timeout_; 280 base::TimeDelta timeout_;
271 281
272 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJobFactory); 282 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJobFactory);
273 }; 283 };
274 284
275 TransportClientSocketPool* const transport_pool_; 285 TransportClientSocketPool* const transport_pool_;
276 SSLClientSocketPool* const ssl_pool_; 286 SSLClientSocketPool* const ssl_pool_;
277 PoolBase base_; 287 PoolBase base_;
278 288
279 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); 289 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool);
280 }; 290 };
281 291
282 } // namespace net 292 } // namespace net
283 293
284 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ 294 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket.cc ('k') | net/http/http_proxy_client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698