Index: net/dns/host_cache.h |
diff --git a/net/dns/host_cache.h b/net/dns/host_cache.h |
index 39c95e4ff4c056424544c6ab63e2661fcdc80772..13042e3d569557ef3114752d7d95a8de06496525 100644 |
--- a/net/dns/host_cache.h |
+++ b/net/dns/host_cache.h |
@@ -124,6 +124,15 @@ class NET_EXPORT HostCache { |
int stale_hits_; |
}; |
+ // Interface for interacting with persistent storage, to be provided by the |
+ // embedder. Does not include support for writes that must happen immediately. |
+ class PersistenceDelegate { |
+ public: |
+ // Calling ScheduleWrite() signals that data has changed and should be |
+ // written to persistent storage. The write might be delayed. |
+ virtual void ScheduleWrite() = 0; |
+ }; |
+ |
using EntryMap = std::map<Key, Entry>; |
using EvictionCallback = base::Callback<void(const Key&, const Entry&)>; |
@@ -158,6 +167,10 @@ class NET_EXPORT HostCache { |
eviction_callback_ = callback; |
} |
+ void set_persistence_delegate(PersistenceDelegate* delegate) { |
+ delegate_ = delegate; |
+ } |
+ |
// Empties the cache. |
void clear(); |
@@ -196,7 +209,8 @@ class NET_EXPORT HostCache { |
void RecordSet(SetOutcome outcome, |
base::TimeTicks now, |
const Entry* old_entry, |
- const Entry& new_entry); |
+ const Entry& new_entry, |
+ AddressListDeltaType delta); |
void RecordUpdateStale(AddressListDeltaType delta, |
const EntryStaleness& stale); |
void RecordLookup(LookupOutcome outcome, |
@@ -219,6 +233,8 @@ class NET_EXPORT HostCache { |
int network_changes_; |
EvictionCallback eviction_callback_; |
+ PersistenceDelegate* delegate_; |
+ |
THREAD_CHECKER(thread_checker_); |
DISALLOW_COPY_AND_ASSIGN(HostCache); |