OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/http/http_auth_handler_factory.h" | 5 #include "net/http/http_auth_handler_factory.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 ntlm_factory->set_sspi_library(new SSPILibraryDefault()); | 79 ntlm_factory->set_sspi_library(new SSPILibraryDefault()); |
80 #endif // defined(OS_WIN) | 80 #endif // defined(OS_WIN) |
81 registry_factory->RegisterSchemeFactory(kNtlmAuthScheme, ntlm_factory); | 81 registry_factory->RegisterSchemeFactory(kNtlmAuthScheme, ntlm_factory); |
82 } | 82 } |
83 #if defined(USE_KERBEROS) | 83 #if defined(USE_KERBEROS) |
84 if (prefs.IsSupportedScheme(kNegotiateAuthScheme)) { | 84 if (prefs.IsSupportedScheme(kNegotiateAuthScheme)) { |
85 DCHECK(host_resolver); | 85 DCHECK(host_resolver); |
86 HttpAuthHandlerNegotiate::Factory* negotiate_factory = | 86 HttpAuthHandlerNegotiate::Factory* negotiate_factory = |
87 new HttpAuthHandlerNegotiate::Factory(); | 87 new HttpAuthHandlerNegotiate::Factory(); |
88 #if defined(OS_WIN) | 88 #if defined(OS_WIN) |
89 negotiate_factory->set_library(base::WrapUnique(new SSPILibraryDefault())); | 89 negotiate_factory->set_library(base::MakeUnique<SSPILibraryDefault>()); |
90 #elif defined(OS_POSIX) && !defined(OS_ANDROID) | 90 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
91 negotiate_factory->set_library( | 91 negotiate_factory->set_library( |
92 base::WrapUnique(new GSSAPISharedLibrary(prefs.GssapiLibraryName()))); | 92 base::MakeUnique<GSSAPISharedLibrary>(prefs.GssapiLibraryName())); |
93 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) | 93 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) |
94 negotiate_factory->set_host_resolver(host_resolver); | 94 negotiate_factory->set_host_resolver(host_resolver); |
95 registry_factory->RegisterSchemeFactory(kNegotiateAuthScheme, | 95 registry_factory->RegisterSchemeFactory(kNegotiateAuthScheme, |
96 negotiate_factory); | 96 negotiate_factory); |
97 } | 97 } |
98 #endif // defined(USE_KERBEROS) | 98 #endif // defined(USE_KERBEROS) |
99 return registry_factory; | 99 return registry_factory; |
100 } | 100 } |
101 | 101 |
102 } // namespace | 102 } // namespace |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 handler->reset(); | 183 handler->reset(); |
184 return ERR_UNSUPPORTED_AUTH_SCHEME; | 184 return ERR_UNSUPPORTED_AUTH_SCHEME; |
185 } | 185 } |
186 DCHECK(it->second); | 186 DCHECK(it->second); |
187 return it->second->CreateAuthHandler(challenge, target, ssl_info, origin, | 187 return it->second->CreateAuthHandler(challenge, target, ssl_info, origin, |
188 reason, digest_nonce_count, net_log, | 188 reason, digest_nonce_count, net_log, |
189 handler); | 189 handler); |
190 } | 190 } |
191 | 191 |
192 } // namespace net | 192 } // namespace net |
OLD | NEW |