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 "chrome/browser/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 globals_(NULL), | 475 globals_(NULL), |
476 is_spdy_disabled_by_policy_(false), | 476 is_spdy_disabled_by_policy_(false), |
477 creation_time_(base::TimeTicks::Now()), | 477 creation_time_(base::TimeTicks::Now()), |
478 weak_factory_(this) { | 478 weak_factory_(this) { |
479 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); | 479 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); |
480 negotiate_disable_cname_lookup_ = local_state->GetBoolean( | 480 negotiate_disable_cname_lookup_ = local_state->GetBoolean( |
481 prefs::kDisableAuthNegotiateCnameLookup); | 481 prefs::kDisableAuthNegotiateCnameLookup); |
482 negotiate_enable_port_ = local_state->GetBoolean( | 482 negotiate_enable_port_ = local_state->GetBoolean( |
483 prefs::kEnableAuthNegotiatePort); | 483 prefs::kEnableAuthNegotiatePort); |
484 auth_server_whitelist_ = local_state->GetString(prefs::kAuthServerWhitelist); | 484 auth_server_whitelist_ = local_state->GetString(prefs::kAuthServerWhitelist); |
485 auth_delegate_whitelist_ = local_state->GetString( | |
486 prefs::kAuthNegotiateDelegateWhitelist); | |
487 gssapi_library_name_ = local_state->GetString(prefs::kGSSAPILibraryName); | 485 gssapi_library_name_ = local_state->GetString(prefs::kGSSAPILibraryName); |
488 pref_proxy_config_tracker_.reset( | 486 pref_proxy_config_tracker_.reset( |
489 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 487 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
490 local_state)); | 488 local_state)); |
491 ChromeNetworkDelegate::InitializePrefsOnUIThread( | 489 ChromeNetworkDelegate::InitializePrefsOnUIThread( |
492 &system_enable_referrers_, | 490 &system_enable_referrers_, |
493 NULL, | 491 NULL, |
494 NULL, | 492 NULL, |
495 NULL, | 493 NULL, |
496 NULL, | 494 NULL, |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 } | 952 } |
955 | 953 |
956 // static | 954 // static |
957 void IOThread::RegisterPrefs(PrefRegistrySimple* registry) { | 955 void IOThread::RegisterPrefs(PrefRegistrySimple* registry) { |
958 registry->RegisterStringPref(prefs::kAuthSchemes, | 956 registry->RegisterStringPref(prefs::kAuthSchemes, |
959 "basic,digest,ntlm,negotiate," | 957 "basic,digest,ntlm,negotiate," |
960 "spdyproxy"); | 958 "spdyproxy"); |
961 registry->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, false); | 959 registry->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, false); |
962 registry->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); | 960 registry->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); |
963 registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); | 961 registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); |
964 registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, | |
965 std::string()); | |
966 registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); | 962 registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); |
967 registry->RegisterStringPref( | 963 registry->RegisterStringPref( |
968 data_reduction_proxy::prefs::kDataReductionProxy, std::string()); | 964 data_reduction_proxy::prefs::kDataReductionProxy, std::string()); |
969 registry->RegisterBooleanPref(prefs::kEnableReferrers, true); | 965 registry->RegisterBooleanPref(prefs::kEnableReferrers, true); |
970 data_reduction_proxy::RegisterPrefs(registry); | 966 data_reduction_proxy::RegisterPrefs(registry); |
971 registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); | 967 registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); |
972 registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true); | 968 registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true); |
973 } | 969 } |
974 | 970 |
975 net::HttpAuthHandlerFactory* IOThread::CreateDefaultAuthHandlerFactory( | 971 net::HttpAuthHandlerFactory* IOThread::CreateDefaultAuthHandlerFactory( |
976 net::HostResolver* resolver) { | 972 net::HostResolver* resolver) { |
977 net::HttpAuthFilterWhitelist* auth_filter_default_credentials = NULL; | 973 net::HttpAuthFilterWhitelist* auth_filter_default_credentials = NULL; |
978 if (!auth_server_whitelist_.empty()) { | 974 if (!auth_server_whitelist_.empty()) { |
979 auth_filter_default_credentials = | 975 auth_filter_default_credentials = |
980 new net::HttpAuthFilterWhitelist(auth_server_whitelist_); | 976 new net::HttpAuthFilterWhitelist(auth_server_whitelist_); |
981 } | 977 } |
982 net::HttpAuthFilterWhitelist* auth_filter_delegate = NULL; | 978 net::HttpAuthFilterWhitelist* auth_filter_delegate = NULL; |
983 if (!auth_delegate_whitelist_.empty()) { | |
984 auth_filter_delegate = | |
985 new net::HttpAuthFilterWhitelist(auth_delegate_whitelist_); | |
986 } | |
987 globals_->url_security_manager.reset( | 979 globals_->url_security_manager.reset( |
988 net::URLSecurityManager::Create(auth_filter_default_credentials, | 980 net::URLSecurityManager::Create(auth_filter_default_credentials, |
989 auth_filter_delegate)); | 981 auth_filter_delegate)); |
990 std::vector<std::string> supported_schemes; | 982 std::vector<std::string> supported_schemes; |
991 base::SplitString(auth_schemes_, ',', &supported_schemes); | 983 base::SplitString(auth_schemes_, ',', &supported_schemes); |
992 | 984 |
993 scoped_ptr<net::HttpAuthHandlerRegistryFactory> registry_factory( | 985 scoped_ptr<net::HttpAuthHandlerRegistryFactory> registry_factory( |
994 net::HttpAuthHandlerRegistryFactory::Create( | 986 net::HttpAuthHandlerRegistryFactory::Create( |
995 supported_schemes, globals_->url_security_manager.get(), | 987 supported_schemes, globals_->url_security_manager.get(), |
996 resolver, gssapi_library_name_, negotiate_disable_cname_lookup_, | 988 resolver, gssapi_library_name_, negotiate_disable_cname_lookup_, |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1422 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1431 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1423 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1432 net::QuicVersion version = supported_versions[i]; | 1424 net::QuicVersion version = supported_versions[i]; |
1433 if (net::QuicVersionToString(version) == quic_version) { | 1425 if (net::QuicVersionToString(version) == quic_version) { |
1434 return version; | 1426 return version; |
1435 } | 1427 } |
1436 } | 1428 } |
1437 | 1429 |
1438 return net::QUIC_VERSION_UNSUPPORTED; | 1430 return net::QUIC_VERSION_UNSUPPORTED; |
1439 } | 1431 } |
OLD | NEW |