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

Unified Diff: net/base/host_resolver_impl.cc

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/host_cache.cc ('k') | net/base/host_resolver_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_impl.cc
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 4c367a1d64a75e0cfd426168e02cb388dc47bc00..af7d0d343c5e03cfda9c5e98bee443695f7662fa 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -44,18 +44,6 @@ namespace net {
namespace {
-// Helper to create an AddressList that has a particular port. It has an
-// optimization to avoid allocating a new address linked list when the
-// port is already what we want.
-AddressList CreateAddressListUsingPort(const AddressList& src, int port) {
- if (src.GetPort() == port)
- return src;
-
- AddressList out = src;
- out.SetPort(port);
- return out;
-}
-
// Helper to mutate the linked list contained by AddressList to the given
// port. Note that in general this is dangerous since the AddressList's
// data might be shared (and you should use AddressList::SetPort).
@@ -82,17 +70,6 @@ const char kOSErrorsForGetAddrinfoHistogramName[] =
"Net.OSErrorsForGetAddrinfo";
#endif
-HostCache* CreateDefaultCache() {
- static const size_t kMaxHostCacheEntries = 100;
-
- HostCache* cache = new HostCache(
- kMaxHostCacheEntries,
- base::TimeDelta::FromMinutes(1),
- base::TimeDelta::FromSeconds(0)); // Disable caching of failed DNS.
-
- return cache;
-}
-
// Gets a list of the likely error codes that getaddrinfo() can return
// (non-exhaustive). These are the error codes that we will track via
// a histogram.
@@ -157,8 +134,8 @@ HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves,
max_concurrent_resolves = kDefaultMaxJobs;
HostResolverImpl* resolver =
- new HostResolverImpl(NULL, CreateDefaultCache(), max_concurrent_resolves,
- max_retry_attempts, net_log);
+ new HostResolverImpl(NULL, HostCache::CreateDefaultCache(),
+ max_concurrent_resolves, max_retry_attempts, net_log);
return resolver;
}
« no previous file with comments | « net/base/host_cache.cc ('k') | net/base/host_resolver_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698