summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/base/host_resolver.h13
-rw-r--r--net/base/host_resolver_impl.cc3
-rw-r--r--net/proxy/proxy_script_fetcher_impl_unittest.cc2
-rw-r--r--net/socket/tcp_client_socket_unittest.cc2
-rw-r--r--net/test/test_server.cc2
-rw-r--r--net/tools/fetch/fetch_client.cc2
-rw-r--r--net/url_request/url_request_unittest.h4
7 files changed, 15 insertions, 13 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;
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc
index f84be57..f9828ee 100644
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc
@@ -36,7 +36,7 @@ class RequestContext : public URLRequestContext {
net::ProxyConfig no_proxy;
host_resolver_ =
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
- NULL);
+ NULL, NULL);
proxy_service_ = net::ProxyService::CreateFixed(no_proxy);
ssl_config_service_ = new net::SSLConfigServiceDefaults;
diff --git a/net/socket/tcp_client_socket_unittest.cc b/net/socket/tcp_client_socket_unittest.cc
index fdd966c..3d92166 100644
--- a/net/socket/tcp_client_socket_unittest.cc
+++ b/net/socket/tcp_client_socket_unittest.cc
@@ -93,7 +93,7 @@ void TCPClientSocketTest::SetUp() {
AddressList addr;
scoped_ptr<HostResolver> resolver(
CreateSystemHostResolver(HostResolver::kDefaultParallelism,
- NULL));
+ NULL, NULL));
HostResolver::RequestInfo info(HostPortPair("localhost", listen_port_));
int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog());
CHECK_EQ(rv, OK);
diff --git a/net/test/test_server.cc b/net/test/test_server.cc
index 3d44fc6..4b426eb 100644
--- a/net/test/test_server.cc
+++ b/net/test/test_server.cc
@@ -242,7 +242,7 @@ bool TestServer::GetAddressList(AddressList* address_list) const {
DCHECK(address_list);
scoped_ptr<HostResolver> resolver(
- CreateSystemHostResolver(HostResolver::kDefaultParallelism, NULL));
+ CreateSystemHostResolver(HostResolver::kDefaultParallelism, NULL, NULL));
HostResolver::RequestInfo info(host_port_pair_);
int rv = resolver->Resolve(info, address_list, NULL, NULL, BoundNetLog());
if (rv != net::OK) {
diff --git a/net/tools/fetch/fetch_client.cc b/net/tools/fetch/fetch_client.cc
index 42949c8..3bdbcbf 100644
--- a/net/tools/fetch/fetch_client.cc
+++ b/net/tools/fetch/fetch_client.cc
@@ -137,7 +137,7 @@ int main(int argc, char**argv) {
scoped_ptr<net::HostResolver> host_resolver(
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
- NULL));
+ NULL, NULL));
scoped_refptr<net::ProxyService> proxy_service(
net::ProxyService::CreateDirect());
diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h
index 2a3ae41..abb6ab5 100644
--- a/net/url_request/url_request_unittest.h
+++ b/net/url_request/url_request_unittest.h
@@ -126,7 +126,7 @@ class TestURLRequestContext : public URLRequestContext {
TestURLRequestContext() {
host_resolver_ =
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
- NULL);
+ NULL, NULL);
proxy_service_ = net::ProxyService::CreateDirect();
Init();
}
@@ -134,7 +134,7 @@ class TestURLRequestContext : public URLRequestContext {
explicit TestURLRequestContext(const std::string& proxy) {
host_resolver_ =
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
- NULL);
+ NULL, NULL);
net::ProxyConfig proxy_config;
proxy_config.proxy_rules().ParseFromString(proxy);
proxy_service_ = net::ProxyService::CreateFixed(proxy_config);