diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-07 14:17:14 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-07 14:17:14 +0000 |
commit | 36c8e5f7523eb31c11fce92246cdaca4e7af4f36 (patch) | |
tree | 117a4786075700fb0b86b843304964c694adf533 /net/socket_stream | |
parent | 7ec0cb21f022b28c20e6e44e5f38f9ed6bc13a16 (diff) | |
download | chromium_src-36c8e5f7523eb31c11fce92246cdaca4e7af4f36.zip chromium_src-36c8e5f7523eb31c11fce92246cdaca4e7af4f36.tar.gz chromium_src-36c8e5f7523eb31c11fce92246cdaca4e7af4f36.tar.bz2 |
HttpAuthHandler's are no longer refcounted.
Since HttpAuthHandler objects are no longer contained inside of the
HttpAuthCache, the lifetime of the handlers is more clearly defined.
TEST=net_unittests (including some changes)
BUG=42222
Review URL: http://codereview.chromium.org/2635004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49052 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream')
-rw-r--r-- | net/socket_stream/socket_stream.cc | 10 | ||||
-rw-r--r-- | net/socket_stream/socket_stream.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc index e9fe842..05c0bc9 100644 --- a/net/socket_stream/socket_stream.cc +++ b/net/socket_stream/socket_stream.cc @@ -190,7 +190,7 @@ void SocketStream::RestartWithAuth( "The current MessageLoop must exist"; DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << "The current MessageLoop must be TYPE_IO"; - DCHECK(auth_handler_); + DCHECK(auth_handler_.get()); if (!socket_.get()) { LOG(ERROR) << "Socket is closed before restarting with auth."; return; @@ -546,7 +546,7 @@ int SocketStream::DoWriteTunnelHeaders() { HttpAuthCache::Entry* entry = auth_cache_.LookupByPath( ProxyAuthOrigin(), std::string()); if (entry) { - scoped_refptr<HttpAuthHandler> handler_preemptive; + scoped_ptr<HttpAuthHandler> handler_preemptive; int rv_create = http_auth_handler_factory_-> CreatePreemptiveAuthHandlerFromString( entry->auth_challenge(), HttpAuth::AUTH_PROXY, @@ -557,7 +557,7 @@ int SocketStream::DoWriteTunnelHeaders() { auth_identity_.invalid = false; auth_identity_.username = entry->username(); auth_identity_.password = entry->password(); - auth_handler_ = handler_preemptive; + auth_handler_.swap(handler_preemptive); } } } @@ -884,7 +884,7 @@ int SocketStream::HandleAuthChallenge(const HttpResponseHeaders* headers) { auth_handler_->scheme(), auth_identity_.username, auth_identity_.password); - auth_handler_ = NULL; + auth_handler_.reset(); auth_identity_ = HttpAuth::Identity(); } @@ -892,7 +892,7 @@ int SocketStream::HandleAuthChallenge(const HttpResponseHeaders* headers) { HttpAuth::ChooseBestChallenge(http_auth_handler_factory_, headers, HttpAuth::AUTH_PROXY, auth_origin, net_log_, &auth_handler_); - if (!auth_handler_) { + if (!auth_handler_.get()) { LOG(ERROR) << "Can't perform auth to the proxy " << auth_origin; return ERR_TUNNEL_CONNECTION_FAILED; } diff --git a/net/socket_stream/socket_stream.h b/net/socket_stream/socket_stream.h index b56d08e..fcedc0d 100644 --- a/net/socket_stream/socket_stream.h +++ b/net/socket_stream/socket_stream.h @@ -280,7 +280,7 @@ class SocketStream : public base::RefCountedThreadSafe<SocketStream> { ProxyInfo proxy_info_; HttpAuthCache auth_cache_; - scoped_refptr<HttpAuthHandler> auth_handler_; + scoped_ptr<HttpAuthHandler> auth_handler_; HttpAuth::Identity auth_identity_; scoped_refptr<AuthChallengeInfo> auth_info_; |