diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 18:25:21 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 18:25:21 +0000 |
commit | df4b4ef3ac8829b20b07bca9161865ee4ab469eb (patch) | |
tree | 68fb5e575e67e8bbaff0d6ff9db4a14f7514c57f /net/http/http_proxy_client_socket_pool.h | |
parent | 9c6527c9d4d289ed4f62194cf116e071b9d49ac9 (diff) | |
download | chromium_src-df4b4ef3ac8829b20b07bca9161865ee4ab469eb.zip chromium_src-df4b4ef3ac8829b20b07bca9161865ee4ab469eb.tar.gz chromium_src-df4b4ef3ac8829b20b07bca9161865ee4ab469eb.tar.bz2 |
Make the various SocketParams reference counted.
This is so that the SSLSocketParam can hold one of any of the existing SocketParams.
BUG=30357
TEST=existing unit tests
Review URL: http://codereview.chromium.org/2848029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52107 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_proxy_client_socket_pool.h')
-rw-r--r-- | net/http/http_proxy_client_socket_pool.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/net/http/http_proxy_client_socket_pool.h b/net/http/http_proxy_client_socket_pool.h index dc85c32..7a40424 100644 --- a/net/http/http_proxy_client_socket_pool.h +++ b/net/http/http_proxy_client_socket_pool.h @@ -8,6 +8,7 @@ #include <string> #include "base/basictypes.h" +#include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "base/time.h" #include "net/base/host_port_pair.h" @@ -24,20 +25,16 @@ class ClientSocketFactory; class ConnectJobFactory; class HttpAuthController; -class HttpProxySocketParams { +class HttpProxySocketParams : public base::RefCounted<HttpProxySocketParams> { public: - HttpProxySocketParams(const TCPSocketParams& proxy_server, + HttpProxySocketParams(const scoped_refptr<TCPSocketParams>& proxy_server, const GURL& request_url, HostPortPair endpoint, scoped_refptr<HttpAuthController> auth_controller, - bool tunnel) - : tcp_params_(proxy_server), - request_url_(request_url), - endpoint_(endpoint), - auth_controller_(auth_controller), - tunnel_(tunnel) { - } + bool tunnel); - const TCPSocketParams& tcp_params() const { return tcp_params_; } + const scoped_refptr<TCPSocketParams>& tcp_params() const { + return tcp_params_; + } const GURL& request_url() const { return request_url_; } const HostPortPair& endpoint() const { return endpoint_; } const scoped_refptr<HttpAuthController>& auth_controller() const { @@ -46,7 +43,10 @@ class HttpProxySocketParams { bool tunnel() const { return tunnel_; } private: - const TCPSocketParams tcp_params_; + friend class base::RefCounted<HttpProxySocketParams>; + ~HttpProxySocketParams(); + + const scoped_refptr<TCPSocketParams> tcp_params_; const GURL request_url_; const HostPortPair endpoint_; const scoped_refptr<HttpAuthController> auth_controller_; @@ -58,7 +58,7 @@ class HttpProxySocketParams { class HttpProxyConnectJob : public ConnectJob { public: HttpProxyConnectJob(const std::string& group_name, - const HttpProxySocketParams& params, + const scoped_refptr<HttpProxySocketParams>& params, const base::TimeDelta& timeout_duration, const scoped_refptr<TCPClientSocketPool>& tcp_pool, const scoped_refptr<HostResolver> &host_resolver, @@ -97,7 +97,7 @@ class HttpProxyConnectJob : public ConnectJob { int DoHttpProxyConnect(); int DoHttpProxyConnectComplete(int result); - HttpProxySocketParams params_; + scoped_refptr<HttpProxySocketParams> params_; const scoped_refptr<TCPClientSocketPool> tcp_pool_; const scoped_refptr<HostResolver> resolver_; |