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

Unified Diff: net/base/host_resolver_impl.cc

Issue 12051052: [net] Add Net.UnspecResolvedIPv6 to measure if getaddrinfo resolves IPv6 addresses. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/host_resolver_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_impl.cc
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 0a3e8640fbeb12727e6816d35aaaa0f86b7162eb..21f5c1e857be34c29f5cf92dc6c4247ce8e2dd23 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -1405,6 +1405,19 @@ class HostResolverImpl::Job : public PrioritizedDispatcher::Job {
const AddressList& addr_list) {
DCHECK(is_proc_running());
+ if (!resolver_->resolved_known_ipv6_hostname_ &&
+ key_.address_family == ADDRESS_FAMILY_UNSPECIFIED) {
+ if (key_.hostname == "www.google.com") {
+ resolver_->resolved_known_ipv6_hostname_ = true;
mmenke 2013/01/29 16:10:27 This seems like the wrong way to track this. I th
mmenke 2013/01/29 16:10:27 If there's an error, should we even be logging a h
szym 2013/01/29 16:55:12 Good catch. I previously had this code in HostReso
szym 2013/01/29 16:55:12 We want it once per "network configuration". If we
mmenke 2013/01/29 17:00:46 Good point, though that's at the cost of overrepre
+ bool got_ipv6_address = false;
+ for (size_t i = 0; i < addr_list.size(); ++i) {
+ if (addr_list[i].GetFamily() == ADDRESS_FAMILY_IPV6)
+ got_ipv6_address = true;
+ }
+ UMA_HISTOGRAM_BOOLEAN("Net.UnspecResolvedIPv6", got_ipv6_address);
+ }
+ }
+
if (dns_task_error_ != OK) {
base::TimeDelta duration = base::TimeTicks::Now() - start_time;
if (net_error == OK) {
@@ -1659,14 +1672,15 @@ HostResolverImpl::HostResolverImpl(
dispatcher_(job_limits),
max_queued_jobs_(job_limits.total_jobs * 100u),
proc_params_(proc_params),
+ net_log_(net_log),
default_address_family_(ADDRESS_FAMILY_UNSPECIFIED),
weak_ptr_factory_(this),
probe_weak_ptr_factory_(this),
received_dns_config_(false),
num_dns_failures_(0),
ipv6_probe_monitoring_(false),
- additional_resolver_flags_(0),
- net_log_(net_log) {
+ resolved_known_ipv6_hostname_(false),
+ additional_resolver_flags_(0) {
DCHECK_GE(dispatcher_.num_priorities(), static_cast<size_t>(NUM_PRIORITIES));
@@ -2059,6 +2073,7 @@ void HostResolverImpl::TryServingAllJobsFromHosts() {
}
void HostResolverImpl::OnIPAddressChanged() {
+ resolved_known_ipv6_hostname_ = false;
// Abandon all ProbeJobs.
probe_weak_ptr_factory_.InvalidateWeakPtrs();
if (cache_.get())
« no previous file with comments | « net/base/host_resolver_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698