Index: net/base/host_cache.cc |
diff --git a/net/base/host_cache.cc b/net/base/host_cache.cc |
index 791ecca3e20af1fd6659fa7025ff637989c3d72e..8debede6ba167e44c6949af006fb7062b49f3237 100644 |
--- a/net/base/host_cache.cc |
+++ b/net/base/host_cache.cc |
@@ -35,6 +35,7 @@ HostCache::~HostCache() { |
const HostCache::Entry* HostCache::Lookup(const Key& key, |
base::TimeTicks now) const { |
+ DCHECK(CalledOnValidThread()); |
if (caching_is_disabled()) |
return NULL; |
@@ -53,6 +54,7 @@ HostCache::Entry* HostCache::Set(const Key& key, |
int error, |
const AddressList addrlist, |
base::TimeTicks now) { |
+ DCHECK(CalledOnValidThread()); |
if (caching_is_disabled()) |
return NULL; |
@@ -79,6 +81,37 @@ HostCache::Entry* HostCache::Set(const Key& key, |
} |
} |
+void HostCache::clear() { |
+ DCHECK(CalledOnValidThread()); |
+ entries_.clear(); |
+} |
+ |
+size_t HostCache::size() const { |
+ DCHECK(CalledOnValidThread()); |
+ return entries_.size(); |
+} |
+ |
+size_t HostCache::max_entries() const { |
+ DCHECK(CalledOnValidThread()); |
+ return max_entries_; |
+} |
+ |
+base::TimeDelta HostCache::success_entry_ttl() const { |
+ DCHECK(CalledOnValidThread()); |
+ return success_entry_ttl_; |
+} |
+ |
+base::TimeDelta HostCache::failure_entry_ttl() const { |
+ DCHECK(CalledOnValidThread()); |
+ return failure_entry_ttl_; |
+} |
+ |
+// Note that this map may contain expired entries. |
+const HostCache::EntryMap& HostCache::entries() const { |
+ DCHECK(CalledOnValidThread()); |
+ return entries_; |
+} |
+ |
// static |
bool HostCache::CanUseEntry(const Entry* entry, const base::TimeTicks now) { |
return entry->expiration > now; |