diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 01:14:52 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 01:14:52 +0000 |
commit | 6ecf2b9599dca0403a485cbf56bf6c9763681148 (patch) | |
tree | d8c108a197067ff7d9af24c19a52dfcc6ee4f926 /jingle | |
parent | bbf8a1c1044f290dea937d6fb53170fbbba0f899 (diff) | |
download | chromium_src-6ecf2b9599dca0403a485cbf56bf6c9763681148.zip chromium_src-6ecf2b9599dca0403a485cbf56bf6c9763681148.tar.gz chromium_src-6ecf2b9599dca0403a485cbf56bf6c9763681148.tar.bz2 |
base::Bind: Convert proxy_resolving_client_socket.[cc,h] and deps.
BUG=none
TEST=none
R=csilv
Review URL: http://codereview.chromium.org/8898036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r-- | jingle/notifier/base/proxy_resolving_client_socket.cc | 25 | ||||
-rw-r--r-- | jingle/notifier/base/proxy_resolving_client_socket.h | 5 |
2 files changed, 13 insertions, 17 deletions
diff --git a/jingle/notifier/base/proxy_resolving_client_socket.cc b/jingle/notifier/base/proxy_resolving_client_socket.cc index 6314bb2..6b6341a 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.cc +++ b/jingle/notifier/base/proxy_resolving_client_socket.cc @@ -6,6 +6,7 @@ #include "base/basictypes.h" #include "base/bind.h" +#include "base/bind_helpers.h" #include "base/compiler_specific.h" #include "base/logging.h" #include "googleurl/src/gurl.h" @@ -24,10 +25,12 @@ ProxyResolvingClientSocket::ProxyResolvingClientSocket( const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, const net::SSLConfig& ssl_config, const net::HostPortPair& dest_host_port_pair) - : proxy_resolve_callback_(ALLOW_THIS_IN_INITIALIZER_LIST(this), - &ProxyResolvingClientSocket::ProcessProxyResolveDone), - connect_callback_(ALLOW_THIS_IN_INITIALIZER_LIST(this), - &ProxyResolvingClientSocket::ProcessConnectDone), + : ALLOW_THIS_IN_INITIALIZER_LIST(proxy_resolve_callback_( + base::Bind(&ProxyResolvingClientSocket::ProcessProxyResolveDone, + base::Unretained(this)))), + ALLOW_THIS_IN_INITIALIZER_LIST(connect_callback_( + base::Bind(&ProxyResolvingClientSocket::ProcessConnectDone, + base::Unretained(this)))), ssl_config_(ssl_config), pac_request_(NULL), dest_host_port_pair_(dest_host_port_pair), @@ -109,7 +112,7 @@ int ProxyResolvingClientSocket::Connect( int status = network_session_->proxy_service()->ResolveProxy( url, &proxy_info_, - &proxy_resolve_callback_, + proxy_resolve_callback_, &pac_request_, bound_net_log_); if (status != net::ERR_IO_PENDING) { @@ -169,14 +172,8 @@ void ProxyResolvingClientSocket::ProcessProxyResolveDone(int status) { transport_.reset(new net::ClientSocketHandle); // Now that we have resolved the proxy, we need to connect. status = net::InitSocketHandleForRawConnect( - dest_host_port_pair_, - network_session_.get(), - proxy_info_, - ssl_config_, - ssl_config_, - bound_net_log_, - transport_.get(), - &connect_callback_); + dest_host_port_pair_, network_session_.get(), proxy_info_, ssl_config_, + ssl_config_, bound_net_log_, transport_.get(), connect_callback_); if (status != net::ERR_IO_PENDING) { // Since this method is always called asynchronously. it is OK to call // ProcessConnectDone synchronously. @@ -254,7 +251,7 @@ int ProxyResolvingClientSocket::ReconsiderProxyAfterError(int error) { GURL url("http://" + dest_host_port_pair_.ToString()); int rv = network_session_->proxy_service()->ReconsiderProxyAfterError( - url, &proxy_info_, &proxy_resolve_callback_, &pac_request_, + url, &proxy_info_, proxy_resolve_callback_, &pac_request_, bound_net_log_); if (rv == net::OK || rv == net::ERR_IO_PENDING) { CloseTransportSocket(); diff --git a/jingle/notifier/base/proxy_resolving_client_socket.h b/jingle/notifier/base/proxy_resolving_client_socket.h index 68aa718..c89d77b 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.h +++ b/jingle/notifier/base/proxy_resolving_client_socket.h @@ -77,9 +77,8 @@ class ProxyResolvingClientSocket : public net::StreamSocket { void ReportSuccessfulProxyConnection(); // Callbacks passed to net APIs. - net::OldCompletionCallbackImpl<ProxyResolvingClientSocket> - proxy_resolve_callback_; - net::OldCompletionCallbackImpl<ProxyResolvingClientSocket> connect_callback_; + net::CompletionCallback proxy_resolve_callback_; + net::CompletionCallback connect_callback_; scoped_refptr<net::HttpNetworkSession> network_session_; |