summaryrefslogtreecommitdiffstats
path: root/net/base/host_cache.h
diff options
context:
space:
mode:
authorszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 22:26:48 +0000
committerszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 22:26:48 +0000
commit0de360c6b0b08c2720bcb64cb9f13dbfeca90451 (patch)
treea4f46ef1bb463c6759fb818ecf96ff5ceceae345 /net/base/host_cache.h
parent64ade3bced12c45802c82cfa065e90d6c5b5d575 (diff)
downloadchromium_src-0de360c6b0b08c2720bcb64cb9f13dbfeca90451.zip
chromium_src-0de360c6b0b08c2720bcb64cb9f13dbfeca90451.tar.gz
chromium_src-0de360c6b0b08c2720bcb64cb9f13dbfeca90451.tar.bz2
[net] Measure DNS.CacheEvicted and DNS.CacheExpired.
On every eviction from HostCache record the time left to expiration (DNS.CacheEvicted) or time since expiration (DNS.CacheExpired). A distinction is made for evictions on Lookup (DNS.CacheExpiredOnGet). Review URL: https://chromiumcodereview.appspot.com/11359053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/host_cache.h')
-rw-r--r--net/base/host_cache.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/base/host_cache.h b/net/base/host_cache.h
index 3826045..c4b248b 100644
--- a/net/base/host_cache.h
+++ b/net/base/host_cache.h
@@ -61,8 +61,17 @@ class NET_EXPORT HostCache : NON_EXPORTED_BASE(public base::NonThreadSafe) {
HostResolverFlags host_resolver_flags;
};
+ struct EvictionHandler {
+ void Handle(const Key& key,
+ const Entry& entry,
+ const base::TimeTicks& expiration,
+ const base::TimeTicks& now,
+ bool onGet) const;
+ };
+
typedef ExpiringCache<Key, Entry, base::TimeTicks,
- std::less<base::TimeTicks> > EntryMap;
+ std::less<base::TimeTicks>,
+ EvictionHandler> EntryMap;
// Constructs a HostCache that stores up to |max_entries|.
explicit HostCache(size_t max_entries);