Index: net/http/http_auth_handler_factory.cc |
diff --git a/net/http/http_auth_handler_factory.cc b/net/http/http_auth_handler_factory.cc |
index 90b29c7e76cef3cf0bc2d93a4d09629ebd4970fa..3eb412e573fbc8362b9c22ea7cdce01aa0dc25de 100644 |
--- a/net/http/http_auth_handler_factory.cc |
+++ b/net/http/http_auth_handler_factory.cc |
@@ -19,29 +19,6 @@ |
namespace net { |
-int HttpAuthHandlerFactory::CreateAuthHandlerFromString( |
- const std::string& challenge, |
- HttpAuth::Target target, |
- const GURL& origin, |
- const BoundNetLog& net_log, |
- scoped_ptr<HttpAuthHandler>* handler) { |
- HttpAuthChallengeTokenizer props(challenge.begin(), challenge.end()); |
- return CreateAuthHandler(props, target, origin, CREATE_CHALLENGE, 1, net_log, |
- handler); |
-} |
- |
-int HttpAuthHandlerFactory::CreatePreemptiveAuthHandlerFromString( |
- const std::string& challenge, |
- HttpAuth::Target target, |
- const GURL& origin, |
- int digest_nonce_count, |
- const BoundNetLog& net_log, |
- scoped_ptr<HttpAuthHandler>* handler) { |
- HttpAuthChallengeTokenizer props(challenge.begin(), challenge.end()); |
- return CreateAuthHandler(props, target, origin, CREATE_PREEMPTIVE, |
- digest_nonce_count, net_log, handler); |
-} |
- |
// static |
scoped_ptr<HttpAuthHandlerRegistryFactory> |
HttpAuthHandlerFactory::CreateDefault(HostResolver* host_resolver) { |
@@ -177,27 +154,29 @@ HttpAuthHandlerRegistryFactory* HttpAuthHandlerRegistryFactory::Create( |
return registry_factory; |
} |
-int HttpAuthHandlerRegistryFactory::CreateAuthHandler( |
- const HttpAuthChallengeTokenizer& challenge, |
+scoped_ptr<HttpAuthHandler> |
+HttpAuthHandlerRegistryFactory::CreateAuthHandlerForScheme( |
+ const std::string& scheme) { |
+ const auto it = factory_map_.find(scheme); |
+ if (it == factory_map_.end()) |
+ return scoped_ptr<HttpAuthHandler>(); |
+ DCHECK(it->second); |
+ return it->second->CreateAuthHandlerForScheme(scheme); |
+} |
+ |
+scoped_ptr<HttpAuthHandler> |
+HttpAuthHandlerRegistryFactory::CreateAndInitPreemptiveAuthHandler( |
+ HttpAuthCache::Entry* cache_entry, |
+ const HttpAuthChallengeTokenizer& tokenizer, |
HttpAuth::Target target, |
- const GURL& origin, |
- CreateReason reason, |
- int digest_nonce_count, |
- const BoundNetLog& net_log, |
- scoped_ptr<HttpAuthHandler>* handler) { |
- std::string scheme = challenge.NormalizedScheme(); |
- if (scheme.empty()) { |
- handler->reset(); |
- return ERR_INVALID_RESPONSE; |
- } |
- FactoryMap::iterator it = factory_map_.find(scheme); |
- if (it == factory_map_.end()) { |
- handler->reset(); |
- return ERR_UNSUPPORTED_AUTH_SCHEME; |
- } |
+ const BoundNetLog& net_log) { |
+ std::string scheme_name = cache_entry->scheme(); |
+ const auto it = factory_map_.find(scheme_name); |
+ if (it == factory_map_.end()) |
+ return scoped_ptr<HttpAuthHandler>(); |
DCHECK(it->second); |
- return it->second->CreateAuthHandler(challenge, target, origin, reason, |
- digest_nonce_count, net_log, handler); |
+ return it->second->CreateAndInitPreemptiveAuthHandler(cache_entry, tokenizer, |
+ target, net_log); |
} |
} // namespace net |