summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-07 07:04:05 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-07 07:04:05 +0000
commit841240f4b2ab61db1610a45487114ad8d6a898af (patch)
tree0226c2d620d72ff22356e8706d9233bae7f7d215 /net
parent68abc22003015ced6e49012be439c27b81232432 (diff)
downloadchromium_src-841240f4b2ab61db1610a45487114ad8d6a898af.zip
chromium_src-841240f4b2ab61db1610a45487114ad8d6a898af.tar.gz
chromium_src-841240f4b2ab61db1610a45487114ad8d6a898af.tar.bz2
Revert 38323 - Add IPv6 probing support, and disable IPv6 resolution when it is useless
I've added minimal probing to check if IPv6 is at all possible, and when it is not, then we disable IPv6 resolution. I've also added histograms and A/B test support to evaluate the impact of this change. r=wtc,eroman Review URL: http://codereview.chromium.org/579010 TBR=jar@chromium.org Review URL: http://codereview.chromium.org/582011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/host_resolver_impl.cc19
-rw-r--r--net/base/net_util.cc45
-rw-r--r--net/base/net_util.h3
3 files changed, 0 insertions, 67 deletions
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 78c9283..cf42dff 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -10,7 +10,6 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/debug_util.h"
-#include "base/field_trial.h"
#include "base/lock.h"
#include "base/message_loop.h"
#include "base/stl_util-inl.h"
@@ -21,7 +20,6 @@
#include "net/base/host_resolver_proc.h"
#include "net/base/load_log.h"
#include "net/base/net_errors.h"
-#include "net/base/net_util.h"
#include "net/base/network_change_notifier.h"
#if defined(OS_WIN)
@@ -55,23 +53,6 @@ HostResolver* CreateSystemHostResolver(
HostResolverImpl* resolver = new HostResolverImpl(
NULL, CreateDefaultCache(), network_change_notifier, kMaxJobs);
- // Measure impact of allowing IPv6 support without probing.
- const FieldTrial::Probability kDivisor = 100;
- const FieldTrial::Probability kProbability = 50; // 50% probability.
- FieldTrial* trial = new FieldTrial("IPv6_Probe", kDivisor);
- int skip_group = trial->AppendGroup("_IPv6_probe_skipped", kProbability);
- trial->AppendGroup("_IPv6_probe_done",
- FieldTrial::kAllRemainingProbability);
- if (trial->group() == skip_group)
- return resolver; // Return without doing probe.
-
- // Perform probe.
- // Some users report confused OS handling of IPv6, leading to large latency.
- // If we can show that IPv6 is not supproted, then disabliing it will wark
- // around such problems.
- if (!IPv6Supported())
- resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4);
-
return resolver;
}
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 01567bc..43fa906 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1538,49 +1538,4 @@ void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports) {
explicitly_allowed_ports = ports;
}
-enum IPv6SupportStatus {
- kIPv6CannotCreateSockets,
- kIPv6CanCreateSockets,
- kIPv6SupportMax // Bounding values for enumeration.
-};
-
-static void IPv6SupportResults(IPv6SupportStatus result) {
- UMA_HISTOGRAM_ENUMERATION("Net.IPv6Status", result, kIPv6SupportMax);
-}
-
-// TODO(jar): The following is a simple estimate of IPv6 support. We may need
-// to do a test resolution, and a test connection, to REALLY verify support.
-// static
-#if defined(OS_POSIX)
-bool IPv6Supported() {
- int test_socket;
-
- test_socket = socket(AF_INET6, SOCK_STREAM, 0);
- if (test_socket == -1) {
- IPv6SupportResults(kIPv6CannotCreateSockets);
- return false;
- }
-
- close(test_socket);
- IPv6SupportResults(kIPv6CanCreateSockets);
- return true;
-}
-#else // defined(OS_POSIX)
-bool IPv6Supported() {
- EnsureWinsockInit();
- SOCKET test_socket;
-
- test_socket = socket(AF_INET6, SOCK_STREAM, 0);
- if (test_socket == INVALID_SOCKET) {
- IPv6SupportResults(kIPv6CannotCreateSockets);
- return false;
- }
-
- closesocket(test_socket);
- IPv6SupportResults(kIPv6CanCreateSockets);
- return true;
-}
-#endif // defined(OS_POSIX)
-
-
} // namespace net
diff --git a/net/base/net_util.h b/net/base/net_util.h
index 7598fd0..d9affe6 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -283,9 +283,6 @@ GURL SimplifyUrlForRequest(const GURL& url);
void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports);
-// Test to see if IPv6 is supported.
-bool IPv6Supported();
-
} // namespace net
#endif // NET_BASE_NET_UTIL_H_