summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
Diffstat (limited to 'net/base')
-rw-r--r--net/base/host_resolver.h13
-rw-r--r--net/base/host_resolver_impl.cc3
2 files changed, 9 insertions, 7 deletions
diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h
index 2fb7067..471ad8a 100644
--- a/net/base/host_resolver.h
+++ b/net/base/host_resolver.h
@@ -20,6 +20,7 @@ namespace net {
class AddressList;
class BoundNetLog;
class HostResolverImpl;
+class HostResolverProc;
class NetLog;
// This class represents the task of resolving hostnames (or IP address
@@ -230,13 +231,13 @@ class SingleRequestHostResolver {
DISALLOW_COPY_AND_ASSIGN(SingleRequestHostResolver);
};
-// Creates a HostResolver implementation that queries the underlying system.
-// (Except if a unit-test has changed the global HostResolverProc using
-// ScopedHostResolverProc to intercept requests to the system).
-// |max_concurrent_resolves| is how many resolve requests will be allowed to
-// run in parallel. Pass HostResolver::kDefaultParallelism to choose a
-// default value.
+// Creates a HostResolver implementation using |resolver_proc| as resolver,
+// (which if NULL, will default to getaddrinfo() wrapper) that queries the
+// underlying system, |max_concurrent_resolves| is how many resolve
+// requests will be allowed to run in parallel. Pass
+// HostResolver::kDefaultParallelism to choose a default value.
HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves,
+ HostResolverProc* resolver_proc,
NetLog* net_log);
} // namespace net
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 246f50a..13dce85 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -72,6 +72,7 @@ HostCache* CreateDefaultCache() {
} // anonymous namespace
HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves,
+ HostResolverProc* resolver_proc,
NetLog* net_log) {
// Maximum of 50 concurrent threads.
// TODO(eroman): Adjust this, do some A/B experiments.
@@ -81,7 +82,7 @@ HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves,
max_concurrent_resolves = kDefaultMaxJobs;
HostResolverImpl* resolver =
- new HostResolverImpl(NULL, CreateDefaultCache(),
+ new HostResolverImpl(resolver_proc, CreateDefaultCache(),
max_concurrent_resolves, net_log);
return resolver;