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

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

Issue 12082090: [net] Add WifiPhyMode to SystemProfile (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix logic Created 7 years, 10 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
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/base/host_resolver_impl.h" 5 #include "net/base/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 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1975 1975
1976 *addresses = AddressList::CreateFromIPAddress(it->second, info.port()); 1976 *addresses = AddressList::CreateFromIPAddress(it->second, info.port());
1977 return true; 1977 return true;
1978 } 1978 }
1979 1979
1980 void HostResolverImpl::CacheResult(const Key& key, 1980 void HostResolverImpl::CacheResult(const Key& key,
1981 const HostCache::Entry& entry, 1981 const HostCache::Entry& entry,
1982 base::TimeDelta ttl) { 1982 base::TimeDelta ttl) {
1983 if (cache_.get()) 1983 if (cache_.get())
1984 cache_->Set(key, entry, base::TimeTicks::Now(), ttl); 1984 cache_->Set(key, entry, base::TimeTicks::Now(), ttl);
1985 base::TimeTicks then = base::TimeTicks::Now();
rvargas (doing something else) 2013/02/12 02:42:33 You don't mean to check this in, right?
szym 2013/02/12 04:53:43 No, sorry, this is just my shamefully dirty way of
1986 WifiPhyMode phy_mode = GetWifiPhyMode();
1987 UMA_HISTOGRAM_TIMES("WifiPHY.Time", base::TimeTicks::Now() - then);
1988 UMA_HISTOGRAM_COUNTS("WifiPHY.Mode", phy_mode);
1985 } 1989 }
1986 1990
1987 void HostResolverImpl::RemoveJob(Job* job) { 1991 void HostResolverImpl::RemoveJob(Job* job) {
1988 DCHECK(job); 1992 DCHECK(job);
1989 JobMap::iterator it = jobs_.find(job->key()); 1993 JobMap::iterator it = jobs_.find(job->key());
1990 if (it != jobs_.end() && it->second == job) 1994 if (it != jobs_.end() && it->second == job)
1991 jobs_.erase(it); 1995 jobs_.erase(it);
1992 } 1996 }
1993 1997
1994 void HostResolverImpl::IPv6ProbeSetDefaultAddressFamily( 1998 void HostResolverImpl::IPv6ProbeSetDefaultAddressFamily(
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2171 } 2175 }
2172 DnsConfig dns_config; 2176 DnsConfig dns_config;
2173 NetworkChangeNotifier::GetDnsConfig(&dns_config); 2177 NetworkChangeNotifier::GetDnsConfig(&dns_config);
2174 dns_client_->SetConfig(dns_config); 2178 dns_client_->SetConfig(dns_config);
2175 num_dns_failures_ = 0; 2179 num_dns_failures_ = 0;
2176 if (dns_config.IsValid()) 2180 if (dns_config.IsValid())
2177 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); 2181 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true);
2178 } 2182 }
2179 2183
2180 } // namespace net 2184 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698