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/http/http_auth.cc | |
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/http/http_auth.cc')
-rw-r--r-- | net/http/http_auth.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/http/http_auth.cc b/net/http/http_auth.cc index e63afcd..09214e4 100644 --- a/net/http/http_auth.cc +++ b/net/http/http_auth.cc @@ -25,12 +25,12 @@ void HttpAuth::ChooseBestChallenge( Target target, const GURL& origin, const BoundNetLog& net_log, - scoped_refptr<HttpAuthHandler>* handler) { + scoped_ptr<HttpAuthHandler>* handler) { DCHECK(http_auth_handler_factory); // A connection-based authentication scheme must continue to use the // existing handler object in |*handler|. - if (*handler && (*handler)->is_connection_based()) { + if (handler->get() && (*handler)->is_connection_based()) { const std::string header_name = GetChallengeHeaderName(target); std::string challenge; void* iter = NULL; @@ -43,12 +43,12 @@ void HttpAuth::ChooseBestChallenge( } // Choose the challenge whose authentication handler gives the maximum score. - scoped_refptr<HttpAuthHandler> best; + scoped_ptr<HttpAuthHandler> best; const std::string header_name = GetChallengeHeaderName(target); std::string cur_challenge; void* iter = NULL; while (headers->EnumerateHeader(&iter, header_name, &cur_challenge)) { - scoped_refptr<HttpAuthHandler> cur; + scoped_ptr<HttpAuthHandler> cur; int rv = http_auth_handler_factory->CreateAuthHandlerFromString( cur_challenge, target, origin, net_log, &cur); if (rv != OK) { @@ -56,7 +56,7 @@ void HttpAuth::ChooseBestChallenge( << ErrorToString(rv) << " Challenge: " << cur_challenge; continue; } - if (cur && (!best || best->score() < cur->score())) + if (cur.get() && (!best.get() || best->score() < cur->score())) best.swap(cur); } handler->swap(best); |