summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/net/dns_global.cc5
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h2
-rw-r--r--chrome/test/unit/chrome_test_suite.h6
4 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/net/dns_global.cc b/chrome/browser/net/dns_global.cc
index 434208b..c2a89c0 100644
--- a/chrome/browser/net/dns_global.cc
+++ b/chrome/browser/net/dns_global.cc
@@ -22,7 +22,9 @@
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
+#include "chrome/common/chrome_switches.h"
#include "net/base/host_resolver.h"
+#include "net/base/host_resolver_impl.h"
using base::Time;
using base::TimeDelta;
@@ -477,6 +479,9 @@ net::HostResolver* GetGlobalHostResolver() {
// Called from UI thread.
if (!global_host_resolver) {
global_host_resolver = net::CreateSystemHostResolver();
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableIPv6))
+ global_host_resolver->DisableIPv6(true);
}
return global_host_resolver;
}
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index f9413b4..4b47a59 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -237,6 +237,9 @@ const char kShowIcons[] = "show-icons";
// Make Chrome default browser
const char kMakeDefaultBrowser[] = "make-default-browser";
+// Don't resolve hostnames to IPv6 addresses.
+const char kDisableIPv6[] = "disable-ipv6";
+
// Use a specified proxy server, overrides system settings. This switch only
// affects HTTP and HTTPS requests.
const char kProxyServer[] = "proxy-server";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 9920df2..ded4e54 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -81,6 +81,8 @@ extern const char kHideIcons[];
extern const char kShowIcons[];
extern const char kMakeDefaultBrowser[];
+extern const char kDisableIPv6[];
+
extern const char kProxyServer[];
extern const char kNoProxyServer[];
extern const char kProxyBypassList[];
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);
}
};