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

Unified Diff: net/http/http_auth_handler_ntlm_portable.cc

Issue 1393693002: [net/http auth] Split HttpAuthHandler creation from initialization. Base URL: https://chromium.googlesource.com/chromium/src.git@rename-auth-handler-methods
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_ntlm.cc ('k') | net/http/http_auth_handler_ntlm_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_ntlm_portable.cc
diff --git a/net/http/http_auth_handler_ntlm_portable.cc b/net/http/http_auth_handler_ntlm_portable.cc
index 5bc03877af32be911e437337c9b2075cb8610adf..5a1d82ec86666db4faf82cac8d433cf2c91c6e83 100644
--- a/net/http/http_auth_handler_ntlm_portable.cc
+++ b/net/http/http_auth_handler_ntlm_portable.cc
@@ -635,8 +635,7 @@ HttpAuthHandlerNTLM::generate_random_proc_ = GenerateRandom;
HttpAuthHandlerNTLM::HostNameProc
HttpAuthHandlerNTLM::get_host_name_proc_ = GetHostName;
-HttpAuthHandlerNTLM::HttpAuthHandlerNTLM() {
-}
+HttpAuthHandlerNTLM::HttpAuthHandlerNTLM() : HttpAuthHandler("ntlm") {}
bool HttpAuthHandlerNTLM::NeedsIdentity() {
// This gets called for each round-trip. Only require identity on
@@ -710,26 +709,16 @@ int HttpAuthHandlerNTLM::GetNextToken(const void* in_token,
return rv;
}
-int HttpAuthHandlerNTLM::Factory::CreateAuthHandler(
- const HttpAuthChallengeTokenizer& challenge,
- HttpAuth::Target target,
- const GURL& origin,
- CreateReason reason,
- int digest_nonce_count,
- const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) {
- if (reason == CREATE_PREEMPTIVE)
- return ERR_UNSUPPORTED_AUTH_SCHEME;
- // TODO(cbentzel): Move towards model of parsing in the factory
- // method and only constructing when valid.
- // NOTE: Default credentials are not supported for the portable implementation
- // of NTLM.
- scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM);
- int result =
- tmp_handler->HandleInitialChallenge(challenge, target, origin, net_log);
- if (result == OK)
- handler->swap(tmp_handler);
- return result;
+scoped_ptr<HttpAuthHandler>
+HttpAuthHandlerNTLM::Factory::CreateAuthHandlerForScheme(
+ const std::string& scheme) {
+ DCHECK(HttpAuth::IsValidNormalizedScheme(scheme));
+ if (scheme != "ntlm")
+ return scoped_ptr<HttpAuthHandler>();
+ // TODO(cbentzel): Move towards model of parsing in the factory method and
+ // only constructing when valid. NOTE: Default credentials are not supported
+ // for the portable implementation of NTLM.
+ return make_scoped_ptr(new HttpAuthHandlerNTLM);
}
} // namespace net
« no previous file with comments | « net/http/http_auth_handler_ntlm.cc ('k') | net/http/http_auth_handler_ntlm_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698