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

Side by Side Diff: net/dns/host_resolver_impl.cc

Issue 141023002: Label IPv6 reachability checks in NetLog (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « net/base/net_log_source_type_list.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/dns/host_resolver_impl.h" 5 #include "net/dns/host_resolver_impl.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <Winsock2.h> 8 #include <Winsock2.h>
9 #elif defined(OS_POSIX) 9 #elif defined(OS_POSIX)
10 #include <netdb.h> 10 #include <netdb.h>
(...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 2148
2149 if (info.address_family() == ADDRESS_FAMILY_UNSPECIFIED) { 2149 if (info.address_family() == ADDRESS_FAMILY_UNSPECIFIED) {
2150 if (probe_ipv6_support_ && !use_local_ipv6_) { 2150 if (probe_ipv6_support_ && !use_local_ipv6_) {
2151 base::TimeTicks start_time = base::TimeTicks::Now(); 2151 base::TimeTicks start_time = base::TimeTicks::Now();
2152 // Google DNS address. 2152 // Google DNS address.
2153 const uint8 kIPv6Address[] = 2153 const uint8 kIPv6Address[] =
2154 { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 2154 { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
2155 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 }; 2155 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 };
2156 IPAddressNumber address(kIPv6Address, 2156 IPAddressNumber address(kIPv6Address,
2157 kIPv6Address + arraysize(kIPv6Address)); 2157 kIPv6Address + arraysize(kIPv6Address));
2158 bool rv6 = IsGloballyReachable(address, net_log); 2158 BoundNetLog probe_net_log = BoundNetLog::Make(
2159 net_log.net_log(), NetLog::SOURCE_IPV6_REACHABILITY_CHECK);
2160 probe_net_log.BeginEvent(NetLog::TYPE_IPV6_REACHABILITY_CHECK,
2161 net_log.source().ToEventParametersCallback());
2162 bool rv6 = IsGloballyReachable(address, probe_net_log);
2163 probe_net_log.EndEvent(NetLog::TYPE_IPV6_REACHABILITY_CHECK);
2159 if (rv6) 2164 if (rv6)
2160 net_log.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_IPV6_SUPPORTED); 2165 net_log.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_IPV6_SUPPORTED);
2161 2166
2162 UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration", 2167 UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration",
2163 base::TimeTicks::Now() - start_time); 2168 base::TimeTicks::Now() - start_time);
2164 if (rv6) { 2169 if (rv6) {
2165 UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectSuccessMatch", 2170 UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectSuccessMatch",
2166 default_address_family_ == ADDRESS_FAMILY_UNSPECIFIED); 2171 default_address_family_ == ADDRESS_FAMILY_UNSPECIFIED);
2167 } else { 2172 } else {
2168 UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectFailureMatch", 2173 UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectFailureMatch",
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 dns_client_->SetConfig(dns_config); 2352 dns_client_->SetConfig(dns_config);
2348 num_dns_failures_ = 0; 2353 num_dns_failures_ = 0;
2349 if (dns_client_->GetConfig()) 2354 if (dns_client_->GetConfig())
2350 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); 2355 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true);
2351 } 2356 }
2352 2357
2353 AbortDnsTasks(); 2358 AbortDnsTasks();
2354 } 2359 }
2355 2360
2356 } // namespace net 2361 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_log_source_type_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698