123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- From: csagan5 <32685696+csagan5@users.noreply.github.com>
- Date: Sun, 18 Nov 2018 13:06:49 +0100
- Subject: Add flag to disable IPv6 probes
- ---
- chrome/browser/about_flags.cc | 5 +++++
- chrome/browser/flag_descriptions.cc | 4 ++++
- chrome/browser/flag_descriptions.h | 3 +++
- components/subresource_filter/tools/BUILD.gn | 6 ++++++
- components/url_formatter/spoof_checks/top_domains/BUILD.gn | 3 ++-
- net/dns/host_resolver_manager.cc | 10 ++++++++--
- services/network/public/cpp/features.cc | 4 ++++
- services/network/public/cpp/features.h | 2 ++
- 8 files changed, 34 insertions(+), 3 deletions(-)
- diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
- --- a/chrome/browser/about_flags.cc
- +++ b/chrome/browser/about_flags.cc
- @@ -3193,6 +3193,11 @@ const FeatureEntry kFeatureEntries[] = {
- kMarkHttpAsFeatureVariations,
- "HTTPReallyBadFinal")},
-
- + {"ipv6-probing",
- + flag_descriptions::kIPv6ProbingName,
- + flag_descriptions::kIPv6ProbingDescription, kOsAll,
- + FEATURE_VALUE_TYPE(network::features::kIPv6Probing)},
- +
- #if !defined(OS_ANDROID)
- {"enable-web-authentication-testing-api",
- flag_descriptions::kEnableWebAuthenticationTestingAPIName,
- diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
- --- a/chrome/browser/flag_descriptions.cc
- +++ b/chrome/browser/flag_descriptions.cc
- @@ -2512,6 +2512,10 @@ const char kForegroundNotificationManagerDescription[] =
- const char kHomePageButtonName[] = "Force Enable Home Page Button";
- const char kHomePageButtonDescription[] = "Displays a home button if enabled.";
-
- +const char kIPv6ProbingName[] = "Enable IPv6 probing.";
- +const char kIPv6ProbingDescription[] =
- + "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.";
- +
- const char kHomepageTileName[] =
- "Enable Homepage tile shown in Suggested Tiles";
- const char kHomepageTileDescription[] =
- diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
- --- a/chrome/browser/flag_descriptions.h
- +++ b/chrome/browser/flag_descriptions.h
- @@ -523,6 +523,9 @@ extern const char kEnableNewDownloadBackendDescription[];
- extern const char kEnablePortalsName[];
- extern const char kEnablePortalsDescription[];
-
- +extern const char kIPv6ProbingName[];
- +extern const char kIPv6ProbingDescription[];
- +
- extern const char kEnablePictureInPictureName[];
- extern const char kEnablePictureInPictureDescription[];
-
- diff --git a/components/subresource_filter/tools/BUILD.gn b/components/subresource_filter/tools/BUILD.gn
- --- a/components/subresource_filter/tools/BUILD.gn
- +++ b/components/subresource_filter/tools/BUILD.gn
- @@ -52,6 +52,8 @@ if (!is_ios) {
- deps = [
- ":tools_lib",
- "//base",
- + "//components/network_session_configurator/common",
- + "//services/network/public/cpp"
- ]
- }
-
- @@ -65,6 +67,8 @@ if (!is_ios) {
- ":tools_lib",
- "../core/common",
- "//base",
- + "//components/network_session_configurator/common",
- + "//services/network/public/cpp",
- ]
- }
-
- @@ -76,6 +80,8 @@ if (!is_ios) {
- "ruleset_converter:support",
- "//base",
- "//third_party/protobuf:protobuf_lite",
- + "//components/network_session_configurator/common",
- + "//services/network/public/cpp"
- ]
- }
-
- diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
- --- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
- +++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
- @@ -78,7 +78,8 @@ executable("make_top_domain_list_for_edit_distance") {
- "//base",
- "//base:i18n",
- "//third_party/icu",
- - "//components/network_session_configurator/common"
- + "//components/network_session_configurator/common",
- + "//services/network/public/cpp",
- ]
- if (is_ios) {
- libs = [ "UIKit.framework" ]
- diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
- --- a/net/dns/host_resolver_manager.cc
- +++ b/net/dns/host_resolver_manager.cc
- @@ -87,6 +87,7 @@
- #include "net/socket/client_socket_factory.h"
- #include "net/socket/datagram_client_socket.h"
- #include "net/url_request/url_request_context.h"
- +#include "services/network/public/cpp/features.h"
- #include "url/url_canon_ip.h"
-
- #if BUILDFLAG(ENABLE_MDNS)
- @@ -3209,8 +3210,13 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) {
- bool cached = true;
- if ((tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
- kIPv6ProbePeriodMs) {
- - last_ipv6_probe_result_ =
- - IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
- + if (!base::FeatureList::IsEnabled(network::features::kIPv6Probing)) {
- + // pretend IPv6 connectivy probe is successful when probing is disabled
- + last_ipv6_probe_result_ = true;
- + } else {
- + last_ipv6_probe_result_ =
- + IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
- + }
- last_ipv6_probe_time_ = tick_clock_->NowTicks();
- cached = false;
- }
- diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
- --- a/services/network/public/cpp/features.cc
- +++ b/services/network/public/cpp/features.cc
- @@ -46,6 +46,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
- const base::Feature kThrottleDelayable{"ThrottleDelayable",
- base::FEATURE_ENABLED_BY_DEFAULT};
-
- +// Enable IPv6 ping probes to RIPE DNS.
- +const base::Feature kIPv6Probing{"IPv6Probing",
- + base::FEATURE_ENABLED_BY_DEFAULT};
- +
- // When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP
- // requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the
- // ResourceScheduler just as HTTP/1.1 resources are. However, requests from such
- diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
- --- a/services/network/public/cpp/features.h
- +++ b/services/network/public/cpp/features.h
- @@ -19,6 +19,8 @@ extern const base::Feature kNetworkErrorLogging;
- COMPONENT_EXPORT(NETWORK_CPP)
- extern const base::Feature kNetworkService;
- COMPONENT_EXPORT(NETWORK_CPP)
- +extern const base::Feature kIPv6Probing;
- +COMPONENT_EXPORT(NETWORK_CPP)
- extern const base::Feature kOutOfBlinkCors;
- COMPONENT_EXPORT(NETWORK_CPP)
- extern const base::Feature kReporting;
- --
- 2.11.0
|