diff options
author | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 04:59:30 +0000 |
---|---|---|
committer | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 04:59:30 +0000 |
commit | 7632306dce9282980437c3982cfb97bebc5684ec (patch) | |
tree | 716a703f5ee4e3d4382c140aec6e424a195aacd4 | |
parent | 6c1e21845d52076a03f1ed9ed6799190e1833dd3 (diff) | |
download | chromium_src-7632306dce9282980437c3982cfb97bebc5684ec.zip chromium_src-7632306dce9282980437c3982cfb97bebc5684ec.tar.gz chromium_src-7632306dce9282980437c3982cfb97bebc5684ec.tar.bz2 |
Revert 64202 - Initial support for built-in DNS resolver/cache.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/3693001
TBR=agayev@chromium.org
Review URL: http://codereview.chromium.org/4208002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64204 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/io_thread.cc | 19 | ||||
-rw-r--r-- | chrome/chrome_common.gypi | 2 | ||||
-rw-r--r-- | chrome/common/net/raw_host_resolver_proc.cc | 28 | ||||
-rw-r--r-- | chrome/common/net/raw_host_resolver_proc.h | 40 | ||||
-rw-r--r-- | chrome/service/net/service_url_request_context.cc | 2 | ||||
-rw-r--r-- | chrome/test/plugin/plugin_test.cpp | 2 | ||||
-rw-r--r-- | chrome_frame/metrics_service.cc | 2 | ||||
-rw-r--r-- | chrome_frame/test/test_server_test.cc | 2 | ||||
-rw-r--r-- | jingle/notifier/listener/mediator_thread_impl.cc | 2 | ||||
-rw-r--r-- | net/base/host_resolver.h | 13 | ||||
-rw-r--r-- | net/base/host_resolver_impl.cc | 3 | ||||
-rw-r--r-- | net/proxy/proxy_script_fetcher_impl_unittest.cc | 2 | ||||
-rw-r--r-- | net/socket/tcp_client_socket_unittest.cc | 2 | ||||
-rw-r--r-- | net/test/test_server.cc | 2 | ||||
-rw-r--r-- | net/tools/fetch/fetch_client.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_request_context.cc | 2 |
17 files changed, 20 insertions, 109 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 7780753..61d8848 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -21,7 +21,6 @@ #include "chrome/browser/net/passive_log_collector.h" #include "chrome/browser/net/predictor_api.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/net/raw_host_resolver_proc.h" #include "chrome/common/net/url_fetcher.h" #include "net/base/dnsrr_resolver.h" #include "net/base/host_cache.h" @@ -88,24 +87,8 @@ net::HostResolver* CreateGlobalHostResolver(net::NetLog* net_log) { parallelism = 20; } - // Use the specified DNS server for doing raw resolutions if requested - // from the command-line. - scoped_refptr<net::HostResolverProc> resolver_proc; - if (command_line.HasSwitch(switches::kDnsServer)) { - std::string dns_ip_string = - command_line.GetSwitchValueASCII(switches::kDnsServer); - net::IPAddressNumber dns_ip_number; - if (net::ParseIPLiteralToNumber(dns_ip_string, &dns_ip_number)) { - resolver_proc = - new chrome_common_net::RawHostResolverProc(dns_ip_number, NULL); - } else { - LOG(ERROR) << "Invalid IP address specified for --dns-server: " - << dns_ip_string; - } - } - net::HostResolver* global_host_resolver = - net::CreateSystemHostResolver(parallelism, resolver_proc.get(), net_log); + net::CreateSystemHostResolver(parallelism, net_log); // Determine if we should disable IPv6 support. if (!command_line.HasSwitch(switches::kEnableIPv6)) { diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index d4ca5b6..e7970de 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -439,8 +439,6 @@ 'common/net/net_resource_provider.cc', 'common/net/net_resource_provider.h', 'common/net/predictor_common.h', - 'common/net/raw_host_resolver_proc.cc', - 'common/net/raw_host_resolver_proc.h', 'common/net/socket_stream.h', 'common/net/url_fetcher.cc', 'common/net/url_fetcher.h', diff --git a/chrome/common/net/raw_host_resolver_proc.cc b/chrome/common/net/raw_host_resolver_proc.cc deleted file mode 100644 index 474afa2..0000000 --- a/chrome/common/net/raw_host_resolver_proc.cc +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/common/net/raw_host_resolver_proc.h" - -#include "base/logging.h" -#include "net/base/net_errors.h" - -namespace chrome_common_net { - -RawHostResolverProc::RawHostResolverProc(const net::IPAddressNumber& dns_server, - net::HostResolverProc* previous) - : HostResolverProc(previous), dns_server_(dns_server) {} - -int RawHostResolverProc::Resolve(const std::string& host, - net::AddressFamily address_family, - net::HostResolverFlags host_resolver_flags, - net::AddressList* addrlist, - int* os_error) { - // TODO(agayev): Implement raw DNS resolution. - LOG(INFO) << "trying to resolve " << host; - return net::ERR_NAME_NOT_RESOLVED; -} - -RawHostResolverProc::~RawHostResolverProc() {} - -} // namespace chrome_common_net diff --git a/chrome/common/net/raw_host_resolver_proc.h b/chrome/common/net/raw_host_resolver_proc.h deleted file mode 100644 index 7ec751a..0000000 --- a/chrome/common/net/raw_host_resolver_proc.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_COMMON_NET_RAW_HOST_RESOLVER_PROC_H_ -#define CHROME_COMMON_NET_RAW_HOST_RESOLVER_PROC_H_ -#pragma once - -// RawHostResolverProc will eventually be a getaddrinfo() replacement. It -// will construct and send DNS queries to the DNS server specified via -// --dns-server flag and will parse the responses and put it into a cache -// together with the TTL. Necessary amendments will be made to cache and -// HostResolverProc interface to accomodate these. - -#include <string> - -#include "net/base/host_resolver_proc.h" -#include "net/base/net_util.h" - -namespace chrome_common_net { - -class RawHostResolverProc : public net::HostResolverProc { - public: - RawHostResolverProc(const net::IPAddressNumber& dns_server, - net::HostResolverProc* previous); - - virtual int Resolve(const std::string& host, - net::AddressFamily address_family, - net::HostResolverFlags host_resolver_flags, - net::AddressList* addrlist, - int* os_error); - private: - virtual ~RawHostResolverProc(); - - net::IPAddressNumber dns_server_; -}; - -} // namespace chrome_common_net - -#endif // CHROME_COMMON_NET_RAW_HOST_RESOLVER_PROC_H_ diff --git a/chrome/service/net/service_url_request_context.cc b/chrome/service/net/service_url_request_context.cc index cd22539..8e5ae02 100644 --- a/chrome/service/net/service_url_request_context.cc +++ b/chrome/service/net/service_url_request_context.cc @@ -20,7 +20,7 @@ ServiceURLRequestContext::ServiceURLRequestContext() { host_resolver_ = net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL); + NULL); DCHECK(g_service_process); // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a // MessageLoopProxy* instead of MessageLoop*. diff --git a/chrome/test/plugin/plugin_test.cpp b/chrome/test/plugin/plugin_test.cpp index c2f1ad4..c9b7027 100644 --- a/chrome/test/plugin/plugin_test.cpp +++ b/chrome/test/plugin/plugin_test.cpp @@ -263,7 +263,7 @@ class PluginInstallerDownloadTest void Initialize() { host_resolver_ = net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL); + NULL); net::ProxyConfigService* proxy_config_service = net::ProxyService::CreateSystemProxyConfigService(NULL, NULL); DCHECK(proxy_config_service); diff --git a/chrome_frame/metrics_service.cc b/chrome_frame/metrics_service.cc index 6af2c0e..cb30b94 100644 --- a/chrome_frame/metrics_service.cc +++ b/chrome_frame/metrics_service.cc @@ -149,7 +149,7 @@ class ChromeFrameUploadRequestContext : public URLRequestContext { host_resolver_ = net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL); + NULL); net::ProxyConfigService* proxy_config_service = net::ProxyService::CreateSystemProxyConfigService(NULL, NULL); DCHECK(proxy_config_service); diff --git a/chrome_frame/test/test_server_test.cc b/chrome_frame/test/test_server_test.cc index fae70ae..edef592 100644 --- a/chrome_frame/test/test_server_test.cc +++ b/chrome_frame/test/test_server_test.cc @@ -63,7 +63,7 @@ class URLRequestTestContext : public URLRequestContext { URLRequestTestContext() { host_resolver_ = net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL); + NULL); proxy_service_ = net::ProxyService::CreateDirect(); ssl_config_service_ = new net::SSLConfigServiceDefaults; http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( diff --git a/jingle/notifier/listener/mediator_thread_impl.cc b/jingle/notifier/listener/mediator_thread_impl.cc index 9782c55..8a2877d 100644 --- a/jingle/notifier/listener/mediator_thread_impl.cc +++ b/jingle/notifier/listener/mediator_thread_impl.cc @@ -125,7 +125,7 @@ void MediatorThreadImpl::DoLogin( // the IOThread one). host_resolver_.reset( net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL)); + NULL)); notifier::ServerInformation server_list[2]; int server_list_count = 0; diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h index 471ad8a..2fb7067 100644 --- a/net/base/host_resolver.h +++ b/net/base/host_resolver.h @@ -20,7 +20,6 @@ namespace net { class AddressList; class BoundNetLog; class HostResolverImpl; -class HostResolverProc; class NetLog; // This class represents the task of resolving hostnames (or IP address @@ -231,13 +230,13 @@ class SingleRequestHostResolver { DISALLOW_COPY_AND_ASSIGN(SingleRequestHostResolver); }; -// 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. +// 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. 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 13dce85..246f50a 100644 --- a/net/base/host_resolver_impl.cc +++ b/net/base/host_resolver_impl.cc @@ -72,7 +72,6 @@ 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. @@ -82,7 +81,7 @@ HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves, max_concurrent_resolves = kDefaultMaxJobs; HostResolverImpl* resolver = - new HostResolverImpl(resolver_proc, CreateDefaultCache(), + new HostResolverImpl(NULL, 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 f9828ee..f84be57 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 3d92166..fdd966c 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 6e18e18..0b1cd085 100644 --- a/net/test/test_server.cc +++ b/net/test/test_server.cc @@ -191,7 +191,7 @@ bool TestServer::GetAddressList(AddressList* address_list) const { DCHECK(address_list); scoped_ptr<HostResolver> resolver( - CreateSystemHostResolver(HostResolver::kDefaultParallelism, NULL, NULL)); + CreateSystemHostResolver(HostResolver::kDefaultParallelism, 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 3bdbcbf..42949c8 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 abb6ab5..2a3ae41 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); diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc index d0e93e2..9057fc0 100644 --- a/webkit/tools/test_shell/test_shell_request_context.cc +++ b/webkit/tools/test_shell/test_shell_request_context.cc @@ -61,7 +61,7 @@ void TestShellRequestContext::Init( #endif host_resolver_ = net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL); + NULL); proxy_service_ = net::ProxyService::CreateUsingSystemProxyResolver( proxy_config_service.release(), 0, NULL); ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); |