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