Chromium Code Reviews| 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 5a89964a80c6d47344e6ab2daa747a92b30b3305..22d8412ed05fbbfa81c1fd9f814c91ffd92cd646 100644 |
| --- a/net/http/http_auth_handler_factory.cc |
| +++ b/net/http/http_auth_handler_factory.cc |
| @@ -130,12 +130,8 @@ HttpAuthHandlerFactory* HttpAuthHandlerRegistryFactory::GetSchemeFactory( |
| // static |
| HttpAuthHandlerRegistryFactory* HttpAuthHandlerRegistryFactory::Create( |
| const std::vector<std::string>& supported_schemes, |
| - URLSecurityManager* security_manager, |
| HostResolver* host_resolver, |
| - const std::string& gssapi_library_name, |
| - const std::string& auth_android_negotiate_account_type, |
| - bool negotiate_disable_cname_lookup, |
| - bool negotiate_enable_port) { |
| + const std::string& gssapi_library_name) { |
| HttpAuthHandlerRegistryFactory* registry_factory = |
| new HttpAuthHandlerRegistryFactory(); |
| if (IsSupportedScheme(supported_schemes, "basic")) |
| @@ -147,7 +143,6 @@ HttpAuthHandlerRegistryFactory* HttpAuthHandlerRegistryFactory::Create( |
| if (IsSupportedScheme(supported_schemes, "ntlm")) { |
| HttpAuthHandlerNTLM::Factory* ntlm_factory = |
| new HttpAuthHandlerNTLM::Factory(); |
| - ntlm_factory->set_url_security_manager(security_manager); |
| #if defined(OS_WIN) |
| ntlm_factory->set_sspi_library(new SSPILibraryDefault()); |
| #endif |
| @@ -157,19 +152,13 @@ HttpAuthHandlerRegistryFactory* HttpAuthHandlerRegistryFactory::Create( |
| if (IsSupportedScheme(supported_schemes, "negotiate")) { |
| HttpAuthHandlerNegotiate::Factory* negotiate_factory = |
| new HttpAuthHandlerNegotiate::Factory(); |
| -#if defined(OS_ANDROID) |
| - negotiate_factory->set_library(&auth_android_negotiate_account_type); |
| -#elif defined(OS_POSIX) |
| +#if defined(OS_POSIX) && !defined(OS_ANDROID) |
| negotiate_factory->set_library( |
| new GSSAPISharedLibrary(gssapi_library_name)); |
| #elif defined(OS_WIN) |
| negotiate_factory->set_library(new SSPILibraryDefault()); |
| #endif |
| - negotiate_factory->set_url_security_manager(security_manager); |
| - DCHECK(host_resolver || 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); |
| registry_factory->RegisterSchemeFactory("negotiate", negotiate_factory); |
| } |
| #endif // defined(USE_KERBEROS) |
| @@ -201,4 +190,37 @@ int HttpAuthHandlerRegistryFactory::CreateAuthHandler( |
| digest_nonce_count, net_log, handler); |
| } |
| +void HttpAuthHandlerRegistryFactory::SetSecurityManager( |
| + URLSecurityManager* security_manager) { |
| + HttpAuthHandlerFactory* ntlm_factory = GetSchemeFactory("ntml"); |
|
Bernhard Bauer
2015/10/21 09:51:10
ntlm! Would it make sense to extract these to cons
aberent
2015/10/22 17:57:03
Done.
|
| + if (ntlm_factory) |
| + ntlm_factory->set_url_security_manager(security_manager); |
| + HttpAuthHandlerFactory* negotiate_factory = GetSchemeFactory("negotiate"); |
| + if (negotiate_factory) |
| + negotiate_factory->set_url_security_manager(security_manager); |
| +} |
| + |
| +void HttpAuthHandlerRegistryFactory::SetAndroidAuthNegotiateAccountType( |
| + const std::string& account_type) { |
| +#if defined(OS_ANDROID) |
| + HttpAuthHandlerNegotiate::Factory* negotiate_factory = |
| + (HttpAuthHandlerNegotiate::Factory*)GetSchemeFactory("negotiate"); |
|
Bernhard Bauer
2015/10/21 09:51:10
Use static_cast<...>() instead of C-style casts.
aberent
2015/10/22 17:57:03
Done.
|
| + negotiate_factory->set_library(&account_type); |
| +#endif |
| +} |
| + |
| +void HttpAuthHandlerRegistryFactory::SetNegotiateDisableCnameLookup( |
| + bool negotiate_disable_cname_lookup) { |
| + HttpAuthHandlerNegotiate::Factory* negotiate_factory = |
| + (HttpAuthHandlerNegotiate::Factory*)GetSchemeFactory("negotiate"); |
| + negotiate_factory->set_disable_cname_lookup(negotiate_disable_cname_lookup); |
| +} |
| + |
| +void HttpAuthHandlerRegistryFactory::SetNegotiateEnablePort( |
| + bool negotiate_enable_port) { |
| + HttpAuthHandlerNegotiate::Factory* negotiate_factory = |
| + (HttpAuthHandlerNegotiate::Factory*)GetSchemeFactory("negotiate"); |
| + negotiate_factory->set_use_port(negotiate_enable_port); |
| +} |
| + |
| } // namespace net |