| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "android_webview/browser/net/aw_url_request_context_getter.h" | 5 #include "android_webview/browser/net/aw_url_request_context_getter.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
| 10 #include "android_webview/browser/aw_content_browser_client.h" | 10 #include "android_webview/browser/aw_content_browser_client.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "content/public/browser/content_browser_client.h" | 27 #include "content/public/browser/content_browser_client.h" |
| 28 #include "content/public/browser/cookie_store_factory.h" | 28 #include "content/public/browser/cookie_store_factory.h" |
| 29 #include "content/public/common/content_client.h" | 29 #include "content/public/common/content_client.h" |
| 30 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
| 31 #include "content/public/common/url_constants.h" | 31 #include "content/public/common/url_constants.h" |
| 32 #include "net/base/cache_type.h" | 32 #include "net/base/cache_type.h" |
| 33 #include "net/cookies/cookie_store.h" | 33 #include "net/cookies/cookie_store.h" |
| 34 #include "net/dns/mapped_host_resolver.h" | 34 #include "net/dns/mapped_host_resolver.h" |
| 35 #include "net/http/http_auth_filter.h" | 35 #include "net/http/http_auth_filter.h" |
| 36 #include "net/http/http_auth_handler_factory.h" | 36 #include "net/http/http_auth_handler_factory.h" |
| 37 #include "net/http/http_auth_preferences.h" |
| 37 #include "net/http/http_cache.h" | 38 #include "net/http/http_cache.h" |
| 38 #include "net/http/http_stream_factory.h" | 39 #include "net/http/http_stream_factory.h" |
| 39 #include "net/http/url_security_manager.h" | |
| 40 #include "net/log/net_log.h" | 40 #include "net/log/net_log.h" |
| 41 #include "net/proxy/proxy_service.h" | 41 #include "net/proxy/proxy_service.h" |
| 42 #include "net/socket/next_proto.h" | 42 #include "net/socket/next_proto.h" |
| 43 #include "net/ssl/channel_id_service.h" | 43 #include "net/ssl/channel_id_service.h" |
| 44 #include "net/url_request/data_protocol_handler.h" | 44 #include "net/url_request/data_protocol_handler.h" |
| 45 #include "net/url_request/file_protocol_handler.h" | 45 #include "net/url_request/file_protocol_handler.h" |
| 46 #include "net/url_request/url_request_context.h" | 46 #include "net/url_request/url_request_context.h" |
| 47 #include "net/url_request/url_request_context_builder.h" | 47 #include "net/url_request/url_request_context_builder.h" |
| 48 #include "net/url_request/url_request_intercepting_job_factory.h" | 48 #include "net/url_request/url_request_intercepting_job_factory.h" |
| 49 #include "net/url_request/url_request_interceptor.h" | 49 #include "net/url_request/url_request_interceptor.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 void AwURLRequestContextGetter::SetKeyOnIO(const std::string& key) { | 269 void AwURLRequestContextGetter::SetKeyOnIO(const std::string& key) { |
| 270 DCHECK(AwBrowserContext::GetDefault()->GetDataReductionProxyIOData()); | 270 DCHECK(AwBrowserContext::GetDefault()->GetDataReductionProxyIOData()); |
| 271 AwBrowserContext::GetDefault()->GetDataReductionProxyIOData()-> | 271 AwBrowserContext::GetDefault()->GetDataReductionProxyIOData()-> |
| 272 request_options()->SetKeyOnIO(key); | 272 request_options()->SetKeyOnIO(key); |
| 273 } | 273 } |
| 274 | 274 |
| 275 scoped_ptr<net::HttpAuthHandlerFactory> | 275 scoped_ptr<net::HttpAuthHandlerFactory> |
| 276 AwURLRequestContextGetter::CreateNegotiateAuthHandlerFactory( | 276 AwURLRequestContextGetter::CreateNegotiateAuthHandlerFactory( |
| 277 net::HostResolver* resolver) { | 277 net::HostResolver* resolver) { |
| 278 DCHECK(resolver); | 278 DCHECK(resolver); |
| 279 | |
| 280 net::HttpAuthFilterWhitelist* auth_filter_default_credentials = nullptr; | |
| 281 if (!auth_server_whitelist_.empty()) { | |
| 282 auth_filter_default_credentials = | |
| 283 new net::HttpAuthFilterWhitelist(auth_server_whitelist_); | |
| 284 } | |
| 285 | |
| 286 url_security_manager_.reset(net::URLSecurityManager::Create( | |
| 287 auth_filter_default_credentials, nullptr /*auth_filter_delegate*/)); | |
| 288 | |
| 289 std::vector<std::string> supported_schemes = {"negotiate"}; | 279 std::vector<std::string> supported_schemes = {"negotiate"}; |
| 280 http_auth_preferences_.reset(new net::HttpAuthPreferences(supported_schemes)); |
| 281 http_auth_preferences_->set_server_whitelist(auth_server_whitelist_); |
| 282 http_auth_preferences_->set_auth_android_negotiate_account_type( |
| 283 auth_android_negotiate_account_type_); |
| 290 scoped_ptr<net::HttpAuthHandlerFactory> negotiate_factory( | 284 scoped_ptr<net::HttpAuthHandlerFactory> negotiate_factory( |
| 291 net::HttpAuthHandlerRegistryFactory::Create( | 285 net::HttpAuthHandlerRegistryFactory::Create(http_auth_preferences_.get(), |
| 292 supported_schemes, | 286 resolver)); |
| 293 url_security_manager_.get(), | |
| 294 resolver, | |
| 295 std::string() /* gssapi_library_name - not used on android */, | |
| 296 auth_android_negotiate_account_type_ , | |
| 297 false /* negotiate_disable_cname_lookup - unsupported policy */, | |
| 298 false /* negotiate_enable_port - unsupported policy */)); | |
| 299 | |
| 300 return negotiate_factory; | 287 return negotiate_factory; |
| 301 } | 288 } |
| 302 | 289 |
| 303 } // namespace android_webview | 290 } // namespace android_webview |
| OLD | NEW |