| Index: net/http/http_auth_handler_ntlm_win.cc
|
| diff --git a/net/http/http_auth_handler_ntlm_win.cc b/net/http/http_auth_handler_ntlm_win.cc
|
| index 4b58be46f446510ad722a2b1414705796d30cb90..ca4b1bdf5baae8be57007cebb5baaf468e4f02d9 100644
|
| --- a/net/http/http_auth_handler_ntlm_win.cc
|
| +++ b/net/http/http_auth_handler_ntlm_win.cc
|
| @@ -20,14 +20,14 @@
|
| namespace net {
|
|
|
| HttpAuthHandlerNTLM::HttpAuthHandlerNTLM(
|
| - SSPILibrary* sspi_library, ULONG max_token_length,
|
| + SSPILibrary* sspi_library,
|
| + ULONG max_token_length,
|
| URLSecurityManager* url_security_manager)
|
| - : auth_sspi_(sspi_library, "NTLM", NTLMSP_NAME, max_token_length),
|
| - url_security_manager_(url_security_manager) {
|
| -}
|
| + : HttpAuthHandler("ntlm"),
|
| + auth_sspi_(sspi_library, "NTLM", NTLMSP_NAME, max_token_length),
|
| + url_security_manager_(url_security_manager) {}
|
|
|
| -HttpAuthHandlerNTLM::~HttpAuthHandlerNTLM() {
|
| -}
|
| +HttpAuthHandlerNTLM::~HttpAuthHandlerNTLM() {}
|
|
|
| // Require identity on first pass instead of second.
|
| bool HttpAuthHandlerNTLM::NeedsIdentity() {
|
| @@ -50,34 +50,24 @@ HttpAuthHandlerNTLM::Factory::Factory()
|
| HttpAuthHandlerNTLM::Factory::~Factory() {
|
| }
|
|
|
| -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 (is_unsupported_ || reason == CREATE_PREEMPTIVE)
|
| - return ERR_UNSUPPORTED_AUTH_SCHEME;
|
| +scoped_ptr<HttpAuthHandler>
|
| +HttpAuthHandlerNTLM::Factory::CreateAuthHandlerForScheme(
|
| + const std::string& scheme) {
|
| + DCHECK(HttpAuth::IsValidNormalizedScheme(scheme));
|
| + if (scheme != "ntlm" || is_unsupported_)
|
| + return scoped_ptr<HttpAuthHandler>();
|
| if (max_token_length_ == 0) {
|
| int rv = DetermineMaxTokenLength(sspi_library_.get(), NTLMSP_NAME,
|
| &max_token_length_);
|
| if (rv == ERR_UNSUPPORTED_AUTH_SCHEME)
|
| is_unsupported_ = true;
|
| if (rv != OK)
|
| - return rv;
|
| + return scoped_ptr<HttpAuthHandler>();
|
| }
|
| // TODO(cbentzel): Move towards model of parsing in the factory
|
| // method and only constructing when valid.
|
| - scoped_ptr<HttpAuthHandler> tmp_handler(
|
| - new HttpAuthHandlerNTLM(sspi_library_.get(), max_token_length_,
|
| - url_security_manager()));
|
| - int result =
|
| - tmp_handler->HandleInitialChallenge(challenge, target, origin, net_log);
|
| - if (result == OK)
|
| - handler->swap(tmp_handler);
|
| - return result;
|
| + return make_scoped_ptr(new HttpAuthHandlerNTLM(
|
| + sspi_library_.get(), max_token_length_, url_security_manager()));
|
| }
|
|
|
| } // namespace net
|
|
|