diff options
author | agayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-27 18:08:20 +0000 |
---|---|---|
committer | agayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-27 18:08:20 +0000 |
commit | 6e7fd16e401caadfafc1c70b376c472048bc7376 (patch) | |
tree | 5d8943bafebfb92c81aa3009001baecd63d85cfd | |
parent | cd6d14b690ea36ec68d0653e664f91dcda0d4273 (diff) | |
download | chromium_src-6e7fd16e401caadfafc1c70b376c472048bc7376.zip chromium_src-6e7fd16e401caadfafc1c70b376c472048bc7376.tar.gz chromium_src-6e7fd16e401caadfafc1c70b376c472048bc7376.tar.bz2 |
Undo raw DNS resolver changes, this will be implemented differently, on IO-thread.
BUG=60149
TEST=None
Review URL: http://codereview.chromium.org/6893007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83177 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-- | net/base/host_resolver.h | 12 | ||||
-rw-r--r-- | net/base/host_resolver_impl.cc | 5 | ||||
-rw-r--r-- | net/proxy/proxy_script_fetcher_impl_unittest.cc | 2 | ||||
-rw-r--r-- | net/socket/transport_client_socket_unittest.cc | 2 | ||||
-rw-r--r-- | net/test/test_server.cc | 2 | ||||
-rw-r--r-- | net/tools/fetch/fetch_client.cc | 4 | ||||
-rw-r--r-- | net/url_request/url_request_test_util.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_request_context.cc | 2 |
13 files changed, 18 insertions, 106 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 9eeec4f..fd3b443 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -27,7 +27,6 @@ #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/net/raw_host_resolver_proc.h" #include "chrome/common/net/url_fetcher.h" #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" @@ -122,24 +121,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 e9e47db..38a28da 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -350,8 +350,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/url_fetcher.cc', 'common/net/url_fetcher.h', 'common/net/gaia/gaia_auth_consumer.cc', 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 d041f6a..b3f47f6 100644 --- a/chrome/service/net/service_url_request_context.cc +++ b/chrome/service/net/service_url_request_context.cc @@ -108,7 +108,7 @@ ServiceURLRequestContext::ServiceURLRequestContext( net::ProxyService* net_proxy_service) : user_agent_(user_agent) { set_host_resolver( net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL)); + NULL)); set_proxy_service(net_proxy_service); set_cert_verifier(new net::CertVerifier); set_dnsrr_resolver(new net::DnsRRResolver); diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h index f16c265..cf32cb0 100644 --- a/net/base/host_resolver.h +++ b/net/base/host_resolver.h @@ -235,13 +235,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 894443c..b512561 100644 --- a/net/base/host_resolver_impl.cc +++ b/net/base/host_resolver_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -72,7 +72,6 @@ HostCache* CreateDefaultCache() { } // anonymous namespace HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves, - HostResolverProc* resolver_proc, NetLog* net_log) { // Maximum of 8 concurrent resolver threads. // Some routers (or resolvers) appear to start to provide host-not-found if @@ -84,7 +83,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 56cccb1..89db823 100644 --- a/net/proxy/proxy_script_fetcher_impl_unittest.cc +++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc @@ -43,7 +43,7 @@ class RequestContext : public URLRequestContext { ProxyConfig no_proxy; set_host_resolver( CreateSystemHostResolver(HostResolver::kDefaultParallelism, - NULL, NULL)); + NULL)); set_cert_verifier(new CertVerifier); set_proxy_service(ProxyService::CreateFixed(no_proxy)); set_ssl_config_service(new SSLConfigServiceDefaults); diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc index 26e0f14..837749e 100644 --- a/net/socket/transport_client_socket_unittest.cc +++ b/net/socket/transport_client_socket_unittest.cc @@ -105,7 +105,7 @@ void TransportClientSocketTest::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 2b61ec6..528d08e 100644 --- a/net/test/test_server.cc +++ b/net/test/test_server.cc @@ -192,7 +192,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 e206e49..abff5e6 100644 --- a/net/tools/fetch/fetch_client.cc +++ b/net/tools/fetch/fetch_client.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -139,7 +139,7 @@ int main(int argc, char**argv) { scoped_ptr<net::HostResolver> host_resolver( net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL)); + NULL)); scoped_ptr<net::CertVerifier> cert_verifier(new net::CertVerifier); scoped_refptr<net::ProxyService> proxy_service( diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc index f2a7b93..96d1391 100644 --- a/net/url_request/url_request_test_util.cc +++ b/net/url_request/url_request_test_util.cc @@ -41,7 +41,7 @@ TestURLRequestContext::TestURLRequestContext() : ALLOW_THIS_IN_INITIALIZER_LIST(context_storage_(this)) { context_storage_.set_host_resolver( net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL)); + NULL)); context_storage_.set_proxy_service(net::ProxyService::CreateDirect()); Init(); } @@ -50,7 +50,7 @@ TestURLRequestContext::TestURLRequestContext(const std::string& proxy) : ALLOW_THIS_IN_INITIALIZER_LIST(context_storage_(this)) { context_storage_.set_host_resolver( net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL)); + NULL)); net::ProxyConfig proxy_config; proxy_config.proxy_rules().ParseFromString(proxy); context_storage_.set_proxy_service( diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc index 89bed6f..7840afa 100644 --- a/webkit/tools/test_shell/test_shell_request_context.cc +++ b/webkit/tools/test_shell/test_shell_request_context.cc @@ -66,7 +66,7 @@ void TestShellRequestContext::Init( #endif set_host_resolver( net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, - NULL, NULL)); + NULL)); set_cert_verifier(new net::CertVerifier); set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver( proxy_config_service.release(), 0, NULL)); |