From 4d6a6d9441faebcb32e47a7e834b265d11227397 Mon Sep 17 00:00:00 2001 From: "cbentzel@chromium.org" Date: Tue, 28 Sep 2010 16:22:01 +0000 Subject: Revert 60791 - HttpAuthHandlerFactory::CreateDefault requires a HostResolver argument. Previously the default registry factory would crash if it saw a Negotiate header when trying to do a CNAME lookup because of a NULL resolver. Since then I've changed HttpAuthHandlerNegotiate to skip the CNAME lookup step when the resolver_ is NULL. So, one option is to make CreateDefault accept an optional HostResolver argument. My concern is that since passing in NULL is the easier choice, people will do it and encounter user problems when going through a Negotiate proxy. Hence, I force the correct behavior. BUG=56819 TEST=net_unittests, try fetch client through a Negotiate authenticating proxy. Review URL: http://codereview.chromium.org/3447027 TBR=cbentzel@chromium.org Review URL: http://codereview.chromium.org/3413039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60795 0039d316-1c4b-4281-b951-d872f2087c98 --- net/http/http_auth_handler_factory.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to '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 4ad7fe8..c9e0fb9 100644 --- a/net/http/http_auth_handler_factory.cc +++ b/net/http/http_auth_handler_factory.cc @@ -39,19 +39,15 @@ int HttpAuthHandlerFactory::CreatePreemptiveAuthHandlerFromString( } // static -HttpAuthHandlerRegistryFactory* HttpAuthHandlerFactory::CreateDefault( - HostResolver* host_resolver) { - DCHECK(host_resolver); +HttpAuthHandlerRegistryFactory* HttpAuthHandlerFactory::CreateDefault() { HttpAuthHandlerRegistryFactory* registry_factory = new HttpAuthHandlerRegistryFactory(); registry_factory->RegisterSchemeFactory( "basic", new HttpAuthHandlerBasic::Factory()); registry_factory->RegisterSchemeFactory( "digest", new HttpAuthHandlerDigest::Factory()); - HttpAuthHandlerNegotiate::Factory* negotiate_factory = - new HttpAuthHandlerNegotiate::Factory(); - negotiate_factory->set_host_resolver(host_resolver); - registry_factory->RegisterSchemeFactory("negotiate", negotiate_factory); + registry_factory->RegisterSchemeFactory( + "negotiate", new HttpAuthHandlerNegotiate::Factory()); registry_factory->RegisterSchemeFactory( "ntlm", new HttpAuthHandlerNTLM::Factory()); return registry_factory; @@ -93,7 +89,7 @@ HttpAuthHandlerRegistryFactory* HttpAuthHandlerRegistryFactory::Create( HttpAuthHandlerNegotiate::Factory* negotiate_factory = new HttpAuthHandlerNegotiate::Factory(); negotiate_factory->set_url_security_manager(security_manager); - DCHECK(host_resolver || negotiate_disable_cname_lookup); + DCHECK(host_resolver != NULL || negotiate_disable_cname_lookup); negotiate_factory->set_host_resolver(host_resolver); negotiate_factory->set_disable_cname_lookup(negotiate_disable_cname_lookup); negotiate_factory->set_use_port(negotiate_enable_port); -- cgit v1.1