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

Unified Diff: net/dns/host_resolver_impl.cc

Issue 14161008: [net/dns] Test IPv6 support via UDP connect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver_impl.cc
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index d9c43dfadd728fe6daa8ac7b77c855e22ba39285..0aed70d6b75deb230261d520cd742f2f9bcb3ea1 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -2054,32 +2054,33 @@ HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest(
AddressFamily effective_address_family = info.address_family();
if (info.address_family() == ADDRESS_FAMILY_UNSPECIFIED) {
- base::TimeTicks start_time = base::TimeTicks::Now();
- // Google DNS address.
- const uint8 kIPv6Address[] =
- { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 };
- bool rv6 = IsGloballyReachable(
- IPAddressNumber(kIPv6Address, kIPv6Address + arraysize(kIPv6Address)));
-
- UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration",
- base::TimeTicks::Now() - start_time);
- if (rv6) {
- UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectSuccessMatch",
- default_address_family_ == ADDRESS_FAMILY_UNSPECIFIED);
+ if (ipv6_probe_monitoring_) {
+ base::TimeTicks start_time = base::TimeTicks::Now();
+ // Google DNS address.
+ const uint8 kIPv6Address[] =
+ { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 };
+ IPAddressNumber address(kIPv6Address,
+ kIPv6Address + arraysize(kIPv6Address));
+ bool rv6 = IsGloballyReachable(address);
+
+ UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration",
+ base::TimeTicks::Now() - start_time);
+ if (rv6) {
+ UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectSuccessMatch",
+ default_address_family_ == ADDRESS_FAMILY_UNSPECIFIED);
+ } else {
+ UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectFailureMatch",
+ default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED);
+
+ effective_address_family = ADDRESS_FAMILY_IPV4;
+ effective_flags |= HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
+ }
} else {
- UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectFailureMatch",
- default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED);
+ effective_address_family = default_address_family_;
}
}
- if (effective_address_family == ADDRESS_FAMILY_UNSPECIFIED &&
- default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED) {
- effective_address_family = default_address_family_;
- if (ipv6_probe_monitoring_)
- effective_flags |= HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
- }
-
return Key(info.hostname(), effective_address_family, effective_flags);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698