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

Unified Diff: net/base/async_host_resolver.h

Issue 7466031: AsyncHostResolver: integrated HostCache, temporarily, until we have RR cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed copyright year. Created 9 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
« no previous file with comments | « net/base/address_list.cc ('k') | net/base/async_host_resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/async_host_resolver.h
diff --git a/net/base/async_host_resolver.h b/net/base/async_host_resolver.h
index 2d55717093e5a7ea04b49a6c2472a2e887406253..c14e700216754b1a797cfb1d0ae29750fa90ca43 100644
--- a/net/base/async_host_resolver.h
+++ b/net/base/async_host_resolver.h
@@ -14,6 +14,7 @@
#include "base/threading/non_thread_safe.h"
#include "net/base/address_family.h"
#include "net/base/dns_transaction.h"
+#include "net/base/host_cache.h"
#include "net/base/host_resolver.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_log.h"
@@ -33,6 +34,7 @@ class NET_API AsyncHostResolver
size_t max_transactions,
size_t max_pending_requests_,
const RandIntCallback& rand_int,
+ HostCache* cache,
ClientSocketFactory* factory,
NetLog* net_log);
virtual ~AsyncHostResolver();
@@ -89,6 +91,9 @@ class NET_API AsyncHostResolver
// Called when a request has been cancelled.
void OnCancel(Request* request);
+ // Tries to serve request from cache.
+ bool ServeFromCache(Request* request) const;
+
// If there is an in-progress transaction for Request->key(), this will
// attach |request| to the respective list.
bool AttachToRequestList(Request* request);
@@ -104,7 +109,7 @@ class NET_API AsyncHostResolver
Request* Insert(Request* request);
// Returns the number of pending requests.
- size_t GetNumPending();
+ size_t GetNumPending() const;
// Removes and returns a pointer to the lowest/highest priority request
// from |pending_requests_|.
@@ -136,6 +141,9 @@ class NET_API AsyncHostResolver
// Callback to be passed to DnsTransaction for generating DNS query ids.
RandIntCallback rand_int_cb_;
+ // Cache of host resolution results.
+ scoped_ptr<HostCache> cache_;
+
// Also passed to DnsTransaction; it's a dependency injection to aid
// testing, outside of unit tests, its value is always NULL.
ClientSocketFactory* factory_;
« no previous file with comments | « net/base/address_list.cc ('k') | net/base/async_host_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698