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

Unified Diff: net/proxy/proxy_resolver_js_bindings.cc

Issue 9197009: Adds custom ttl argument to HostCache::Set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 11 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/proxy/proxy_resolver_js_bindings.cc
diff --git a/net/proxy/proxy_resolver_js_bindings.cc b/net/proxy/proxy_resolver_js_bindings.cc
index f3f6c1558938df3ffc90319ab8404b71d5217b68..ada36a0e0807bcc09cd244f3d50f44e5111ec0ef 100644
--- a/net/proxy/proxy_resolver_js_bindings.cc
+++ b/net/proxy/proxy_resolver_js_bindings.cc
@@ -23,6 +23,10 @@ namespace net {
namespace {
+// TTL for the per-request DNS cache. Applies to both successful and failed
+// DNS resolutions.
+const base::TimeDelta kCacheEntryTTL = base::TimeDelta::FromMinutes(5);
+
// Event parameters for a PAC error message (line number + message).
class ErrorNetlogParams : public NetLog::EventParameters {
public:
@@ -263,7 +267,8 @@ class DefaultJSBindings : public ProxyResolverJSBindings {
// Save the result back to the per-request DNS cache.
if (host_cache) {
host_cache->Set(cache_key, result, *address_list,
- base::TimeTicks::Now());
+ base::TimeTicks::Now(),
+ kCacheEntryTTL);
}
return result;

Powered by Google App Engine
This is Rietveld 408576698