From 123ab1e334b44051297c8d4242e81044478c6588 Mon Sep 17 00:00:00 2001 From: "eroman@chromium.org" Date: Wed, 21 Oct 2009 19:12:57 +0000 Subject: Add a mechanism to disable IPv6. (1) Adds the ability to specify the address family on a per-request basis. (2) Exposes a --disable-ipv6 flag to chrome that changes the default address family from AF_UNSPEC to AF_INET (same sort of thing Firefox does). (3) Changes the backing datastructure for HostCache:EntryMap and HostResolverImpl::JobMap from a "hash_map" to a "std::map". This was for consistency with other code (when I went to add a custom hash trait, I couldn't find any existing code which was using hashmap for custom keys). (4) Updates about:net-internals to display an address family for the hostcache dump (since it is now a part of the key). This change is in anticipation of turning off IPv6 host resolving in the PAC utility functions (see bug 24641). But it is also a feature addition. BUG=24641 TEST=HostCacheTest.AddressFamilyIsPartOfKey Review URL: http://codereview.chromium.org/302010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29686 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/unit/chrome_test_suite.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'chrome/test') diff --git a/chrome/test/unit/chrome_test_suite.h b/chrome/test/unit/chrome_test_suite.h index 52dcc2c..43c7de0 100644 --- a/chrome/test/unit/chrome_test_suite.h +++ b/chrome/test/unit/chrome_test_suite.h @@ -36,7 +36,9 @@ class WarningHostResolverProc : public net::HostResolverProc { public: WarningHostResolverProc() : HostResolverProc(NULL) {} - virtual int Resolve(const std::string& host, net::AddressList* addrlist) { + virtual int Resolve(const std::string& host, + net::AddressFamily address_family, + net::AddressList* addrlist) { const char* kLocalHostNames[] = {"localhost", "127.0.0.1"}; bool local = false; @@ -55,7 +57,7 @@ class WarningHostResolverProc : public net::HostResolverProc { // net::RuleBasedHostResolverProc and its AllowDirectLookup method. EXPECT_TRUE(local) << "Making external DNS lookup of " << host; - return ResolveUsingPrevious(host, addrlist); + return ResolveUsingPrevious(host, address_family, addrlist); } }; -- cgit v1.1