summaryrefslogtreecommitdiffstats
path: root/net/base/host_cache.h
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 20:17:29 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 20:17:29 +0000
commit3b24ecf7ea2060bdb394ea249c24530f18a64578 (patch)
treecc1fe2fdf8af92a2f56c07598cea52f722113d6e /net/base/host_cache.h
parent3b10a7515086465baab07296a30ba71797b455c8 (diff)
downloadchromium_src-3b24ecf7ea2060bdb394ea249c24530f18a64578.zip
chromium_src-3b24ecf7ea2060bdb394ea249c24530f18a64578.tar.gz
chromium_src-3b24ecf7ea2060bdb394ea249c24530f18a64578.tar.bz2
Add a visualizer for the HostCache (DNS cache) on the network internals page.
BUG=http://crbug.com/14478 Review URL: http://codereview.chromium.org/172100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/host_cache.h')
-rw-r--r--net/base/host_cache.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/net/base/host_cache.h b/net/base/host_cache.h
index d5b9511..ab01c86 100644
--- a/net/base/host_cache.h
+++ b/net/base/host_cache.h
@@ -31,6 +31,8 @@ class HostCache {
base::TimeTicks expiration;
};
+ typedef base::hash_map<std::string, scoped_refptr<Entry> > EntryMap;
+
// Constructs a HostCache whose entries are valid for |cache_duration_ms|
// milliseconds. The cache will store up to |max_entries|.
HostCache(size_t max_entries, size_t cache_duration_ms);
@@ -60,12 +62,23 @@ class HostCache {
return entries_.size();
}
+ size_t max_entries() const {
+ return max_entries_;
+ }
+
+ size_t cache_duration_ms() const {
+ return cache_duration_ms_;
+ }
+
+ // Note that this map may contain expired entries.
+ const EntryMap& entries() const {
+ return entries_;
+ }
+
private:
FRIEND_TEST(HostCacheTest, Compact);
FRIEND_TEST(HostCacheTest, NoCache);
- typedef base::hash_map<std::string, scoped_refptr<Entry> > EntryMap;
-
// Returns true if this cache entry's result is valid at time |now|.
static bool CanUseEntry(const Entry* entry, const base::TimeTicks now);