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

Unified Diff: net/base/host_resolver_impl.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 | « net/base/host_cache_unittest.cc ('k') | net/base/host_resolver_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_impl.h
===================================================================
--- net/base/host_resolver_impl.h (revision 34231)
+++ net/base/host_resolver_impl.h (working copy)
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/scoped_ptr.h"
#include "net/base/host_cache.h"
#include "net/base/host_resolver.h"
#include "net/base/host_resolver_proc.h"
@@ -41,15 +42,17 @@
//
class HostResolverImpl : public HostResolver {
public:
- // Creates a HostResolver that caches up to |max_cache_entries| for
- // |cache_duration_ms| milliseconds. |resolver_proc| is used to perform
- // the actual resolves; it must be thread-safe since it is run from
- // multiple worker threads. If |resolver_proc| is NULL then the default
- // host resolver procedure is used (which is SystemHostResolverProc except
- // if overridden)
- HostResolverImpl(HostResolverProc* resolver_proc,
- int max_cache_entries,
- int cache_duration_ms);
+ // Creates a HostResolver that first uses the local cache |cache|, and then
+ // falls back to |resolver_proc|.
+ //
+ // If |cache| is NULL, then no caching is used. Otherwise we take
+ // ownership of the |cache| pointer, and will free at during destructor.
+ //
+ // |resolver_proc| is used to perform the actual resolves; it must be
+ // thread-safe since it is run from multiple worker threads. If
+ // |resolver_proc| is NULL then the default host resolver procedure is
+ // used (which is SystemHostResolverProc except if overridden).
+ HostResolverImpl(HostResolverProc* resolver_proc, HostCache* cache);
// HostResolver methods:
virtual int Resolve(const RequestInfo& info,
@@ -117,7 +120,7 @@
const RequestInfo& info);
// Cache of host resolution results.
- HostCache cache_;
+ scoped_ptr<HostCache> cache_;
// Map from hostname to outstanding job.
JobMap jobs_;
« no previous file with comments | « net/base/host_cache_unittest.cc ('k') | net/base/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698