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

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: rebase Created 4 years, 5 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
Index: net/dns/host_resolver_impl.h
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h
index 9ab01ca03ea1a6d3ea4a828249d546537a127f4f..691d8faee2a02b9624495e849dd18b09cbe2c8a6 100644
--- a/net/dns/host_resolver_impl.h
+++ b/net/dns/host_resolver_impl.h
@@ -297,6 +297,13 @@ class NET_EXPORT HostResolverImpl
// and resulted in |net_error|.
void OnDnsTaskResolve(int net_error);
+ 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);
+
// Allows the tests to catch slots leaking out of the dispatcher. One
// HostResolverImpl::Job could occupy multiple PrioritizedDispatcher job
// slots.
@@ -353,6 +360,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_;
+
base::WeakPtrFactory<HostResolverImpl> weak_ptr_factory_;
base::WeakPtrFactory<HostResolverImpl> probe_weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698