Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "third_party/blink/public/common/features.h" |
| 6 | |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 7 | #include "base/feature_list.h" |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 8 | #include "build/build_config.h" |
Hiroki Nakagawa | 893ee50 | 2019-02-04 06:49:53 | [diff] [blame] | 9 | #include "services/network/public/cpp/features.h" |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 10 | #include "third_party/blink/public/common/forcedark/forcedark_switches.h" |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 11 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 12 | namespace blink { |
| 13 | namespace features { |
| 14 | |
Yao Xiao | 2c1171a | 2019-04-01 23:44:32 | [diff] [blame] | 15 | // Enable intervention for download that was initiated from or occurred in an ad |
| 16 | // frame without user activation. |
| 17 | const base::Feature kBlockingDownloadsInAdFrameWithoutUserActivation{ |
| 18 | "BlockingDownloadsInAdFrameWithoutUserActivation", |
Yao Xiao | 3f9e427 | 2019-05-23 15:22:46 | [diff] [blame] | 19 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Yao Xiao | 2c1171a | 2019-04-01 23:44:32 | [diff] [blame] | 20 | |
Stephen Chenney | 8c442a58 | 2020-06-25 18:18:39 | [diff] [blame] | 21 | // Enable defer commits to avoid flash of unstyled content, for same origin |
| 22 | // navigation only. |
Stephen Chenney | 1bcaec83 | 2019-10-10 18:31:01 | [diff] [blame] | 23 | const base::Feature kPaintHolding{"PaintHolding", |
| 24 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Stephen Chenney | de6e5c8 | 2019-01-21 01:56:04 | [diff] [blame] | 25 | |
Stephen Chenney | 8c442a58 | 2020-06-25 18:18:39 | [diff] [blame] | 26 | // Enable defer commits to avoid flash of unstyled content, for all navigation. |
| 27 | const base::Feature kPaintHoldingCrossOrigin{"PaintHoldingCrossOrigin", |
| 28 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 29 | |
Matt Falkenhagen | c25fea4 | 2018-07-17 07:13:52 | [diff] [blame] | 30 | // Enable eagerly setting up a CacheStorage interface pointer and |
| 31 | // passing it to service workers on startup as an optimization. |
Ben Kelly | 2c1cdd6 | 2020-05-04 22:05:04 | [diff] [blame] | 32 | // TODO(crbug/1077916): Re-enable once the issue with COOP/COEP is fixed. |
Matt Falkenhagen | c25fea4 | 2018-07-17 07:13:52 | [diff] [blame] | 33 | const base::Feature kEagerCacheStorageSetupForServiceWorkers{ |
| 34 | "EagerCacheStorageSetupForServiceWorkers", |
Ben Kelly | 2c1cdd6 | 2020-05-04 22:05:04 | [diff] [blame] | 35 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Matt Falkenhagen | c25fea4 | 2018-07-17 07:13:52 | [diff] [blame] | 36 | |
Peter Kvitek | 197eaf7 | 2018-12-04 19:14:56 | [diff] [blame] | 37 | // Controls script streaming. |
| 38 | const base::Feature kScriptStreaming{"ScriptStreaming", |
| 39 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 40 | |
Leszek Swirski | f75c191 | 2019-05-29 10:08:25 | [diff] [blame] | 41 | // Allow streaming small (<30kB) scripts. |
| 42 | const base::Feature kSmallScriptStreaming{"SmallScriptStreaming", |
| 43 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 44 | |
Keishi Hattori | 9e10692 | 2019-04-15 09:06:03 | [diff] [blame] | 45 | // Enables user level memory pressure signal generation on Android. |
| 46 | const base::Feature kUserLevelMemoryPressureSignal{ |
| 47 | "UserLevelMemoryPressureSignal", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 48 | |
Aditya Keerthi | 6a93390 | 2019-03-14 21:09:27 | [diff] [blame] | 49 | // Perform memory purges after freezing only if all pages are frozen. |
| 50 | const base::Feature kFreezePurgeMemoryAllPagesFrozen{ |
| 51 | "FreezePurgeMemoryAllPagesFrozen", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 52 | |
John Delaney | ac24e57 | 2019-04-30 19:47:02 | [diff] [blame] | 53 | // Freezes the user-agent as part of https://github.com/WICG/ua-client-hints. |
| 54 | const base::Feature kFreezeUserAgent{"FreezeUserAgent", |
| 55 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 56 | |
Minggang Wang | 049d5c5 | 2020-09-03 05:34:46 | [diff] [blame] | 57 | // Enables support for FTP URLs. When disabled FTP URLs will behave the same as |
| 58 | // any other URL scheme that's unknown to the UA. See https://crbug.com/333943 |
| 59 | const base::Feature kFtpProtocol{"FtpProtocol", |
| 60 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 61 | |
Ulan Degenbaev | 13d709c | 2020-07-14 20:15:24 | [diff] [blame] | 62 | const base::Feature kMeasureMemoryExperiment{"MeasureMemoryExperiment", |
| 63 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 64 | |
Vladimir Levin | 43758ecc | 2019-05-09 18:04:03 | [diff] [blame] | 65 | // Enable Display Locking JavaScript APIs. |
| 66 | const base::Feature kDisplayLocking{"DisplayLocking", |
| 67 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 68 | |
Sam Sebree | 2dd45c4f | 2019-12-13 05:51:49 | [diff] [blame] | 69 | const base::Feature kJSONModules{"JSONModules", |
| 70 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 71 | |
Mason Freed | d71a964 | 2020-06-03 01:35:07 | [diff] [blame] | 72 | const base::Feature kForceSynchronousHTMLParsing{ |
| 73 | "ForceSynchronousHTMLParsing", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 74 | |
Camillo Bruni | a19d7fc | 2020-03-17 07:53:35 | [diff] [blame] | 75 | // Enables top-level await in modules. |
| 76 | const base::Feature kTopLevelAwait{"TopLevelAwait", |
| 77 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 78 | |
Yoshifumi Inoue | f88714b | 2020-09-11 05:36:46 | [diff] [blame] | 79 | // Enable EditingNG by default. This feature is for a kill switch. |
| 80 | const base::Feature kEditingNG{"EditingNG", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 81 | |
Ian Kilpatrick | e68ef11a | 2018-07-04 03:52:10 | [diff] [blame] | 82 | // Enable LayoutNG. |
Emil A Eklund | 69eeb56 | 2019-07-03 01:38:30 | [diff] [blame] | 83 | const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT}; |
Ian Kilpatrick | e68ef11a | 2018-07-04 03:52:10 | [diff] [blame] | 84 | |
Kent Tamura | 2f4e1973 | 2020-08-14 03:18:49 | [diff] [blame] | 85 | // Enable LayoutNGFieldset by default. This feature is for a kill switch. |
| 86 | const base::Feature kLayoutNGFieldset{"LayoutNGFieldset", |
| 87 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 88 | |
Kent Tamura | 4187dc9 | 2020-06-18 04:39:35 | [diff] [blame] | 89 | // Enable LayoutNGRuby by default. This feature is for a kill switch. |
| 90 | const base::Feature kLayoutNGRuby{"LayoutNGRuby", |
| 91 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 92 | |
Koji Ishii | 14c52bd | 2020-06-11 17:00:59 | [diff] [blame] | 93 | const base::Feature kFragmentItem{"FragmentItem", |
| 94 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 95 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 96 | const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent", |
Carlos IL | 9970a94 | 2020-02-14 01:16:50 | [diff] [blame] | 97 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 98 | |
Tarun Bansal | 422f901 | 2019-01-23 16:55:58 | [diff] [blame] | 99 | // Used to control the collection of anchor element metrics (crbug.com/856683). |
| 100 | // If kNavigationPredictor is enabled, then metrics of anchor elements |
| 101 | // in the first viewport after the page load and the metrics of the clicked |
| 102 | // anchor element will be extracted and recorded. Additionally, navigation |
| 103 | // predictor may preconnect/prefetch to resources/origins to make the |
| 104 | // future navigations faster. |
Sofiya Semenova | e4e07615 | 2019-07-29 20:10:27 | [diff] [blame] | 105 | const base::Feature kNavigationPredictor { |
| 106 | "NavigationPredictor", |
| 107 | #if defined(OS_ANDROID) |
| 108 | base::FEATURE_ENABLED_BY_DEFAULT |
| 109 | #else |
| 110 | base::FEATURE_DISABLED_BY_DEFAULT |
| 111 | #endif |
| 112 | }; |
Tarun Bansal | 422f901 | 2019-01-23 16:55:58 | [diff] [blame] | 113 | |
Benoit Lize | 66684b2 | 2020-08-07 12:30:22 | [diff] [blame] | 114 | const base::Feature kParentNodeReplaceChildren{ |
| 115 | "ParentNodeReplaceChildren", base::FEATURE_ENABLED_BY_DEFAULT}; |
Yu Han | ae4c3b7 | 2020-07-08 21:48:58 | [diff] [blame] | 116 | |
Hiroki Nakagawa | 61ee004 | 2019-01-22 06:30:26 | [diff] [blame] | 117 | // Enable browser-initiated dedicated worker script loading |
| 118 | // (PlzDedicatedWorker). https://crbug.com/906991 |
| 119 | const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker", |
| 120 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 121 | |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 122 | // Enable Portals. https://crbug.com/865123. |
Jeremy Roman | f369a9d6 | 2020-06-24 19:59:54 | [diff] [blame] | 123 | // For the current origin trial (https://crbug.com/1040212), this is enabled on |
| 124 | // Android only. |
| 125 | const base::Feature kPortals { |
| 126 | "Portals", |
| 127 | #if defined(OS_ANDROID) |
| 128 | base::FEATURE_ENABLED_BY_DEFAULT |
| 129 | #else |
| 130 | base::FEATURE_DISABLED_BY_DEFAULT |
| 131 | #endif |
| 132 | }; |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 133 | |
Jeremy Roman | 20366e4 | 2019-10-22 17:48:08 | [diff] [blame] | 134 | // When kPortals is enabled, allow portals to load content that is third-party |
| 135 | // (cross-origin) to the hosting page. Otherwise has no effect. |
| 136 | // |
Jeremy Roman | 20366e4 | 2019-10-22 17:48:08 | [diff] [blame] | 137 | // https://crbug.com/1013389 |
| 138 | const base::Feature kPortalsCrossOrigin{"PortalsCrossOrigin", |
Jeremy Roman | f369a9d6 | 2020-06-24 19:59:54 | [diff] [blame] | 139 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Jeremy Roman | 20366e4 | 2019-10-22 17:48:08 | [diff] [blame] | 140 | |
Tarun Bansal | 8df12b5 | 2019-02-15 05:46:30 | [diff] [blame] | 141 | // Enable limiting previews loading hints to specific resource types. |
| 142 | const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{ |
| 143 | "PreviewsResourceLoadingHintsSpecificResourceTypes", |
| 144 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 145 | |
Aditya Keerthi | e84331b3 | 2019-03-20 15:25:52 | [diff] [blame] | 146 | // Perform a memory purge after a renderer is backgrounded. Formerly labelled as |
| 147 | // the "PurgeAndSuspend" experiment. |
| 148 | // |
Benoit Lize | 4313f09 | 2020-09-10 15:13:50 | [diff] [blame] | 149 | // TODO(https://crbug.com/926186): Disabled by default on Android for historical |
Aditya Keerthi | e84331b3 | 2019-03-20 15:25:52 | [diff] [blame] | 150 | // reasons. Consider enabling by default if experiment results are positive. |
Aditya Keerthi | e84331b3 | 2019-03-20 15:25:52 | [diff] [blame] | 151 | const base::Feature kPurgeRendererMemoryWhenBackgrounded { |
| 152 | "PurgeRendererMemoryWhenBackgrounded", |
Benoit Lize | 4313f09 | 2020-09-10 15:13:50 | [diff] [blame] | 153 | #if defined(OS_ANDROID) |
Aditya Keerthi | e84331b3 | 2019-03-20 15:25:52 | [diff] [blame] | 154 | base::FEATURE_DISABLED_BY_DEFAULT |
| 155 | #else |
| 156 | base::FEATURE_ENABLED_BY_DEFAULT |
| 157 | #endif |
| 158 | }; |
| 159 | |
David Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 160 | // Enable Implicit Root Scroller. https://crbug.com/903260. |
David Bokan | 145b547 | 2019-05-22 14:38:44 | [diff] [blame] | 161 | // TODO(bokan): Temporarily disabled on desktop platforms to address issues |
| 162 | // with non-overlay scrollbars. https://crbug.com/948059. |
| 163 | const base::Feature kImplicitRootScroller { |
| 164 | "ImplicitRootScroller", |
| 165 | #if defined(OS_ANDROID) |
| 166 | base::FEATURE_ENABLED_BY_DEFAULT |
| 167 | #else |
| 168 | base::FEATURE_DISABLED_BY_DEFAULT |
| 169 | #endif |
| 170 | }; |
David Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 171 | |
Cathie Chen | eac7060 | 2019-10-10 02:55:29 | [diff] [blame] | 172 | // Enable CSSOM View Scroll Coordinates. https://crbug.com/721759. |
| 173 | const base::Feature kCSSOMViewScrollCoordinates{ |
| 174 | "CSSOMViewScrollCoordinates", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 175 | |
Darwin Huang | f588cc8e | 2019-12-13 22:24:56 | [diff] [blame] | 176 | // Enables Raw Clipboard. https://crbug.com/897289. |
| 177 | const base::Feature kRawClipboard{"RawClipboard", |
| 178 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 179 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 180 | // Enables usage of getDisplayMedia() that allows capture of web content, see |
| 181 | // https://crbug.com/865060. |
| 182 | const base::Feature kRTCGetDisplayMedia{"RTCGetDisplayMedia", |
| 183 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 184 | |
| 185 | // Changes the default RTCPeerConnection constructor behavior to use Unified |
| 186 | // Plan as the SDP semantics. When the feature is enabled, Unified Plan is used |
| 187 | // unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the |
| 188 | // argument). |
| 189 | const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault", |
Henrik Boström | 07021ec8 | 2019-01-17 22:23:56 | [diff] [blame] | 190 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 191 | |
Johannes Kron | ad5a453 | 2019-01-09 11:17:46 | [diff] [blame] | 192 | // Determines if the SDP attrbute extmap-allow-mixed should be offered by |
| 193 | // default or not. The default value can be overridden by passing |
| 194 | // {offerExtmapAllowMixed:true} as an argument to the RTCPeerConnection |
| 195 | // constructor. |
| 196 | const base::Feature kRTCOfferExtmapAllowMixed{ |
| 197 | "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 198 | |
Ulan Degenbaev | 4b3bc29b | 2020-03-13 17:09:00 | [diff] [blame] | 199 | // Prevents workers from sending IsolateInBackgroundNotification to V8 |
| 200 | // and thus instructs V8 to favor performance over memory on workers. |
| 201 | const base::Feature kV8OptimizeWorkersForPerformance{ |
Ulan Degenbaev | 7acd73ea | 2020-04-07 16:02:33 | [diff] [blame] | 202 | "V8OptimizeWorkersForPerformance", base::FEATURE_ENABLED_BY_DEFAULT}; |
Ulan Degenbaev | 4b3bc29b | 2020-03-13 17:09:00 | [diff] [blame] | 203 | |
Antonio Gomes | b471857 | 2019-09-11 02:55:48 | [diff] [blame] | 204 | // Enables negotiation of experimental multiplex codec in SDP. |
| 205 | const base::Feature kWebRtcMultiplexCodec{"WebRTC-MultiplexCodec", |
| 206 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 207 | |
| 208 | // Causes WebRTC to replace host ICE candidate IP addresses with generated |
| 209 | // names ending in ".local" and resolve them using mDNS. |
| 210 | // http://crbug.com/878465 |
| 211 | const base::Feature kWebRtcHideLocalIpsWithMdns{ |
| 212 | "WebRtcHideLocalIpsWithMdns", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 213 | |
OlivierLi | 95a0f6a5 | 2020-06-18 15:40:08 | [diff] [blame] | 214 | // When enabled, wake ups from throttleable TaskQueues are limited to 1 per |
| 215 | // minute in a page that has been backgrounded for 5 minutes. |
| 216 | // |
| 217 | // Intensive wake up throttling is enforced in addition to other throttling |
| 218 | // mechanisms: |
| 219 | // - 1 wake up per second in a background page or hidden cross-origin frame |
| 220 | // - 1% CPU time in a page that has been backgrounded for 10 seconds |
| 221 | // |
| 222 | // Feature tracking bug: https://crbug.com/1075553 |
| 223 | // |
| 224 | // Note that the base::Feature should not be read from; |
| 225 | // rather the provided accessors should be used, which also take into account |
| 226 | // the managed policy override of the feature. |
| 227 | const base::Feature kIntensiveWakeUpThrottling{ |
| 228 | "IntensiveWakeUpThrottling", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 229 | |
Olivier Li | 5f02c1a | 2020-07-31 16:13:44 | [diff] [blame] | 230 | // When enabled, timers with timeout=0 are not throttled. |
| 231 | const base::Feature kOptOutZeroTimeoutTimersFromThrottling{ |
| 232 | "OptOutZeroTimeoutTimersFromThrottling", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 233 | |
Francois Doray | 66c328cb | 2020-07-13 15:46:13 | [diff] [blame] | 234 | // When enabled, no throttling is applied to a page when it uses WebRTC. |
| 235 | // |
| 236 | // This allows a page to use a timer to do video processing on frames. An |
| 237 | // event-driven mechanism should be provided to do video processing. When it is |
| 238 | // available, this feature should be removed. https://crbug.com/1101806 |
| 239 | const base::Feature kOptOutWebRTCFromAllThrottling{ |
| 240 | "OptOutWebRTCFromAllThrottling", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 241 | |
Francois Doray | 6cff4e0 | 2020-07-01 01:12:58 | [diff] [blame] | 242 | // Name of the parameter that controls the grace period during which there is no |
| 243 | // intensive wake up throttling after a page is hidden. Defined here to allow |
| 244 | // access from about_flags.cc. The FeatureParam is defined in |
| 245 | // third_party/blink/renderer/platform/scheduler/common/features.cc. |
| 246 | const char kIntensiveWakeUpThrottling_GracePeriodSeconds_Name[] = |
| 247 | "grace_period_seconds"; |
| 248 | |
Antonio Gomes | f3bcd51 | 2019-09-03 21:27:17 | [diff] [blame] | 249 | #if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) |
| 250 | // Run-time feature for the |rtc_use_h264| encoder/decoder. |
| 251 | const base::Feature kWebRtcH264WithOpenH264FFmpeg{ |
| 252 | "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 253 | #endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) |
| 254 | |
Makoto Shimazu | a8b3d74 | 2019-04-05 06:55:51 | [diff] [blame] | 255 | // Experiment of the delay from navigation to starting an update of a service |
| 256 | // worker's script. |
| 257 | const base::Feature kServiceWorkerUpdateDelay{ |
| 258 | "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 259 | |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 260 | // Freeze scheduler task queues in background after allowed grace time. |
| 261 | // "stop" is a legacy name. |
| 262 | const base::Feature kStopInBackground { |
| 263 | "stop-in-background", |
| 264 | #if defined(OS_ANDROID) |
| 265 | base::FEATURE_ENABLED_BY_DEFAULT |
| 266 | #else |
| 267 | base::FEATURE_DISABLED_BY_DEFAULT |
| 268 | #endif |
| 269 | }; |
| 270 | |
Takashi Sakamoto | c19fc2b | 2019-04-10 06:30:52 | [diff] [blame] | 271 | // Freeze scheduler task queues in background on network idle. |
| 272 | // This feature only works if stop-in-background is enabled. |
| 273 | const base::Feature kFreezeBackgroundTabOnNetworkIdle{ |
| 274 | "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 275 | |
Shubhie Panicker | 60bd4b0 | 2018-09-26 00:02:15 | [diff] [blame] | 276 | // Freeze non-timer task queues in background, after allowed grace time. |
| 277 | // "stop" is a legacy name. |
Dave Tapuska | 9140c55 | 2019-05-30 16:18:56 | [diff] [blame] | 278 | const base::Feature kStopNonTimersInBackground{ |
| 279 | "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT}; |
Scott Haseley | 7757f6c | 2018-08-03 14:33:23 | [diff] [blame] | 280 | |
Brandon Maslen | da12cf8 | 2019-08-23 20:54:18 | [diff] [blame] | 281 | // Enable the Storage Access API. https://crbug.com/989663. |
| 282 | const base::Feature kStorageAccessAPI{"StorageAccessAPI", |
| 283 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 284 | |
David Bokan | e9370c2 | 2019-02-14 15:19:58 | [diff] [blame] | 285 | // Enable text snippets in URL fragments. https://crbug.com/919204. |
| 286 | const base::Feature kTextFragmentAnchor{"TextFragmentAnchor", |
Nick Burris | 62f8d5f0 | 2020-01-16 22:54:51 | [diff] [blame] | 287 | base::FEATURE_ENABLED_BY_DEFAULT}; |
David Bokan | e9370c2 | 2019-02-14 15:19:58 | [diff] [blame] | 288 | |
Marijn Kruisselbrink | ca4bb5e | 2019-04-22 18:19:42 | [diff] [blame] | 289 | // Writable files and native file system access. https://crbug.com/853326 |
| 290 | const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI", |
Marijn Kruisselbrink | 4cc3ec2 | 2019-09-04 16:28:20 | [diff] [blame] | 291 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 292 | |
Jay Harris | 583f4892 | 2019-05-06 05:55:24 | [diff] [blame] | 293 | // File handling integration. https://crbug.com/829689 |
| 294 | const base::Feature kFileHandlingAPI{"FileHandlingAPI", |
| 295 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 296 | |
kdillon | 66bf5b52 | 2019-01-02 22:08:30 | [diff] [blame] | 297 | // Allows for synchronous XHR requests during page dismissal |
Katie Dillon | 8b35731 | 2019-09-19 13:23:23 | [diff] [blame] | 298 | const base::Feature kAllowSyncXHRInPageDismissal{ |
| 299 | "AllowSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT}; |
kdillon | 66bf5b52 | 2019-01-02 22:08:30 | [diff] [blame] | 300 | |
Olivier Yiptong | b60d2c4 | 2020-01-10 22:47:15 | [diff] [blame] | 301 | // Font enumeration and table access. https://crbug.com/535764 and |
| 302 | // https://crbug.com/982054. |
| 303 | const base::Feature kFontAccess{"FontAccess", |
| 304 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 305 | |
Mason Freed | 6f14631 | 2020-06-27 05:12:55 | [diff] [blame] | 306 | // Allows Web Components v0 to be re-enabled. |
| 307 | const base::Feature kWebComponentsV0{"WebComponentsV0", |
| 308 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 309 | |
Dominic Farolino | 780df94 | 2019-09-04 06:49:44 | [diff] [blame] | 310 | // Prefetch request properties are updated to be privacy-preserving. See |
| 311 | // crbug.com/988956. |
| 312 | const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges", |
| 313 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Dominic Farolino | 693fd72d | 2019-08-05 11:09:44 | [diff] [blame] | 314 | |
Carlos IL | d3be52b | 2018-10-08 17:57:18 | [diff] [blame] | 315 | const char kMixedContentAutoupgradeModeParamName[] = "mode"; |
Carlos IL | 9970a94 | 2020-02-14 01:16:50 | [diff] [blame] | 316 | const char kMixedContentAutoupgradeModeAllPassive[] = "all-passive"; |
Carlos IL | d3be52b | 2018-10-08 17:57:18 | [diff] [blame] | 317 | |
Sasha McIntosh | e889f9f | 2019-09-03 21:01:57 | [diff] [blame] | 318 | // Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this |
| 319 | // format in the image decode cache. See crbug.com/919627 for details on the |
| 320 | // feature. |
Sasha McIntosh | 80b9eb02 | 2020-09-03 04:37:25 | [diff] [blame] | 321 | const base::Feature kDecodeJpeg420ImagesToYUV{"DecodeJpeg420ImagesToYUV", |
| 322 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Sasha McIntosh | e889f9f | 2019-09-03 21:01:57 | [diff] [blame] | 323 | |
Madeleine Barowsky | 45be21a4 | 2018-12-07 18:39:30 | [diff] [blame] | 324 | // Decodes lossy WebP images to YUV instead of RGBX and stores in this format |
| 325 | // in the image decode cache. See crbug.com/900264 for details on the feature. |
| 326 | const base::Feature kDecodeLossyWebPImagesToYUV{ |
Sasha McIntosh | f670a6b | 2020-01-09 18:27:09 | [diff] [blame] | 327 | "DecodeLossyWebPImagesToYUV", base::FEATURE_ENABLED_BY_DEFAULT}; |
Madeleine Barowsky | 45be21a4 | 2018-12-07 18:39:30 | [diff] [blame] | 328 | |
Takashi Toyoshima | a91506d | 2019-03-28 05:44:42 | [diff] [blame] | 329 | // Enables cache-aware WebFonts loading. See https://crbug.com/570205. |
| 330 | // The feature is disabled on Android for WebView API issue discussed at |
| 331 | // https://crbug.com/942440. |
| 332 | const base::Feature kWebFontsCacheAwareTimeoutAdaption { |
| 333 | "WebFontsCacheAwareTimeoutAdaption", |
| 334 | #if defined(OS_ANDROID) |
| 335 | base::FEATURE_DISABLED_BY_DEFAULT |
| 336 | #else |
| 337 | base::FEATURE_ENABLED_BY_DEFAULT |
| 338 | #endif |
| 339 | }; |
| 340 | |
Ehsan Karamad | be95d12 | 2019-05-10 17:59:06 | [diff] [blame] | 341 | // Enabled to block programmatic focus in subframes when not triggered by user |
| 342 | // activation (see htpps://crbug.com/954349). |
| 343 | const base::Feature kBlockingFocusWithoutUserActivation{ |
| 344 | "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 345 | |
Hongchan Choi | 370d3af | 2019-05-20 20:56:58 | [diff] [blame] | 346 | const base::Feature kAudioWorkletRealtimeThread{ |
| 347 | "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 348 | |
Ryan Sturm | 139c3ac | 2019-07-12 18:52:53 | [diff] [blame] | 349 | // A feature to reduce the set of resources fetched by No-State Prefetch. |
Robert Ogden | 2bb6a252 | 2020-06-05 00:28:10 | [diff] [blame] | 350 | const base::Feature kLightweightNoStatePrefetch { |
Ryan Sturm | f223cb0 | 2019-10-04 18:02:00 | [diff] [blame] | 351 | "LightweightNoStatePrefetch", |
| 352 | #if defined(OS_ANDROID) |
| 353 | base::FEATURE_ENABLED_BY_DEFAULT |
| 354 | #else |
| 355 | base::FEATURE_DISABLED_BY_DEFAULT |
| 356 | #endif |
| 357 | }; |
Ryan Sturm | 139c3ac | 2019-07-12 18:52:53 | [diff] [blame] | 358 | |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 359 | // Automatically convert light-themed pages to use a Blink-generated dark theme |
| 360 | const base::Feature kForceWebContentsDarkMode{ |
| 361 | "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 362 | |
Michael Crouse | b7acd77 | 2020-02-20 02:56:26 | [diff] [blame] | 363 | // A feature to enable using the smallest image specified within image srcset |
| 364 | // for users with Save Data enabled. |
| 365 | const base::Feature kSaveDataImgSrcset{"SaveDataImgSrcset", |
| 366 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 367 | |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 368 | // Which algorithm should be used for color inversion? |
| 369 | const base::FeatureParam<ForceDarkInversionMethod>::Option |
| 370 | forcedark_inversion_method_options[] = { |
| 371 | {ForceDarkInversionMethod::kUseBlinkSettings, |
| 372 | "use_blink_settings_for_method"}, |
| 373 | {ForceDarkInversionMethod::kHslBased, "hsl_based"}, |
Aran Gilman | 8b3ca41c | 2019-08-12 18:59:04 | [diff] [blame] | 374 | {ForceDarkInversionMethod::kCielabBased, "cielab_based"}, |
| 375 | {ForceDarkInversionMethod::kRgbBased, "rgb_based"}}; |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 376 | |
| 377 | const base::FeatureParam<ForceDarkInversionMethod> |
| 378 | kForceDarkInversionMethodParam{&kForceWebContentsDarkMode, |
| 379 | "inversion_method", |
| 380 | ForceDarkInversionMethod::kUseBlinkSettings, |
| 381 | &forcedark_inversion_method_options}; |
| 382 | |
| 383 | // Should images be inverted? |
| 384 | const base::FeatureParam<ForceDarkImageBehavior>::Option |
| 385 | forcedark_image_behavior_options[] = { |
| 386 | {ForceDarkImageBehavior::kUseBlinkSettings, |
| 387 | "use_blink_settings_for_images"}, |
| 388 | {ForceDarkImageBehavior::kInvertNone, "none"}, |
| 389 | {ForceDarkImageBehavior::kInvertSelectively, "selective"}}; |
| 390 | |
| 391 | const base::FeatureParam<ForceDarkImageBehavior> kForceDarkImageBehaviorParam{ |
| 392 | &kForceWebContentsDarkMode, "image_behavior", |
| 393 | ForceDarkImageBehavior::kUseBlinkSettings, |
| 394 | &forcedark_image_behavior_options}; |
| 395 | |
| 396 | // Do not invert text lighter than this. |
| 397 | // Range: 0 (do not invert any text) to 256 (invert all text) |
| 398 | // Can also set to -1 to let Blink's internal settings control the value |
| 399 | const base::FeatureParam<int> kForceDarkTextLightnessThresholdParam{ |
| 400 | &kForceWebContentsDarkMode, "text_lightness_threshold", -1}; |
| 401 | |
| 402 | // Do not invert backgrounds darker than this. |
| 403 | // Range: 0 (invert all backgrounds) to 256 (invert no backgrounds) |
| 404 | // Can also set to -1 to let Blink's internal settings control the value |
| 405 | const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{ |
| 406 | &kForceWebContentsDarkMode, "background_lightness_threshold", -1}; |
| 407 | |
Sergey Silkin | c33244f | 2020-01-31 17:21:30 | [diff] [blame] | 408 | // Instructs WebRTC to honor the Min/Max Video Encode Accelerator dimensions. |
Miguel Casas-Sanchez | b612839 | 2020-02-18 15:45:39 | [diff] [blame] | 409 | const base::Feature kWebRtcUseMinMaxVEADimensions { |
| 410 | "WebRtcUseMinMaxVEADimensions", |
| 411 | // TODO(crbug.com/1008491): enable other platforms. |
| 412 | #if defined(OS_CHROMEOS) |
| 413 | base::FEATURE_ENABLED_BY_DEFAULT |
| 414 | #else |
| 415 | base::FEATURE_DISABLED_BY_DEFAULT |
| 416 | #endif |
| 417 | }; |
Sergey Silkin | c33244f | 2020-01-31 17:21:30 | [diff] [blame] | 418 | |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 419 | // Blink garbage collection. |
| 420 | // Enables compaction of backing stores on Blink's heap. |
| 421 | const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction", |
| 422 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 423 | // Enables concurrently marking Blink's heap. |
| 424 | const base::Feature kBlinkHeapConcurrentMarking{ |
Omer Katz | 1757893c | 2020-02-17 12:09:19 | [diff] [blame] | 425 | "BlinkHeapConcurrentMarking", base::FEATURE_ENABLED_BY_DEFAULT}; |
Anton Bikineev | 9b7b372 | 2019-07-09 13:48:39 | [diff] [blame] | 426 | // Enables concurrently sweeping Blink's heap. |
| 427 | const base::Feature kBlinkHeapConcurrentSweeping{ |
Anton Bikineev | 204cc75 | 2019-08-07 00:26:37 | [diff] [blame] | 428 | "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT}; |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 429 | // Enables incrementally marking Blink's heap. |
| 430 | const base::Feature kBlinkHeapIncrementalMarking{ |
| 431 | "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 432 | // Enables a marking stress mode that schedules more garbage collections and |
| 433 | // also adds additional verification passes. |
| 434 | const base::Feature kBlinkHeapIncrementalMarkingStress{ |
| 435 | "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT}; |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 436 | |
Yoav Weiss | ddfb8d2e | 2019-07-15 22:34:03 | [diff] [blame] | 437 | // Enables removing AppCache delays when triggering requests when the HTML was |
| 438 | // not fetched from AppCache. |
| 439 | const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{ |
| 440 | "VerifyHTMLFetchedFromAppCacheBeforeDelay", |
| 441 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 442 | |
Michael Spang | 8d2303e | 2019-07-26 01:56:32 | [diff] [blame] | 443 | // Controls whether we use ThreadPriority::DISPLAY for renderer |
| 444 | // compositor & IO threads. |
| 445 | const base::Feature kBlinkCompositorUseDisplayThreadPriority { |
| 446 | "BlinkCompositorUseDisplayThreadPriority", |
Sunny Sachanandani | 1694425 | 2019-12-04 03:40:49 | [diff] [blame] | 447 | #if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN) |
Michael Spang | 8d2303e | 2019-07-26 01:56:32 | [diff] [blame] | 448 | base::FEATURE_ENABLED_BY_DEFAULT |
| 449 | #else |
| 450 | base::FEATURE_DISABLED_BY_DEFAULT |
| 451 | #endif |
| 452 | }; |
| 453 | |
Yuki Shiino | a812f49 | 2019-08-23 06:47:46 | [diff] [blame] | 454 | // Ignores cross origin windows in the named property interceptor of Window. |
| 455 | // https://crbug.com/538562 |
| 456 | const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{ |
| 457 | "IgnoreCrossOriginWindowWhenNamedAccessOnWindow", |
| 458 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 459 | |
Tarun Bansal | 3879246 | 2019-09-04 16:08:11 | [diff] [blame] | 460 | // When enabled, loading priority of JavaScript requests is lowered when they |
| 461 | // are force deferred by the intervention. |
| 462 | const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{ |
| 463 | "LowerJavaScriptPriorityWhenForceDeferred", |
Tarun Bansal | 755268fe | 2019-10-18 18:57:40 | [diff] [blame] | 464 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Tarun Bansal | 3879246 | 2019-09-04 16:08:11 | [diff] [blame] | 465 | |
Tarun Bansal | f32aaa2 | 2020-02-12 16:16:44 | [diff] [blame] | 466 | // When enabled, scripts in iframes are not force deferred by the DeferAllScript |
| 467 | // intervention. |
| 468 | const base::Feature kDisableForceDeferInChildFrames{ |
| 469 | "DisableForceDeferInChildFrames", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 470 | |
rajendrant | d5db55f | 2019-10-19 01:56:59 | [diff] [blame] | 471 | // Enables redirecting subresources in the page to better compressed and |
| 472 | // optimized versions to provide data savings. |
| 473 | const base::Feature kSubresourceRedirect{"SubresourceRedirect", |
| 474 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 475 | |
Stefan Zager | fd18161c | 2019-10-22 20:44:31 | [diff] [blame] | 476 | // When 'enabled', all cross-origin iframes will get a compositing layer. |
| 477 | const base::Feature kCompositeCrossOriginIframes{ |
| 478 | "CompositeCrossOriginIframes", base::FEATURE_DISABLED_BY_DEFAULT}; |
Yutaka Hirano | 0b3c319b | 2019-10-25 17:19:15 | [diff] [blame] | 479 | |
Chris Harrelson | 70be13d | 2020-06-03 21:06:52 | [diff] [blame] | 480 | // When enabled, enforces new interoperable semantics for 3D transforms. |
| 481 | // See crbug.com/1008483. |
| 482 | const base::Feature kTransformInterop{"TransformInterop", |
| 483 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 484 | |
Yutaka Hirano | 0b3c319b | 2019-10-25 17:19:15 | [diff] [blame] | 485 | // When enabled, beacons (and friends) have ResourceLoadPriority::kLow, |
| 486 | // not ResourceLoadPriority::kVeryLow. |
| 487 | const base::Feature kSetLowPriorityForBeacon{"SetLowPriorityForBeacon", |
| 488 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 489 | |
Ben Kelly | 776f59d | 2019-11-06 16:25:30 | [diff] [blame] | 490 | // When enabled allows the header name used in the blink |
| 491 | // CacheStorageCodeCacheHint runtime feature to be modified. This runtime |
| 492 | // feature disables generating full code cache for responses stored in |
| 493 | // cache_storage during a service worker install event. The runtime feature |
| 494 | // must be enabled via the blink runtime feature mechanism, however. |
| 495 | const base::Feature kCacheStorageCodeCacheHintHeader{ |
| 496 | "CacheStorageCodeCacheHintHeader", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 497 | const base::FeatureParam<std::string> kCacheStorageCodeCacheHintHeaderName{ |
| 498 | &kCacheStorageCodeCacheHintHeader, "name", "x-CacheStorageCodeCacheHint"}; |
| 499 | |
Francois Doray | 56345343 | 2019-11-20 15:32:17 | [diff] [blame] | 500 | // When enabled, the beforeunload handler is dispatched when a frame is frozen. |
| 501 | // This allows the browser to know whether discarding the frame could result in |
| 502 | // lost user data, at the cost of extra CPU usage. The feature will be removed |
| 503 | // once we have determine whether the CPU cost is acceptable. |
| 504 | const base::Feature kDispatchBeforeUnloadOnFreeze{ |
| 505 | "DispatchBeforeUnloadOnFreeze", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 506 | |
Sunny Sachanandani | 2646342 | 2019-12-05 21:35:40 | [diff] [blame] | 507 | // Enables the use of GpuMemoryBuffer images for low latency 2d canvas. |
| 508 | // TODO(khushalsagar): Enable this if we're using SurfaceControl and GMBs allow |
| 509 | // us to overlay these resources. |
| 510 | const base::Feature kLowLatencyCanvas2dImageChromium { |
| 511 | "LowLatencyCanvas2dImageChromium", |
| 512 | #if defined(OS_CHROMEOS) |
| 513 | base::FEATURE_ENABLED_BY_DEFAULT |
| 514 | #else |
| 515 | base::FEATURE_DISABLED_BY_DEFAULT |
| 516 | #endif // OS_CHROMEOS |
| 517 | }; |
| 518 | |
| 519 | // Enables the use of shared image swap chains for low latency 2d canvas. |
| 520 | const base::Feature kLowLatencyCanvas2dSwapChain{ |
Sunny Sachanandani | b954dc7c | 2019-12-12 02:50:51 | [diff] [blame] | 521 | "LowLatencyCanvas2dSwapChain", base::FEATURE_ENABLED_BY_DEFAULT}; |
Sunny Sachanandani | 2646342 | 2019-12-05 21:35:40 | [diff] [blame] | 522 | |
| 523 | // Enables the use of shared image swap chains for low latency webgl canvas. |
Sunny Sachanandani | b954dc7c | 2019-12-12 02:50:51 | [diff] [blame] | 524 | const base::Feature kLowLatencyWebGLSwapChain{"LowLatencyWebGLSwapChain", |
| 525 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Sunny Sachanandani | 2646342 | 2019-12-05 21:35:40 | [diff] [blame] | 526 | |
Stephen White | e17b023 | 2020-04-27 23:48:49 | [diff] [blame] | 527 | // Enables Dawn-accelerated 2D canvas. |
| 528 | const base::Feature kDawn2dCanvas{"Dawn2dCanvas", |
| 529 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 530 | |
Xiaocheng Hu | d5197fd | 2020-02-06 07:26:08 | [diff] [blame] | 531 | const base::Feature kCSSReducedFontLoadingInvalidations{ |
Xiaocheng Hu | 75bafe5 | 2020-06-22 22:54:27 | [diff] [blame] | 532 | "CSSReducedFontLoadingInvalidations", base::FEATURE_ENABLED_BY_DEFAULT}; |
Xiaocheng Hu | e5ff8e1 | 2020-06-16 21:47:35 | [diff] [blame] | 533 | const base::Feature kCSSReducedFontLoadingLayoutInvalidations{ |
| 534 | "CSSReducedFontLoadingLayoutInvalidations", |
| 535 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Xiaocheng Hu | d5197fd | 2020-02-06 07:26:08 | [diff] [blame] | 536 | |
Egor Pasko | 28ec4695 | 2020-02-07 15:17:57 | [diff] [blame] | 537 | // When enabled, frees up CachedMetadata after consumption by script resources |
| 538 | // and modules. Needed for the experiment in http://crbug.com/1045052. |
| 539 | const base::Feature kDiscardCodeCacheAfterFirstUse{ |
| 540 | "DiscardCodeCacheAfterFirstUse", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 541 | |
Yutaka Hirano | bf410a4 | 2020-02-18 08:08:45 | [diff] [blame] | 542 | // The kill-switch for the fix for https://crbug.com/1051439. |
| 543 | // TODO(crbug.com/1053369): Remove this around M84. |
| 544 | const base::Feature kSuppressContentTypeForBeaconMadeWithArrayBufferView{ |
| 545 | "SuppressContentTypeForBeaconMadeWithArrayBufferView", |
| 546 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 547 | |
Rune Lillesveen | 61f49ee | 2020-03-02 07:53:49 | [diff] [blame] | 548 | const base::Feature kBlockHTMLParserOnStyleSheets{ |
| 549 | "BlockHTMLParserOnStyleSheets", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 550 | |
Mason Freed | 0ebaa77 | 2020-06-03 16:11:08 | [diff] [blame] | 551 | // Kill switch for the new <link disabled> behavior. |
| 552 | // TODO(crbug.com/1087043): Remove this once the feature has |
| 553 | // landed and no compat issues are reported. |
| 554 | const base::Feature kLinkDisabledNewSpecBehavior{ |
| 555 | "LinkDisabledNewSpecBehavior", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 556 | |
Xiaocheng Hu | d2e807d | 2020-03-04 21:15:21 | [diff] [blame] | 557 | // Slightly delays rendering if there are fonts being preloaded, so that |
| 558 | // they don't miss the first paint if they can be loaded fast enough (e.g., |
| 559 | // from the disk cache) |
| 560 | const base::Feature kFontPreloadingDelaysRendering{ |
Xiaocheng Hu | e60457d | 2020-07-20 06:09:54 | [diff] [blame] | 561 | "FontPreloadingDelaysRendering", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 562 | // 50ms is the overall best performing value in our experiments. |
Xiaocheng Hu | d2e807d | 2020-03-04 21:15:21 | [diff] [blame] | 563 | const base::FeatureParam<int> kFontPreloadingDelaysRenderingParam{ |
Xiaocheng Hu | e60457d | 2020-07-20 06:09:54 | [diff] [blame] | 564 | &kFontPreloadingDelaysRendering, "delay-in-ms", 50}; |
Xiaocheng Hu | d2e807d | 2020-03-04 21:15:21 | [diff] [blame] | 565 | |
David Grogan | 565f8bb | 2020-05-27 03:07:40 | [diff] [blame] | 566 | const base::Feature kFlexNG{"FlexNG", base::FEATURE_ENABLED_BY_DEFAULT}; |
David Grogan | 5b3cf16 | 2020-03-19 21:53:15 | [diff] [blame] | 567 | |
Dominic Farolino | 0f55a08 | 2020-03-24 09:47:55 | [diff] [blame] | 568 | const base::Feature kKeepScriptResourceAlive{"KeepScriptResourceAlive", |
| 569 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Dominic Farolino | 7d3d6f1 | 2020-06-10 21:59:46 | [diff] [blame] | 570 | const base::Feature kDelayAsyncScriptExecution{ |
| 571 | "DelayAsyncScriptExecution", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 572 | const base::FeatureParam<DelayAsyncScriptDelayType>::Option |
| 573 | delay_async_script_execution_delay_types[] = { |
| 574 | {DelayAsyncScriptDelayType::kFinishedParsing, "finished_parsing"}, |
| 575 | {DelayAsyncScriptDelayType::kFirstPaintOrFinishedParsing, |
Dominic Farolino | 5327085 | 2020-08-06 22:28:00 | [diff] [blame] | 576 | "first_paint_or_finished_parsing"}, |
| 577 | {DelayAsyncScriptDelayType::kUseOptimizationGuide, |
| 578 | "use_optimization_guide"}}; |
Dominic Farolino | 7d3d6f1 | 2020-06-10 21:59:46 | [diff] [blame] | 579 | const base::FeatureParam<DelayAsyncScriptDelayType> |
| 580 | kDelayAsyncScriptExecutionDelayParam{ |
| 581 | &kDelayAsyncScriptExecution, "delay_type", |
| 582 | DelayAsyncScriptDelayType::kFinishedParsing, |
| 583 | &delay_async_script_execution_delay_types}; |
Dominic Farolino | 0f55a08 | 2020-03-24 09:47:55 | [diff] [blame] | 584 | |
Dominic Farolino | 0dc1376 | 2020-08-26 19:54:50 | [diff] [blame] | 585 | // Feature and parameters for delaying low priority requests behind "important" |
| 586 | // (either high or medium priority requests). There are two parameters |
| 587 | // highlighted below. |
| 588 | const base::Feature kDelayCompetingLowPriorityRequests{ |
| 589 | "DelayCompetingLowPriorityRequests", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 590 | // The delay type: We don't want to delay low priority requests behind |
| 591 | // "important" requests forever. Rather, it makes sense to have this behavior up |
| 592 | // *until* some relevant loading milestone, which this parameter specifies. |
| 593 | const base::FeatureParam<DelayCompetingLowPriorityRequestsDelayType>::Option |
| 594 | delay_competing_low_priority_requests_delay_types[] = { |
| 595 | {DelayCompetingLowPriorityRequestsDelayType::kFirstPaint, |
| 596 | "first_paint"}, |
| 597 | {DelayCompetingLowPriorityRequestsDelayType::kFirstContentfulPaint, |
| 598 | "first_contentful_paint"}, |
Hiroki Nakagawa | 5c969016 | 2020-09-07 05:45:24 | [diff] [blame] | 599 | {DelayCompetingLowPriorityRequestsDelayType::kAlways, "always"}, |
| 600 | {DelayCompetingLowPriorityRequestsDelayType::kUseOptimizationGuide, |
| 601 | "use_optimization_guide"}}; |
Dominic Farolino | 0dc1376 | 2020-08-26 19:54:50 | [diff] [blame] | 602 | const base::FeatureParam<DelayCompetingLowPriorityRequestsDelayType> |
| 603 | kDelayCompetingLowPriorityRequestsDelayParam{ |
| 604 | &kDelayCompetingLowPriorityRequests, "until", |
| 605 | DelayCompetingLowPriorityRequestsDelayType::kFirstContentfulPaint, |
| 606 | &delay_competing_low_priority_requests_delay_types}; |
| 607 | // The priority threshold: indicates which ResourceLoadPriority should be |
| 608 | // considered "important", such that low priority requests are delayed behind |
| 609 | // in-flight "important" requests. |
| 610 | const base::FeatureParam<DelayCompetingLowPriorityRequestsThreshold>::Option |
| 611 | delay_competing_low_priority_requests_thresholds[] = { |
| 612 | {DelayCompetingLowPriorityRequestsThreshold::kMedium, "medium"}, |
| 613 | {DelayCompetingLowPriorityRequestsThreshold::kHigh, "high"}}; |
| 614 | const base::FeatureParam<DelayCompetingLowPriorityRequestsThreshold> |
| 615 | kDelayCompetingLowPriorityRequestsThresholdParam{ |
| 616 | &kDelayCompetingLowPriorityRequests, "priority_threshold", |
| 617 | DelayCompetingLowPriorityRequestsThreshold::kHigh, |
| 618 | &delay_competing_low_priority_requests_thresholds}; |
| 619 | |
Adrienne Walker | b53b437 | 2020-05-06 18:57:18 | [diff] [blame] | 620 | // The AppCache feature is a kill-switch for the entire AppCache feature, |
| 621 | // both backend and API. If disabled, then it will turn off the backend and |
Adrienne Walker | d701f47 | 2020-08-20 02:15:11 | [diff] [blame] | 622 | // api, regardless of the presence of valid origin trial tokens. Disabling |
| 623 | // AppCache will also delete any AppCache data from the profile directory. |
Adrienne Walker | e6b5172 | 2020-04-01 17:56:38 | [diff] [blame] | 624 | const base::Feature kAppCache{"AppCache", base::FEATURE_ENABLED_BY_DEFAULT}; |
Adrienne Walker | b53b437 | 2020-05-06 18:57:18 | [diff] [blame] | 625 | // If AppCacheRequireOriginTrial is enabled, then the AppCache backend in the |
| 626 | // browser will require origin trial tokens in order to load or store manifests |
| 627 | // and their contents. |
| 628 | const base::Feature kAppCacheRequireOriginTrial{ |
Adrienne Walker | dd9442e0 | 2020-06-10 16:23:40 | [diff] [blame] | 629 | "AppCacheRequireOriginTrial", base::FEATURE_ENABLED_BY_DEFAULT}; |
Adrienne Walker | e6b5172 | 2020-04-01 17:56:38 | [diff] [blame] | 630 | |
Wan-Teh Chang | 75fd532 | 2020-04-08 01:32:18 | [diff] [blame] | 631 | // Enables the AV1 Image File Format (AVIF). |
Wan-Teh Chang | b9d67a1 | 2020-06-26 01:19:13 | [diff] [blame] | 632 | const base::Feature kAVIF{"AVIF", base::FEATURE_ENABLED_BY_DEFAULT}; |
Wan-Teh Chang | 75fd532 | 2020-04-08 01:32:18 | [diff] [blame] | 633 | |
Xiaocheng Hu | 66795f0 | 2020-04-25 00:26:47 | [diff] [blame] | 634 | // Make all pending 'display: auto' web fonts enter the swap or failure period |
Xiaocheng Hu | 9e2055c | 2020-04-09 20:35:28 | [diff] [blame] | 635 | // immediately before reaching the LCP time limit (~2500ms), so that web fonts |
| 636 | // do not become a source of bad LCP. |
| 637 | const base::Feature kAlignFontDisplayAutoTimeoutWithLCPGoal{ |
| 638 | "AlignFontDisplayAutoTimeoutWithLCPGoal", |
| 639 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 640 | |
Xiaocheng Hu | 66795f0 | 2020-04-25 00:26:47 | [diff] [blame] | 641 | // The amount of time allowed for 'display: auto' web fonts to load without |
| 642 | // intervention, counted from navigation start. |
| 643 | const base::FeatureParam<int> |
| 644 | kAlignFontDisplayAutoTimeoutWithLCPGoalTimeoutParam{ |
| 645 | &kAlignFontDisplayAutoTimeoutWithLCPGoal, "lcp-limit-in-ms", 2000}; |
| 646 | |
| 647 | const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode>::Option |
| 648 | align_font_display_auto_timeout_with_lcp_goal_modes[] = { |
| 649 | {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod, |
| 650 | "failure"}, |
| 651 | {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToSwapPeriod, "swap"}}; |
| 652 | const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode> |
| 653 | kAlignFontDisplayAutoTimeoutWithLCPGoalModeParam{ |
| 654 | &kAlignFontDisplayAutoTimeoutWithLCPGoal, "intervention-mode", |
| 655 | AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod, |
| 656 | &align_font_display_auto_timeout_with_lcp_goal_modes}; |
Xiaocheng Hu | 9e2055c | 2020-04-09 20:35:28 | [diff] [blame] | 657 | |
Ben Kelly | d52869b | 2020-04-20 17:17:43 | [diff] [blame] | 658 | // Enable throttling of fetch() requests from service workers in the |
Ben Kelly | 5feb995 | 2020-08-26 21:55:29 | [diff] [blame] | 659 | // installing state. The limit of 3 was chosen to match the limit |
| 660 | // in background main frames. In addition, trials showed that this |
| 661 | // did not cause excessive install delays or timeouts. |
Ben Kelly | d52869b | 2020-04-20 17:17:43 | [diff] [blame] | 662 | const base::Feature kThrottleInstallingServiceWorker{ |
Ben Kelly | 8dd3bf50 | 2020-09-03 17:09:51 | [diff] [blame] | 663 | "ThrottleInstallingServiceWorker", base::FEATURE_DISABLED_BY_DEFAULT}; |
Ben Kelly | d52869b | 2020-04-20 17:17:43 | [diff] [blame] | 664 | const base::FeatureParam<int> kInstallingServiceWorkerOutstandingThrottledLimit{ |
Ben Kelly | 5feb995 | 2020-08-26 21:55:29 | [diff] [blame] | 665 | &kThrottleInstallingServiceWorker, "limit", 3}; |
Ben Kelly | d52869b | 2020-04-20 17:17:43 | [diff] [blame] | 666 | |
Dave Tapuska | 95b71c8 | 2020-06-08 16:56:11 | [diff] [blame] | 667 | const base::Feature kInputPredictorTypeChoice{ |
| 668 | "InputPredictorTypeChoice", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 669 | |
| 670 | const base::Feature kResamplingInputEvents{"ResamplingInputEvents", |
| 671 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 672 | |
Dave Tapuska | fea8894 | 2020-05-05 18:50:32 | [diff] [blame] | 673 | const base::Feature kResamplingScrollEvents{"ResamplingScrollEvents", |
| 674 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 675 | |
Yoav Weiss | 200214d5 | 2020-05-13 23:58:42 | [diff] [blame] | 676 | // Enables the device-memory, resource-width, viewport-width and DPR client |
| 677 | // hints to be sent to third-party origins if the first-party has opted in to |
| 678 | // receiving client hints, regardless of Feature Policy. |
| 679 | #if defined(OS_ANDROID) |
| 680 | const base::Feature kAllowClientHintsToThirdParty{ |
| 681 | "AllowClientHintsToThirdParty", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 682 | #else |
| 683 | const base::Feature kAllowClientHintsToThirdParty{ |
| 684 | "AllowClientHintsToThirdParty", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 685 | #endif |
| 686 | |
Dave Tapuska | fea8894 | 2020-05-05 18:50:32 | [diff] [blame] | 687 | const base::Feature kFilteringScrollPrediction{ |
| 688 | "FilteringScrollPrediction", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 689 | |
Dave Tapuska | fea8894 | 2020-05-05 18:50:32 | [diff] [blame] | 690 | const base::Feature kKalmanHeuristics{"KalmanHeuristics", |
| 691 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 692 | |
| 693 | const base::Feature kKalmanDirectionCutOff{"KalmanDirectionCutOff", |
| 694 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 695 | |
| 696 | const base::Feature kSkipTouchEventFilter{"SkipTouchEventFilter", |
| 697 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 698 | const char kSkipTouchEventFilterTypeParamName[] = "type"; |
| 699 | const char kSkipTouchEventFilterTypeParamValueDiscrete[] = "discrete"; |
| 700 | const char kSkipTouchEventFilterTypeParamValueAll[] = "all"; |
| 701 | const char kSkipTouchEventFilterFilteringProcessParamName[] = |
| 702 | "skip_filtering_process"; |
| 703 | const char kSkipTouchEventFilterFilteringProcessParamValueBrowser[] = "browser"; |
| 704 | const char kSkipTouchEventFilterFilteringProcessParamValueBrowserAndRenderer[] = |
| 705 | "browser_and_renderer"; |
| 706 | |
Patrick To | 2afc116 | 2020-06-03 18:19:30 | [diff] [blame] | 707 | // Improves support for WebXR on computers with multiple GPUs. |
| 708 | const base::Feature kWebXrMultiGpu{"WebXRMultiGpu", |
| 709 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 710 | |
Anders Hartvoll Ruud | 80f881881 | 2020-06-09 08:07:31 | [diff] [blame] | 711 | // Enables dependency support in blink::MatchedPropertiesCache, which allows |
| 712 | // caching of previously uncachable objects. |
| 713 | const base::Feature kCSSMatchedPropertiesCacheDependencies{ |
| 714 | "CSSMatchedPropertiesCacheDependencies", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 715 | |
Benoit Lize | 66684b2 | 2020-08-07 12:30:22 | [diff] [blame] | 716 | // Disabling this will cause parkable strings to never be compressed. |
| 717 | // This is useful for headless mode + virtual time. Since virtual time advances |
| 718 | // quickly, strings may be parked too eagerly in that mode. |
| 719 | const base::Feature kCompressParkableStrings{"CompressParkableStrings", |
| 720 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 721 | |
Benoit Lize | 04cbcd9d | 2020-06-18 09:44:27 | [diff] [blame] | 722 | // Whether ParkableStrings can be written out to disk. |
Benoit Lize | 66684b2 | 2020-08-07 12:30:22 | [diff] [blame] | 723 | // Depends on compression above. |
Benoit Lize | 04cbcd9d | 2020-06-18 09:44:27 | [diff] [blame] | 724 | const base::Feature kParkableStringsToDisk{"ParkableStringsToDisk", |
Benoit Lize | 08d20fc | 2020-09-16 11:50:25 | [diff] [blame^] | 725 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Benoit Lize | 04cbcd9d | 2020-06-18 09:44:27 | [diff] [blame] | 726 | |
Benoit Lize | 66684b2 | 2020-08-07 12:30:22 | [diff] [blame] | 727 | bool IsParkableStringsToDiskEnabled() { |
| 728 | return base::FeatureList::IsEnabled(kParkableStringsToDisk) && |
| 729 | base::FeatureList::IsEnabled(kCompressParkableStrings); |
| 730 | } |
| 731 | |
Yue Li | 384bb09 | 2020-08-11 23:35:28 | [diff] [blame] | 732 | // Controls whether to auto select on contextual menu click in Chrome OS. |
| 733 | const base::Feature kCrOSAutoSelect{"CrOSAutoSelect", |
| 734 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 735 | |
Chris Harrelson | b4f3bd9 | 2020-08-13 00:57:30 | [diff] [blame] | 736 | const base::Feature kCompositingOptimizations{ |
| 737 | "CompositingOptimizations", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 738 | |
Minggang Wang | 1daff4ec | 2020-08-13 05:06:17 | [diff] [blame] | 739 | // Reduce the amount of information in the default 'referer' header for |
| 740 | // cross-origin requests. |
| 741 | const base::Feature kReducedReferrerGranularity{ |
| 742 | "ReducedReferrerGranularity", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 743 | |
Michael Bai | 90123183 | 2020-08-18 04:52:43 | [diff] [blame] | 744 | // Enables the user activated exponential delay in the ContentCapture task. |
| 745 | const base::Feature kContentCaptureUserActivatedDelay = { |
| 746 | "ContentCaptureUserActivatedDelay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 747 | |
Adam Rice | 89ac6b07 | 2020-08-20 16:06:19 | [diff] [blame] | 748 | // Enable ReadableStream, WritableStream and TransformStream objects to be |
| 749 | // transferred with postMessage(). |
| 750 | const base::Feature kTransferableStreams{"TransferableStreams", |
| 751 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 752 | |
Asami Doi | af426d4f | 2020-09-02 03:31:31 | [diff] [blame] | 753 | // Dispatches a fake fetch event to a service worker to check the offline |
| 754 | // capability of the site before promoting installation. |
| 755 | // See https://crbug.com/965802 for more details. |
| 756 | const base::Feature kCheckOfflineCapability{"CheckOfflineCapability", |
| 757 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 758 | |
Rakina Zata Amni | ec6d02a | 2020-08-27 14:57:03 | [diff] [blame] | 759 | // The "BackForwardCacheABExperimentControl" feature indicates the state of the |
| 760 | // same-site BackForwardCache experiment. This information is used when sending |
| 761 | // the "Sec-bfcache-experiment" HTTP Header on resource requests. The header |
| 762 | // value is determined by the value of the "experiment_group_for_http_header" |
| 763 | // feature parameter. |
| 764 | const base::Feature kBackForwardCacheABExperimentControl{ |
| 765 | "BackForwardCacheABExperimentControl", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 766 | const char kBackForwardCacheABExperimentGroup[] = |
| 767 | "experiment_group_for_http_header"; |
| 768 | |
Dave Tapuska | 47c85b3 | 2020-08-27 20:47:56 | [diff] [blame] | 769 | // Whether we should composite a PLSA (paint layer scrollable area) even if it |
| 770 | // means losing lcd text. |
| 771 | const base::Feature kPreferCompositingToLCDText = { |
| 772 | "PreferCompositingToLCDText", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 773 | |
Harkiran Bolaria | 875dd0d | 2020-09-15 18:10:46 | [diff] [blame] | 774 | const base::Feature kLogUnexpectedIPCPostedToBackForwardCachedDocuments{ |
| 775 | "LogUnexpectedIPCPostedToBackForwardCachedDocuments", |
| 776 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 777 | } // namespace features |
| 778 | } // namespace blink |