summaryrefslogtreecommitdiffstats
path: root/net/base/host_cache.h
diff options
context:
space:
mode:
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);