[go: nahoru, domu]

Hard-disable FTP support by always setting disable_ftp_support to true

Also remove the feature and command line flag to enable FTP support.

This still leaves in almost all the code to support FTP, which will be
removed in future CLs.

Bug: 333943
Change-Id: I22d2df358c89893886d9e3c1fac678f9d96bc36c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3075481
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Asanka Herath <asanka@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#910095}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index a970936..23efe164 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -6296,12 +6296,6 @@
      FEATURE_VALUE_TYPE(
          heavy_ad_intervention::features::kHeavyAdPrivacyMitigations)},
 
-#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
-    {"enable-ftp", flag_descriptions::kEnableFtpName,
-     flag_descriptions::kEnableFtpDescription, kOsAll,
-     FEATURE_VALUE_TYPE(network::features::kFtpProtocol)},
-#endif
-
 #if BUILDFLAG(IS_CHROMEOS_ASH)
     {"crosh-swa", flag_descriptions::kCroshSWAName,
      flag_descriptions::kCroshSWADescription, kOsCrOS,
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 900074c..a0f6869 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -153,13 +153,6 @@
     "(raster, webgl, video) "
     " continues using the gpu main thread.";
 
-const char kEnableFtpName[] = "Enable support for FTP URLs";
-const char kEnableFtpDescription[] =
-    "When enabled, the browser will handle navigations to ftp:// URLs by "
-    "either showing a directory listing or downloading the resource over FTP. "
-    "When disabled, the browser has no special handling for ftp:// URLs and "
-    "by default defer handling of the URL to the underlying platform.";
-
 const char kEnablePolicyBlocklistThrottleRequiresPoliciesLoadedName[] =
     "Url blocklist throttle wait for policies to be loaded";
 const char kEnablePolicyBlocklistThrottleRequiresPoliciesLoadedDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 9ba16d9..d745b74 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -120,9 +120,6 @@
 extern const char kEnableDrDcName[];
 extern const char kEnableDrDcDescription[];
 
-extern const char kEnableFtpName[];
-extern const char kEnableFtpDescription[];
-
 extern const char kEnablePolicyBlocklistThrottleRequiresPoliciesLoadedName[];
 extern const char
     kEnablePolicyBlocklistThrottleRequiresPoliciesLoadedDescription[];
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 83c5756b..244cada 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -373,9 +373,6 @@
 // status:"experimental", which are enabled when running web tests.
 const char kEnableBlinkTestFeatures[] = "enable-blink-test-features";
 
-// Enables support for FTP URLs. See https://crbug.com/333943.
-const char kEnableFtp[] = "enable-ftp";
-
 // Disables all RuntimeEnabledFeatures that can be enabled via OriginTrials.
 const char kDisableOriginTrialControlledBlinkFeatures[] =
     "disable-origin-trial-controlled-blink-features";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index ab9b89a..ff10b14 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -112,7 +112,6 @@
 CONTENT_EXPORT extern const char kEnableExperimentalWebPlatformFeatures[];
 CONTENT_EXPORT extern const char kEnableFakeNoAllocDirectCallForTesting[];
 CONTENT_EXPORT extern const char kEnableBlinkTestFeatures[];
-CONTENT_EXPORT extern const char kEnableFtp[];
 CONTENT_EXPORT extern const char kEnableGpuMemoryBufferVideoFrames[];
 CONTENT_EXPORT extern const char kEnableLCDText[];
 CONTENT_EXPORT extern const char kEnableLogging[];
diff --git a/net/features.gni b/net/features.gni
index 247cbdc4..c35c40eb 100644
--- a/net/features.gni
+++ b/net/features.gni
@@ -11,7 +11,10 @@
   # WebSockets and socket stream code are not used on iOS and are optional in
   # cronet.
   enable_websockets = !is_ios
-  disable_ftp_support = is_ios || is_chromecast
+
+  # Disable FTP support.
+  # TODO(https://crbug.com/333943): Fully remove FTP code.
+  disable_ftp_support = true
 
   # Enable Kerberos authentication. It is disabled by default on iOS, Fuchsia
   # and Chromecast, at least for now. This feature needs configuration
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
index 5fd4e5f..6d534fb 100644
--- a/services/network/public/cpp/features.cc
+++ b/services/network/public/cpp/features.cc
@@ -211,11 +211,6 @@
 const base::Feature kAcceptCHFrame{"AcceptCHFrame",
                                    base::FEATURE_DISABLED_BY_DEFAULT};
 
-// Enables support for FTP URLs. When disabled FTP URLs will behave the same as
-// any other URL scheme that's unknown to the UA. See https://crbug.com/333943
-const base::Feature kFtpProtocol{"FtpProtocol",
-                                 base::FEATURE_DISABLED_BY_DEFAULT};
-
 const base::Feature kSCTAuditingRetryAndPersistReports{
     "SCTAuditingRetryAndPersistReports", base::FEATURE_DISABLED_BY_DEFAULT};
 
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
index f482031..9745ec5 100644
--- a/services/network/public/cpp/features.h
+++ b/services/network/public/cpp/features.h
@@ -80,9 +80,6 @@
 extern const base::Feature kAcceptCHFrame;
 
 COMPONENT_EXPORT(NETWORK_CPP)
-extern const base::Feature kFtpProtocol;
-
-COMPONENT_EXPORT(NETWORK_CPP)
 extern const base::Feature kSCTAuditingRetryAndPersistReports;
 
 COMPONENT_EXPORT(NETWORK_CPP)