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

Unified Diff: net/base/host_cache.h

Issue 464084: Cache failed DNS resolutions for 1 second.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Merge changes (to include API change in another file) Created 11 years 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 | « no previous file | net/base/host_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_cache.h
===================================================================
--- net/base/host_cache.h (revision 34231)
+++ net/base/host_cache.h (working copy)
@@ -57,9 +57,12 @@
typedef std::map<Key, scoped_refptr<Entry> > EntryMap;
- // Constructs a HostCache whose entries are valid for |cache_duration_ms|
- // milliseconds. The cache will store up to |max_entries|.
- HostCache(size_t max_entries, size_t cache_duration_ms);
+ // Constructs a HostCache that caches successful host resolves for
+ // |success_entry_ttl| time, and failed host resolves for
+ // |failure_entry_ttl|. The cache will store up to |max_entries|.
+ HostCache(size_t max_entries,
+ base::TimeDelta success_entry_ttl,
+ base::TimeDelta failure_entry_ttl);
~HostCache();
@@ -90,10 +93,14 @@
return max_entries_;
}
- size_t cache_duration_ms() const {
- return cache_duration_ms_;
+ base::TimeDelta success_entry_ttl() const {
+ return success_entry_ttl_;
}
+ base::TimeDelta failure_entry_ttl() const {
+ return failure_entry_ttl_;
+ }
+
// Note that this map may contain expired entries.
const EntryMap& entries() const {
return entries_;
@@ -113,8 +120,9 @@
// Bound on total size of the cache.
size_t max_entries_;
- // Time to live for cache entries in milliseconds.
- size_t cache_duration_ms_;
+ // Time to live for cache entries.
+ base::TimeDelta success_entry_ttl_;
+ base::TimeDelta failure_entry_ttl_;
// Map from hostname (presumably in lowercase canonicalized format) to
// a resolved result entry.
« no previous file with comments | « no previous file | net/base/host_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698