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

Unified Diff: net/proxy/proxy_resolver_js_bindings.cc

Issue 9226035: Adds TTL argument to HostCache::Set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed the two other static initializers 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
« no previous file with comments | « net/dns/async_host_resolver.cc ('k') | net/proxy/proxy_resolver_js_bindings_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d8d02ee15a96eea587a902b08e60e9ad59b05bda 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 unsigned kCacheEntryTTLSeconds = 5 * 60;
+
// 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(),
+ base::TimeDelta::FromSeconds(kCacheEntryTTLSeconds));
}
return result;
« no previous file with comments | « net/dns/async_host_resolver.cc ('k') | net/proxy/proxy_resolver_js_bindings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698