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

Unified Diff: net/http/http_proxy_client_socket_pool.h

Issue 3112034: Attempting to re-land CL 3110006 which turned out to have ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_proxy_client_socket_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_proxy_client_socket_pool.h
===================================================================
--- net/http/http_proxy_client_socket_pool.h (revision 57349)
+++ net/http/http_proxy_client_socket_pool.h (working copy)
@@ -22,12 +22,19 @@
class HostResolver;
class HttpNetworkSession;
+class SSLClientSocketPool;
+class SSLSocketParams;
class TCPClientSocketPool;
class TCPSocketParams;
+// HttpProxySocketParams only needs the socket params for one of the proxy
+// types. The other param must be NULL. When using an HTTP Proxy,
+// |tcp_params| must be set. When using an HTTPS Proxy, |ssl_params|
+// must be set.
class HttpProxySocketParams : public base::RefCounted<HttpProxySocketParams> {
public:
- HttpProxySocketParams(const scoped_refptr<TCPSocketParams>& proxy_server,
+ HttpProxySocketParams(const scoped_refptr<TCPSocketParams>& tcp_params,
+ const scoped_refptr<SSLSocketParams>& ssl_params,
const GURL& request_url,
const std::string& user_agent,
HostPortPair endpoint,
@@ -37,12 +44,16 @@
const scoped_refptr<TCPSocketParams>& tcp_params() const {
return tcp_params_;
}
+ const scoped_refptr<SSLSocketParams>& ssl_params() const {
+ return ssl_params_;
+ }
const GURL& request_url() const { return request_url_; }
const std::string& user_agent() const { return user_agent_; }
const HostPortPair& endpoint() const { return endpoint_; }
const scoped_refptr<HttpNetworkSession>& session() {
return session_;
}
+ const HostResolver::RequestInfo& destination() const;
bool tunnel() const { return tunnel_; }
private:
@@ -50,6 +61,7 @@
~HttpProxySocketParams();
const scoped_refptr<TCPSocketParams> tcp_params_;
+ const scoped_refptr<SSLSocketParams> ssl_params_;
const GURL request_url_;
const std::string user_agent_;
const HostPortPair endpoint_;
@@ -67,6 +79,7 @@
const scoped_refptr<HttpProxySocketParams>& params,
const base::TimeDelta& timeout_duration,
const scoped_refptr<TCPClientSocketPool>& tcp_pool,
+ const scoped_refptr<SSLClientSocketPool>& ssl_pool,
const scoped_refptr<HostResolver> &host_resolver,
Delegate* delegate,
NetLog* net_log);
@@ -79,6 +92,8 @@
enum State {
kStateTCPConnect,
kStateTCPConnectComplete,
+ kStateSSLConnect,
+ kStateSSLConnectComplete,
kStateHttpProxyConnect,
kStateHttpProxyConnectComplete,
kStateNone,
@@ -98,19 +113,25 @@
// Runs the state transition loop.
int DoLoop(int result);
+ // Connecting to HTTP Proxy
int DoTCPConnect();
int DoTCPConnectComplete(int result);
+ // Connecting to HTTPS Proxy
+ int DoSSLConnect();
+ int DoSSLConnectComplete(int result);
+
int DoHttpProxyConnect();
int DoHttpProxyConnectComplete(int result);
scoped_refptr<HttpProxySocketParams> params_;
const scoped_refptr<TCPClientSocketPool> tcp_pool_;
+ const scoped_refptr<SSLClientSocketPool> ssl_pool_;
const scoped_refptr<HostResolver> resolver_;
State next_state_;
CompletionCallbackImpl<HttpProxyConnectJob> callback_;
- scoped_ptr<ClientSocketHandle> tcp_socket_handle_;
- scoped_ptr<ClientSocket> socket_;
+ scoped_ptr<ClientSocketHandle> transport_socket_handle_;
+ scoped_ptr<ClientSocket> transport_socket_;
DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJob);
};
@@ -123,6 +144,7 @@
const scoped_refptr<ClientSocketPoolHistograms>& histograms,
const scoped_refptr<HostResolver>& host_resolver,
const scoped_refptr<TCPClientSocketPool>& tcp_pool,
+ const scoped_refptr<SSLClientSocketPool>& ssl_pool,
NetLog* net_log);
// ClientSocketPool methods:
@@ -171,25 +193,23 @@
public:
HttpProxyConnectJobFactory(
const scoped_refptr<TCPClientSocketPool>& tcp_pool,
+ const scoped_refptr<SSLClientSocketPool>& ssl_pool,
HostResolver* host_resolver,
- NetLog* net_log)
- : tcp_pool_(tcp_pool),
- host_resolver_(host_resolver),
- net_log_(net_log) {}
+ NetLog* net_log);
- virtual ~HttpProxyConnectJobFactory() {}
-
// ClientSocketPoolBase::ConnectJobFactory methods.
virtual ConnectJob* NewConnectJob(const std::string& group_name,
const PoolBase::Request& request,
ConnectJob::Delegate* delegate) const;
- virtual base::TimeDelta ConnectionTimeout() const;
+ virtual base::TimeDelta ConnectionTimeout() const { return timeout_; }
private:
const scoped_refptr<TCPClientSocketPool> tcp_pool_;
+ const scoped_refptr<SSLClientSocketPool> ssl_pool_;
const scoped_refptr<HostResolver> host_resolver_;
NetLog* net_log_;
+ base::TimeDelta timeout_;
DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJobFactory);
};
« no previous file with comments | « net/http/http_network_transaction_unittest.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