Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: components/cronet/url_request_context_config.cc

Issue 2811183003: Change Cronet's "disable_ipv6" to "disable_ipv6_on_wifi" (Closed)
Patch Set: more comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/cronet/url_request_context_config_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/url_request_context_config.cc
diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc
index 2c588fc6e5d3cdf3e19f29a7e4cdda2802f828c9..f9b64d6023e8d05f66a3a29023d8c56fef9bd70b 100644
--- a/components/cronet/url_request_context_config.cc
+++ b/components/cronet/url_request_context_config.cc
@@ -82,10 +82,10 @@ const char kStaleDnsAllowOtherNetwork[] = "allow_other_network";
const char kHostResolverRulesFieldTrialName[] = "HostResolverRules";
const char kHostResolverRules[] = "host_resolver_rules";
-// Disable IPv6. This should almost never be necessary because the network stack
-// has IPv6 detection logic. Please do not turn on this option without first
-// reporting a bug. See http://crbug.com/696569 for the currently known issue.
-const char kDisableIPv6[] = "disable_ipv6";
+// Disable IPv6 when on WiFi. This is a workaround for a known issue on certain
+// Android phones, and should not be necessary when not on one of those devices.
+// See https://crbug.com/696569 for details.
+const char kDisableIPv6OnWifi[] = "disable_ipv6_on_wifi";
const char kSSLKeyLogFile[] = "ssl_key_log_file";
@@ -122,7 +122,7 @@ std::unique_ptr<base::DictionaryValue> ParseAndSetExperimentalOptions(
bool async_dns_enable = false;
bool stale_dns_enable = false;
bool host_resolver_rules_enable = false;
- bool disable_ipv6 = false;
+ bool disable_ipv6_on_wifi = false;
std::unique_ptr<base::DictionaryValue> effective_experimental_options =
dict->CreateDeepCopy();
@@ -277,8 +277,8 @@ std::unique_ptr<base::DictionaryValue> ParseAndSetExperimentalOptions(
}
host_resolver_rules_enable = host_resolver_rules_args->GetString(
kHostResolverRules, &host_resolver_rules_string);
- } else if (it.key() == kDisableIPv6) {
- if (!it.value().GetAsBoolean(&disable_ipv6)) {
+ } else if (it.key() == kDisableIPv6OnWifi) {
+ if (!it.value().GetAsBoolean(&disable_ipv6_on_wifi)) {
LOG(ERROR) << "\"" << it.key() << "\" config params \"" << it.value()
<< "\" is not a bool";
effective_experimental_options->Remove(it.key(), nullptr);
@@ -307,19 +307,19 @@ std::unique_ptr<base::DictionaryValue> ParseAndSetExperimentalOptions(
}
if (async_dns_enable || stale_dns_enable || host_resolver_rules_enable ||
- disable_ipv6) {
+ disable_ipv6_on_wifi) {
CHECK(net_log) << "All DNS-related experiments require NetLog.";
std::unique_ptr<net::HostResolver> host_resolver;
if (stale_dns_enable) {
- DCHECK(!disable_ipv6);
+ DCHECK(!disable_ipv6_on_wifi);
host_resolver.reset(new StaleHostResolver(
net::HostResolver::CreateDefaultResolverImpl(net_log),
stale_dns_options));
} else {
host_resolver = net::HostResolver::CreateDefaultResolver(net_log);
}
- if (disable_ipv6)
- host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4);
+ if (disable_ipv6_on_wifi)
+ host_resolver->SetNoIPv6OnWifi(true);
if (async_dns_enable)
host_resolver->SetDnsClientEnabled(true);
if (host_resolver_rules_enable) {
« no previous file with comments | « no previous file | components/cronet/url_request_context_config_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698