Index: net/dns/host_cache.h |
diff --git a/net/dns/host_cache.h b/net/dns/host_cache.h |
index 700d5c2e8014322bc7e9c9bbb82977de5160dc6d..7b3d350a8f8c624509f0906980a55756f7d1ef40 100644 |
--- a/net/dns/host_cache.h |
+++ b/net/dns/host_cache.h |
@@ -113,6 +113,7 @@ class NET_EXPORT HostCache : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
}; |
using EntryMap = std::map<Key, Entry>; |
+ using EvictionCallback = base::Callback<void(const Key&, const Entry&)>; |
// Constructs a HostCache that stores up to |max_entries|. |
explicit HostCache(size_t max_entries); |
@@ -141,6 +142,10 @@ class NET_EXPORT HostCache : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
// Marks all entries as stale on account of a network change. |
void OnNetworkChange(); |
+ void set_eviction_callback(const EvictionCallback& callback) { |
+ eviction_callback_ = callback; |
+ } |
+ |
// Empties the cache |
void clear(); |
@@ -186,6 +191,7 @@ class NET_EXPORT HostCache : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
EntryMap entries_; |
size_t max_entries_; |
int network_changes_; |
+ EvictionCallback eviction_callback_; |
DISALLOW_COPY_AND_ASSIGN(HostCache); |
}; |