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

Unified Diff: net/base/host_cache.cc

Issue 11065052: [net] Add AsyncDNS.TTL histogram. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove obsolete code Created 8 years, 2 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
Index: net/base/host_cache.cc
diff --git a/net/base/host_cache.cc b/net/base/host_cache.cc
index f94b6869d76bf4e0b1f76f6117ded61774c93c9f..90e1ae9838391e5fb3d13ad0f99b311e6241b072 100644
--- a/net/base/host_cache.cc
+++ b/net/base/host_cache.cc
@@ -11,9 +11,17 @@ namespace net {
//-----------------------------------------------------------------------------
+HostCache::Entry::Entry(int error, const AddressList& addrlist,
+ base::TimeDelta ttl)
+ : error(error),
+ addrlist(addrlist),
+ ttl(ttl) {
+}
+
HostCache::Entry::Entry(int error, const AddressList& addrlist)
: error(error),
- addrlist(addrlist) {
+ addrlist(addrlist),
+ ttl(base::TimeDelta::FromSeconds(-1)) {
}
HostCache::Entry::~Entry() {
@@ -38,15 +46,14 @@ const HostCache::Entry* HostCache::Lookup(const Key& key,
}
void HostCache::Set(const Key& key,
- int error,
- const AddressList& addrlist,
+ const Entry& entry,
base::TimeTicks now,
base::TimeDelta ttl) {
DCHECK(CalledOnValidThread());
if (caching_is_disabled())
return;
- entries_.Put(key, Entry(error, addrlist), now, now + ttl);
+ entries_.Put(key, entry, now, now + ttl);
}
void HostCache::clear() {

Powered by Google App Engine
This is Rietveld 408576698