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

Unified Diff: net/http/http_auth_handler_digest.cc

Issue 1391053002: [net/http auth] Make HttpAuthHandler challenge handling asynchronous. Base URL: https://chromium.googlesource.com/chromium/src.git@auth-handler-init-split
Patch Set: Created 5 years, 2 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_auth_handler_digest.h ('k') | net/http/http_auth_handler_digest_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_digest.cc
diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc
index 8c8787f6500502a868c8514754cdd062c90e8cb3..b31fa5a7100581b2784550dcc36f9e0b81a354c3 100644
--- a/net/http/http_auth_handler_digest.cc
+++ b/net/http/http_auth_handler_digest.cc
@@ -106,7 +106,17 @@ HttpAuth::AuthorizationResult HttpAuthHandlerDigest::HandleAnotherChallenge(
HttpAuth::AUTHORIZATION_RESULT_REJECT;
}
-int HttpAuthHandlerDigest::Init(const HttpAuthChallengeTokenizer& challenge) {
+int HttpAuthHandlerDigest::InitializeFromChallengeInternal(
+ const HttpAuthChallengeTokenizer& challenge,
+ const HttpResponseInfo&,
+ const CompletionCallback&) {
+ return ParseChallenge(challenge) ? OK : ERR_INVALID_RESPONSE;
+}
+
+int HttpAuthHandlerDigest::InitializeFromCacheEntryInternal(
+ HttpAuthCache::Entry* cache_entry) {
+ HttpAuthChallengeTokenizer challenge(cache_entry->auth_challenge().begin(),
+ cache_entry->auth_challenge().end());
return ParseChallenge(challenge) ? OK : ERR_INVALID_RESPONSE;
}
@@ -372,15 +382,13 @@ HttpAuthHandlerDigest::Factory::CreateAuthHandlerForScheme(
scoped_ptr<HttpAuthHandler>
HttpAuthHandlerDigest::Factory::CreateAndInitPreemptiveAuthHandler(
HttpAuthCache::Entry* cache_entry,
- const HttpAuthChallengeTokenizer& tokenizer,
HttpAuth::Target target,
const BoundNetLog& net_log) {
if (cache_entry->scheme() != kDigestSchemeName)
return scoped_ptr<HttpAuthHandler>();
scoped_ptr<HttpAuthHandler> handler(new HttpAuthHandlerDigest(
cache_entry->IncrementNonceCount(), nonce_generator_.get()));
- int rv = handler->HandleInitialChallenge(tokenizer, target,
- cache_entry->origin(), net_log);
+ int rv = handler->InitializeFromCacheEntry(cache_entry, target, net_log);
if (rv == OK)
return handler;
return scoped_ptr<HttpAuthHandler>();
« no previous file with comments | « net/http/http_auth_handler_digest.h ('k') | net/http/http_auth_handler_digest_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698