Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: net/dns/host_resolver_impl.h

Issue 2083643003: DNS: Let requests specify a callback for future cache hits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarify a couple comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/host_resolver.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver_impl.h
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h
index 54de1c8e4fa947fb67bdd4b6f695145a9d7b85de..2f2cca1e17369d6936edb99104fbf8f66a51a42b 100644
--- a/net/dns/host_resolver_impl.h
+++ b/net/dns/host_resolver_impl.h
@@ -299,12 +299,19 @@ class NET_EXPORT HostResolverImpl
// and resulted in |net_error|.
void OnDnsTaskResolve(int net_error);
- void SchedulePersist();
- void DoPersist();
+ void OnCacheEntryEvicted(const HostCache::Key& key,
+ const HostCache::Entry& entry);
+ void ClearCacheHitCallbacks(const HostCache::Key& key);
+ void MaybeAddCacheHitCallback(const HostCache::Key& key,
+ const RequestInfo& info);
+ void RunCacheHitCallbacks(const HostCache::Key& key, const RequestInfo& info);
void ApplyPersistentData(std::unique_ptr<const base::Value>);
std::unique_ptr<const base::Value> GetPersistentData();
+ void SchedulePersist();
+ void DoPersist();
+
// Allows the tests to catch slots leaking out of the dispatcher. One
// HostResolverImpl::Job could occupy multiple PrioritizedDispatcher job
// slots.
@@ -361,6 +368,9 @@ class NET_EXPORT HostResolverImpl
// tasks, but can be overridden for tests.
scoped_refptr<base::TaskRunner> worker_task_runner_;
+ std::map<const HostCache::Key, std::vector<RequestInfo::CacheHitCallback>>
+ cache_hit_callbacks_;
+
bool persist_initialized_;
PersistCallback persist_callback_;
base::OneShotTimer persist_timer_;
« no previous file with comments | « net/dns/host_resolver.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698