blob: 619f2bbd29030cbfe26ca30c9f14e674380ebd35 [file] [log] [blame]
Matt Falkenhagen5cc652792018-06-21 10:34:331// 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 Gilman5e9672bed2019-08-02 19:07:497#include "base/feature_list.h"
Scott Haseley8eefdcd2018-08-22 16:50:198#include "build/build_config.h"
Hiroki Nakagawa893ee502019-02-04 06:49:539#include "services/network/public/cpp/features.h"
Aran Gilman5e9672bed2019-08-02 19:07:4910#include "third_party/blink/public/common/forcedark/forcedark_switches.h"
Scott Haseley8eefdcd2018-08-22 16:50:1911
Matt Falkenhagen5cc652792018-06-21 10:34:3312namespace blink {
13namespace features {
14
Yao Xiao2c1171a2019-04-01 23:44:3215// Enable intervention for download that was initiated from or occurred in an ad
16// frame without user activation.
17const base::Feature kBlockingDownloadsInAdFrameWithoutUserActivation{
18 "BlockingDownloadsInAdFrameWithoutUserActivation",
Yao Xiao3f9e4272019-05-23 15:22:4619 base::FEATURE_ENABLED_BY_DEFAULT};
Yao Xiao2c1171a2019-04-01 23:44:3220
Stephen Chenney1bcaec832019-10-10 18:31:0121// Enable defer commits to avoid flash of unstyled content.
22const base::Feature kPaintHolding{"PaintHolding",
23 base::FEATURE_ENABLED_BY_DEFAULT};
Stephen Chenneyde6e5c82019-01-21 01:56:0424
Matt Falkenhagenc25fea42018-07-17 07:13:5225// Enable eagerly setting up a CacheStorage interface pointer and
26// passing it to service workers on startup as an optimization.
Ben Kelly2c1cdd62020-05-04 22:05:0427// TODO(crbug/1077916): Re-enable once the issue with COOP/COEP is fixed.
Matt Falkenhagenc25fea42018-07-17 07:13:5228const base::Feature kEagerCacheStorageSetupForServiceWorkers{
29 "EagerCacheStorageSetupForServiceWorkers",
Ben Kelly2c1cdd62020-05-04 22:05:0430 base::FEATURE_DISABLED_BY_DEFAULT};
Matt Falkenhagenc25fea42018-07-17 07:13:5231
Peter Kvitek197eaf72018-12-04 19:14:5632// Controls script streaming.
33const base::Feature kScriptStreaming{"ScriptStreaming",
34 base::FEATURE_ENABLED_BY_DEFAULT};
35
Leszek Swirskif75c1912019-05-29 10:08:2536// Allow streaming small (<30kB) scripts.
37const base::Feature kSmallScriptStreaming{"SmallScriptStreaming",
38 base::FEATURE_DISABLED_BY_DEFAULT};
39
Keishi Hattori9e106922019-04-15 09:06:0340// Enables user level memory pressure signal generation on Android.
41const base::Feature kUserLevelMemoryPressureSignal{
42 "UserLevelMemoryPressureSignal", base::FEATURE_DISABLED_BY_DEFAULT};
43
Aditya Keerthi6a933902019-03-14 21:09:2744// Perform memory purges after freezing only if all pages are frozen.
45const base::Feature kFreezePurgeMemoryAllPagesFrozen{
46 "FreezePurgeMemoryAllPagesFrozen", base::FEATURE_DISABLED_BY_DEFAULT};
47
John Delaneyac24e572019-04-30 19:47:0248// Freezes the user-agent as part of https://github.com/WICG/ua-client-hints.
49const base::Feature kFreezeUserAgent{"FreezeUserAgent",
50 base::FEATURE_DISABLED_BY_DEFAULT};
51
Sam Fortiner3f07c632020-05-07 22:40:1852// When enabled, use the maximum possible bounds in compositing overlap testing
53// for fixed position elements.
54const base::Feature kMaxOverlapBoundsForFixed{
55 "MaxOverlapBoundsForFixed", base::FEATURE_DISABLED_BY_DEFAULT};
56
Vladimir Levin43758ecc2019-05-09 18:04:0357// Enable Display Locking JavaScript APIs.
58const base::Feature kDisplayLocking{"DisplayLocking",
59 base::FEATURE_DISABLED_BY_DEFAULT};
60
Sam Sebree2dd45c4f2019-12-13 05:51:4961const base::Feature kJSONModules{"JSONModules",
62 base::FEATURE_DISABLED_BY_DEFAULT};
63
Camillo Brunia19d7fc2020-03-17 07:53:3564// Enables top-level await in modules.
65const base::Feature kTopLevelAwait{"TopLevelAwait",
66 base::FEATURE_DISABLED_BY_DEFAULT};
67
Ian Kilpatricke68ef11a2018-07-04 03:52:1068// Enable LayoutNG.
Emil A Eklund69eeb562019-07-03 01:38:3069const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT};
Ian Kilpatricke68ef11a2018-07-04 03:52:1070
Makoto Shimazu172eec02018-11-29 06:21:4471const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent",
Carlos IL9970a942020-02-14 01:16:5072 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:4473
Tarun Bansal422f9012019-01-23 16:55:5874// Used to control the collection of anchor element metrics (crbug.com/856683).
75// If kNavigationPredictor is enabled, then metrics of anchor elements
76// in the first viewport after the page load and the metrics of the clicked
77// anchor element will be extracted and recorded. Additionally, navigation
78// predictor may preconnect/prefetch to resources/origins to make the
79// future navigations faster.
Sofiya Semenovae4e076152019-07-29 20:10:2780const base::Feature kNavigationPredictor {
81 "NavigationPredictor",
82#if defined(OS_ANDROID)
83 base::FEATURE_ENABLED_BY_DEFAULT
84#else
85 base::FEATURE_DISABLED_BY_DEFAULT
86#endif
87};
Tarun Bansal422f9012019-01-23 16:55:5888
Hiroki Nakagawa61ee0042019-01-22 06:30:2689// Enable browser-initiated dedicated worker script loading
90// (PlzDedicatedWorker). https://crbug.com/906991
91const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker",
92 base::FEATURE_DISABLED_BY_DEFAULT};
93
Daniel Murphy95792ef2018-10-04 01:29:5594// Enable Portals. https://crbug.com/865123.
95const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT};
96
Jeremy Roman20366e42019-10-22 17:48:0897// When kPortals is enabled, allow portals to load content that is third-party
98// (cross-origin) to the hosting page. Otherwise has no effect.
99//
100// This will be disabled by default by the time Portals is generally available,
101// either in origin trial or shipped.
102//
103// https://crbug.com/1013389
104const base::Feature kPortalsCrossOrigin{"PortalsCrossOrigin",
105 base::FEATURE_ENABLED_BY_DEFAULT};
106
Tarun Bansal8df12b52019-02-15 05:46:30107// Enable limiting previews loading hints to specific resource types.
108const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{
109 "PreviewsResourceLoadingHintsSpecificResourceTypes",
110 base::FEATURE_DISABLED_BY_DEFAULT};
111
Aditya Keerthie84331b32019-03-20 15:25:52112// Perform a memory purge after a renderer is backgrounded. Formerly labelled as
113// the "PurgeAndSuspend" experiment.
114//
115// TODO(adityakeerthi): Disabled by default on Mac and Android for historical
116// reasons. Consider enabling by default if experiment results are positive.
117// https://crbug.com/926186
118const base::Feature kPurgeRendererMemoryWhenBackgrounded {
119 "PurgeRendererMemoryWhenBackgrounded",
120#if defined(OS_MACOSX) || defined(OS_ANDROID)
121 base::FEATURE_DISABLED_BY_DEFAULT
122#else
123 base::FEATURE_ENABLED_BY_DEFAULT
124#endif
125};
126
David Bokan911bded2018-11-27 23:23:32127// Enable Implicit Root Scroller. https://crbug.com/903260.
David Bokan145b5472019-05-22 14:38:44128// TODO(bokan): Temporarily disabled on desktop platforms to address issues
129// with non-overlay scrollbars. https://crbug.com/948059.
130const base::Feature kImplicitRootScroller {
131 "ImplicitRootScroller",
132#if defined(OS_ANDROID)
133 base::FEATURE_ENABLED_BY_DEFAULT
134#else
135 base::FEATURE_DISABLED_BY_DEFAULT
136#endif
137};
David Bokan911bded2018-11-27 23:23:32138
Cathie Cheneac70602019-10-10 02:55:29139// Enable CSSOM View Scroll Coordinates. https://crbug.com/721759.
140const base::Feature kCSSOMViewScrollCoordinates{
141 "CSSOMViewScrollCoordinates", base::FEATURE_DISABLED_BY_DEFAULT};
142
Darwin Huangf588cc8e2019-12-13 22:24:56143// Enables Raw Clipboard. https://crbug.com/897289.
144const base::Feature kRawClipboard{"RawClipboard",
145 base::FEATURE_DISABLED_BY_DEFAULT};
146
Makoto Shimazu172eec02018-11-29 06:21:44147// Enables usage of getDisplayMedia() that allows capture of web content, see
148// https://crbug.com/865060.
149const base::Feature kRTCGetDisplayMedia{"RTCGetDisplayMedia",
150 base::FEATURE_ENABLED_BY_DEFAULT};
151
152// Changes the default RTCPeerConnection constructor behavior to use Unified
153// Plan as the SDP semantics. When the feature is enabled, Unified Plan is used
154// unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the
155// argument).
156const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault",
Henrik Boström07021ec82019-01-17 22:23:56157 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44158
Johannes Kronad5a4532019-01-09 11:17:46159// Determines if the SDP attrbute extmap-allow-mixed should be offered by
160// default or not. The default value can be overridden by passing
161// {offerExtmapAllowMixed:true} as an argument to the RTCPeerConnection
162// constructor.
163const base::Feature kRTCOfferExtmapAllowMixed{
164 "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT};
165
Ulan Degenbaev4b3bc29b2020-03-13 17:09:00166// Prevents workers from sending IsolateInBackgroundNotification to V8
167// and thus instructs V8 to favor performance over memory on workers.
168const base::Feature kV8OptimizeWorkersForPerformance{
Ulan Degenbaev7acd73ea2020-04-07 16:02:33169 "V8OptimizeWorkersForPerformance", base::FEATURE_ENABLED_BY_DEFAULT};
Ulan Degenbaev4b3bc29b2020-03-13 17:09:00170
Antonio Gomesb4718572019-09-11 02:55:48171// Enables negotiation of experimental multiplex codec in SDP.
172const base::Feature kWebRtcMultiplexCodec{"WebRTC-MultiplexCodec",
173 base::FEATURE_DISABLED_BY_DEFAULT};
174
175// Causes WebRTC to replace host ICE candidate IP addresses with generated
176// names ending in ".local" and resolve them using mDNS.
177// http://crbug.com/878465
178const base::Feature kWebRtcHideLocalIpsWithMdns{
179 "WebRtcHideLocalIpsWithMdns", base::FEATURE_ENABLED_BY_DEFAULT};
180
Antonio Gomesf3bcd512019-09-03 21:27:17181#if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
182// Run-time feature for the |rtc_use_h264| encoder/decoder.
183const base::Feature kWebRtcH264WithOpenH264FFmpeg{
184 "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT};
185#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
186
Makoto Shimazua8b3d742019-04-05 06:55:51187// Experiment of the delay from navigation to starting an update of a service
188// worker's script.
189const base::Feature kServiceWorkerUpdateDelay{
190 "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT};
191
Scott Haseley8eefdcd2018-08-22 16:50:19192// Freeze scheduler task queues in background after allowed grace time.
193// "stop" is a legacy name.
194const base::Feature kStopInBackground {
195 "stop-in-background",
196#if defined(OS_ANDROID)
197 base::FEATURE_ENABLED_BY_DEFAULT
198#else
199 base::FEATURE_DISABLED_BY_DEFAULT
200#endif
201};
202
Takashi Sakamotoc19fc2b2019-04-10 06:30:52203// Freeze scheduler task queues in background on network idle.
204// This feature only works if stop-in-background is enabled.
205const base::Feature kFreezeBackgroundTabOnNetworkIdle{
206 "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT};
207
Shubhie Panicker60bd4b02018-09-26 00:02:15208// Freeze non-timer task queues in background, after allowed grace time.
209// "stop" is a legacy name.
Dave Tapuska9140c552019-05-30 16:18:56210const base::Feature kStopNonTimersInBackground{
211 "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT};
Scott Haseley7757f6c2018-08-03 14:33:23212
Brandon Maslenda12cf82019-08-23 20:54:18213// Enable the Storage Access API. https://crbug.com/989663.
214const base::Feature kStorageAccessAPI{"StorageAccessAPI",
215 base::FEATURE_DISABLED_BY_DEFAULT};
216
David Bokane9370c22019-02-14 15:19:58217// Enable text snippets in URL fragments. https://crbug.com/919204.
218const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
Nick Burris62f8d5f02020-01-16 22:54:51219 base::FEATURE_ENABLED_BY_DEFAULT};
David Bokane9370c22019-02-14 15:19:58220
Marijn Kruisselbrinkca4bb5e2019-04-22 18:19:42221// Writable files and native file system access. https://crbug.com/853326
222const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI",
Marijn Kruisselbrink4cc3ec22019-09-04 16:28:20223 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44224
Jay Harris583f48922019-05-06 05:55:24225// File handling integration. https://crbug.com/829689
226const base::Feature kFileHandlingAPI{"FileHandlingAPI",
227 base::FEATURE_DISABLED_BY_DEFAULT};
228
kdillon66bf5b522019-01-02 22:08:30229// Allows for synchronous XHR requests during page dismissal
Katie Dillon8b357312019-09-19 13:23:23230const base::Feature kAllowSyncXHRInPageDismissal{
231 "AllowSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT};
kdillon66bf5b522019-01-02 22:08:30232
Olivier Yiptongb60d2c42020-01-10 22:47:15233// Font enumeration and table access. https://crbug.com/535764 and
234// https://crbug.com/982054.
235const base::Feature kFontAccess{"FontAccess",
236 base::FEATURE_DISABLED_BY_DEFAULT};
237
Dominic Farolino780df942019-09-04 06:49:44238// Prefetch request properties are updated to be privacy-preserving. See
239// crbug.com/988956.
240const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges",
241 base::FEATURE_DISABLED_BY_DEFAULT};
Dominic Farolino693fd72d2019-08-05 11:09:44242
Carlos ILd3be52b2018-10-08 17:57:18243const char kMixedContentAutoupgradeModeParamName[] = "mode";
Carlos IL9970a942020-02-14 01:16:50244const char kMixedContentAutoupgradeModeAllPassive[] = "all-passive";
Carlos ILd3be52b2018-10-08 17:57:18245
Sasha McIntoshe889f9f2019-09-03 21:01:57246// Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this
247// format in the image decode cache. See crbug.com/919627 for details on the
248// feature.
249const base::Feature kDecodeJpeg420ImagesToYUV{
250 "DecodeJpeg420ImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT};
251
Madeleine Barowsky45be21a42018-12-07 18:39:30252// Decodes lossy WebP images to YUV instead of RGBX and stores in this format
253// in the image decode cache. See crbug.com/900264 for details on the feature.
254const base::Feature kDecodeLossyWebPImagesToYUV{
Sasha McIntoshf670a6b2020-01-09 18:27:09255 "DecodeLossyWebPImagesToYUV", base::FEATURE_ENABLED_BY_DEFAULT};
Madeleine Barowsky45be21a42018-12-07 18:39:30256
Takashi Toyoshimaa91506d2019-03-28 05:44:42257// Enables cache-aware WebFonts loading. See https://crbug.com/570205.
258// The feature is disabled on Android for WebView API issue discussed at
259// https://crbug.com/942440.
260const base::Feature kWebFontsCacheAwareTimeoutAdaption {
261 "WebFontsCacheAwareTimeoutAdaption",
262#if defined(OS_ANDROID)
263 base::FEATURE_DISABLED_BY_DEFAULT
264#else
265 base::FEATURE_ENABLED_BY_DEFAULT
266#endif
267};
268
Ehsan Karamadbe95d122019-05-10 17:59:06269// Enabled to block programmatic focus in subframes when not triggered by user
270// activation (see htpps://crbug.com/954349).
271const base::Feature kBlockingFocusWithoutUserActivation{
272 "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT};
273
Hongchan Choi370d3af2019-05-20 20:56:58274const base::Feature kAudioWorkletRealtimeThread{
275 "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT};
276
Ryan Sturm139c3ac2019-07-12 18:52:53277// A feature to reduce the set of resources fetched by No-State Prefetch.
278const base::Feature kLightweightNoStatePrefetch{
Ryan Sturmf223cb02019-10-04 18:02:00279 "LightweightNoStatePrefetch",
280#if defined(OS_ANDROID)
281 base::FEATURE_ENABLED_BY_DEFAULT
282#else
283 base::FEATURE_DISABLED_BY_DEFAULT
284#endif
285};
Ryan Sturm139c3ac2019-07-12 18:52:53286
Robert Ogden8dddf562019-11-21 18:20:36287// A feature to enable web fonts to be fetched by No-State Prefetch.
288const base::Feature kLightweightNoStatePrefetch_FetchFonts{
289 "LightweightNoStatePrefetch_FetchFonts", base::FEATURE_DISABLED_BY_DEFAULT};
290
Aran Gilman5e9672bed2019-08-02 19:07:49291// Automatically convert light-themed pages to use a Blink-generated dark theme
292const base::Feature kForceWebContentsDarkMode{
293 "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT};
294
Michael Crouseb7acd772020-02-20 02:56:26295// A feature to enable using the smallest image specified within image srcset
296// for users with Save Data enabled.
297const base::Feature kSaveDataImgSrcset{"SaveDataImgSrcset",
298 base::FEATURE_DISABLED_BY_DEFAULT};
299
Aran Gilman5e9672bed2019-08-02 19:07:49300// Which algorithm should be used for color inversion?
301const base::FeatureParam<ForceDarkInversionMethod>::Option
302 forcedark_inversion_method_options[] = {
303 {ForceDarkInversionMethod::kUseBlinkSettings,
304 "use_blink_settings_for_method"},
305 {ForceDarkInversionMethod::kHslBased, "hsl_based"},
Aran Gilman8b3ca41c2019-08-12 18:59:04306 {ForceDarkInversionMethod::kCielabBased, "cielab_based"},
307 {ForceDarkInversionMethod::kRgbBased, "rgb_based"}};
Aran Gilman5e9672bed2019-08-02 19:07:49308
309const base::FeatureParam<ForceDarkInversionMethod>
310 kForceDarkInversionMethodParam{&kForceWebContentsDarkMode,
311 "inversion_method",
312 ForceDarkInversionMethod::kUseBlinkSettings,
313 &forcedark_inversion_method_options};
314
315// Should images be inverted?
316const base::FeatureParam<ForceDarkImageBehavior>::Option
317 forcedark_image_behavior_options[] = {
318 {ForceDarkImageBehavior::kUseBlinkSettings,
319 "use_blink_settings_for_images"},
320 {ForceDarkImageBehavior::kInvertNone, "none"},
321 {ForceDarkImageBehavior::kInvertSelectively, "selective"}};
322
323const base::FeatureParam<ForceDarkImageBehavior> kForceDarkImageBehaviorParam{
324 &kForceWebContentsDarkMode, "image_behavior",
325 ForceDarkImageBehavior::kUseBlinkSettings,
326 &forcedark_image_behavior_options};
327
328// Do not invert text lighter than this.
329// Range: 0 (do not invert any text) to 256 (invert all text)
330// Can also set to -1 to let Blink's internal settings control the value
331const base::FeatureParam<int> kForceDarkTextLightnessThresholdParam{
332 &kForceWebContentsDarkMode, "text_lightness_threshold", -1};
333
334// Do not invert backgrounds darker than this.
335// Range: 0 (invert all backgrounds) to 256 (invert no backgrounds)
336// Can also set to -1 to let Blink's internal settings control the value
337const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{
338 &kForceWebContentsDarkMode, "background_lightness_threshold", -1};
339
Sergey Silkinc33244f2020-01-31 17:21:30340// Instructs WebRTC to honor the Min/Max Video Encode Accelerator dimensions.
Miguel Casas-Sanchezb6128392020-02-18 15:45:39341const base::Feature kWebRtcUseMinMaxVEADimensions {
342 "WebRtcUseMinMaxVEADimensions",
343 // TODO(crbug.com/1008491): enable other platforms.
344#if defined(OS_CHROMEOS)
345 base::FEATURE_ENABLED_BY_DEFAULT
346#else
347 base::FEATURE_DISABLED_BY_DEFAULT
348#endif
349};
Sergey Silkinc33244f2020-01-31 17:21:30350
Michael Lippautze670df9f2019-07-09 11:39:49351// Blink garbage collection.
352// Enables compaction of backing stores on Blink's heap.
353const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction",
354 base::FEATURE_ENABLED_BY_DEFAULT};
355// Enables concurrently marking Blink's heap.
356const base::Feature kBlinkHeapConcurrentMarking{
Omer Katz1757893c2020-02-17 12:09:19357 "BlinkHeapConcurrentMarking", base::FEATURE_ENABLED_BY_DEFAULT};
Anton Bikineev9b7b3722019-07-09 13:48:39358// Enables concurrently sweeping Blink's heap.
359const base::Feature kBlinkHeapConcurrentSweeping{
Anton Bikineev204cc752019-08-07 00:26:37360 "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49361// Enables incrementally marking Blink's heap.
362const base::Feature kBlinkHeapIncrementalMarking{
363 "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT};
364// Enables a marking stress mode that schedules more garbage collections and
365// also adds additional verification passes.
366const base::Feature kBlinkHeapIncrementalMarkingStress{
367 "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49368
Yoav Weissddfb8d2e2019-07-15 22:34:03369// Enables removing AppCache delays when triggering requests when the HTML was
370// not fetched from AppCache.
371const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{
372 "VerifyHTMLFetchedFromAppCacheBeforeDelay",
373 base::FEATURE_DISABLED_BY_DEFAULT};
374
Michael Spang8d2303e2019-07-26 01:56:32375// Controls whether we use ThreadPriority::DISPLAY for renderer
376// compositor & IO threads.
377const base::Feature kBlinkCompositorUseDisplayThreadPriority {
378 "BlinkCompositorUseDisplayThreadPriority",
Sunny Sachanandani16944252019-12-04 03:40:49379#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
Michael Spang8d2303e2019-07-26 01:56:32380 base::FEATURE_ENABLED_BY_DEFAULT
381#else
382 base::FEATURE_DISABLED_BY_DEFAULT
383#endif
384};
385
Yuki Shiinoa812f492019-08-23 06:47:46386// Ignores cross origin windows in the named property interceptor of Window.
387// https://crbug.com/538562
388const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{
389 "IgnoreCrossOriginWindowWhenNamedAccessOnWindow",
390 base::FEATURE_DISABLED_BY_DEFAULT};
391
Tarun Bansal38792462019-09-04 16:08:11392// When enabled, loading priority of JavaScript requests is lowered when they
393// are force deferred by the intervention.
394const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{
395 "LowerJavaScriptPriorityWhenForceDeferred",
Tarun Bansal755268fe2019-10-18 18:57:40396 base::FEATURE_DISABLED_BY_DEFAULT};
Tarun Bansal38792462019-09-04 16:08:11397
Tarun Bansalf32aaa22020-02-12 16:16:44398// When enabled, scripts in iframes are not force deferred by the DeferAllScript
399// intervention.
400const base::Feature kDisableForceDeferInChildFrames{
401 "DisableForceDeferInChildFrames", base::FEATURE_DISABLED_BY_DEFAULT};
402
rajendrantd5db55f2019-10-19 01:56:59403// Enables redirecting subresources in the page to better compressed and
404// optimized versions to provide data savings.
405const base::Feature kSubresourceRedirect{"SubresourceRedirect",
406 base::FEATURE_DISABLED_BY_DEFAULT};
407
Stefan Zagerfd18161c2019-10-22 20:44:31408// When 'enabled', all cross-origin iframes will get a compositing layer.
409const base::Feature kCompositeCrossOriginIframes{
410 "CompositeCrossOriginIframes", base::FEATURE_DISABLED_BY_DEFAULT};
Yutaka Hirano0b3c319b2019-10-25 17:19:15411
412// When enabled, beacons (and friends) have ResourceLoadPriority::kLow,
413// not ResourceLoadPriority::kVeryLow.
414const base::Feature kSetLowPriorityForBeacon{"SetLowPriorityForBeacon",
415 base::FEATURE_DISABLED_BY_DEFAULT};
416
Ben Kelly776f59d2019-11-06 16:25:30417// When enabled allows the header name used in the blink
418// CacheStorageCodeCacheHint runtime feature to be modified. This runtime
419// feature disables generating full code cache for responses stored in
420// cache_storage during a service worker install event. The runtime feature
421// must be enabled via the blink runtime feature mechanism, however.
422const base::Feature kCacheStorageCodeCacheHintHeader{
423 "CacheStorageCodeCacheHintHeader", base::FEATURE_DISABLED_BY_DEFAULT};
424const base::FeatureParam<std::string> kCacheStorageCodeCacheHintHeaderName{
425 &kCacheStorageCodeCacheHintHeader, "name", "x-CacheStorageCodeCacheHint"};
426
Francois Doray563453432019-11-20 15:32:17427// When enabled, the beforeunload handler is dispatched when a frame is frozen.
428// This allows the browser to know whether discarding the frame could result in
429// lost user data, at the cost of extra CPU usage. The feature will be removed
430// once we have determine whether the CPU cost is acceptable.
431const base::Feature kDispatchBeforeUnloadOnFreeze{
432 "DispatchBeforeUnloadOnFreeze", base::FEATURE_ENABLED_BY_DEFAULT};
433
Sunny Sachanandani26463422019-12-05 21:35:40434// Enables the use of GpuMemoryBuffer images for low latency 2d canvas.
435// TODO(khushalsagar): Enable this if we're using SurfaceControl and GMBs allow
436// us to overlay these resources.
437const base::Feature kLowLatencyCanvas2dImageChromium {
438 "LowLatencyCanvas2dImageChromium",
439#if defined(OS_CHROMEOS)
440 base::FEATURE_ENABLED_BY_DEFAULT
441#else
442 base::FEATURE_DISABLED_BY_DEFAULT
443#endif // OS_CHROMEOS
444};
445
446// Enables the use of shared image swap chains for low latency 2d canvas.
447const base::Feature kLowLatencyCanvas2dSwapChain{
Sunny Sachanandanib954dc7c2019-12-12 02:50:51448 "LowLatencyCanvas2dSwapChain", base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40449
450// Enables the use of shared image swap chains for low latency webgl canvas.
Sunny Sachanandanib954dc7c2019-12-12 02:50:51451const base::Feature kLowLatencyWebGLSwapChain{"LowLatencyWebGLSwapChain",
452 base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40453
Stephen Whitee17b0232020-04-27 23:48:49454// Enables Dawn-accelerated 2D canvas.
455const base::Feature kDawn2dCanvas{"Dawn2dCanvas",
456 base::FEATURE_DISABLED_BY_DEFAULT};
457
Yao Xiaoc646d0b2020-01-31 22:30:59458// Enables forcing additional rendering of subframes for the purpose of sticky
459// frame tracking.
460const base::Feature kForceExtraRenderingToTrackStickyFrame{
461 "ForceExtraRenderingToTrackStickyFrame", base::FEATURE_DISABLED_BY_DEFAULT};
462
Xiaocheng Hud5197fd2020-02-06 07:26:08463const base::Feature kCSSReducedFontLoadingInvalidations{
464 "CSSReducedFontLoadingInvalidations", base::FEATURE_DISABLED_BY_DEFAULT};
465
Egor Pasko28ec46952020-02-07 15:17:57466// When enabled, frees up CachedMetadata after consumption by script resources
467// and modules. Needed for the experiment in http://crbug.com/1045052.
468const base::Feature kDiscardCodeCacheAfterFirstUse{
469 "DiscardCodeCacheAfterFirstUse", base::FEATURE_DISABLED_BY_DEFAULT};
470
Yutaka Hiranobf410a42020-02-18 08:08:45471// The kill-switch for the fix for https://crbug.com/1051439.
472// TODO(crbug.com/1053369): Remove this around M84.
473const base::Feature kSuppressContentTypeForBeaconMadeWithArrayBufferView{
474 "SuppressContentTypeForBeaconMadeWithArrayBufferView",
475 base::FEATURE_ENABLED_BY_DEFAULT};
476
Rune Lillesveen61f49ee2020-03-02 07:53:49477const base::Feature kBlockHTMLParserOnStyleSheets{
478 "BlockHTMLParserOnStyleSheets", base::FEATURE_DISABLED_BY_DEFAULT};
479
Xiaocheng Hud2e807d2020-03-04 21:15:21480// Slightly delays rendering if there are fonts being preloaded, so that
481// they don't miss the first paint if they can be loaded fast enough (e.g.,
482// from the disk cache)
483const base::Feature kFontPreloadingDelaysRendering{
484 "FontPreloadingDelaysRendering", base::FEATURE_DISABLED_BY_DEFAULT};
485
486// Set to be over 90th-percentile of HttpCache.AccessToDone.Used on all
487// platforms, and also to allow some time for IPC and scheduling.
488// TODO(xiaochengh): Tune it for the best performance.
489const base::FeatureParam<int> kFontPreloadingDelaysRenderingParam{
490 &kFontPreloadingDelaysRendering, "delay-in-ms", 100};
491
David Grogan17b34f4f2020-05-11 19:35:19492const base::Feature kFlexGaps{"FlexGaps", base::FEATURE_DISABLED_BY_DEFAULT};
David Grogan565f8bb2020-05-27 03:07:40493const base::Feature kFlexNG{"FlexNG", base::FEATURE_ENABLED_BY_DEFAULT};
David Grogan5b3cf162020-03-19 21:53:15494
Dominic Farolino0f55a082020-03-24 09:47:55495const base::Feature kKeepScriptResourceAlive{"KeepScriptResourceAlive",
496 base::FEATURE_DISABLED_BY_DEFAULT};
497
Adrienne Walkerb53b4372020-05-06 18:57:18498// The AppCache feature is a kill-switch for the entire AppCache feature,
499// both backend and API. If disabled, then it will turn off the backend and
500// api, regardless of the presence of valid origin trial tokens.
Adrienne Walkere6b51722020-04-01 17:56:38501const base::Feature kAppCache{"AppCache", base::FEATURE_ENABLED_BY_DEFAULT};
Adrienne Walkerb53b4372020-05-06 18:57:18502// If AppCacheRequireOriginTrial is enabled, then the AppCache backend in the
503// browser will require origin trial tokens in order to load or store manifests
504// and their contents.
505const base::Feature kAppCacheRequireOriginTrial{
506 "AppCacheRequireOriginTrial", base::FEATURE_DISABLED_BY_DEFAULT};
Adrienne Walkere6b51722020-04-01 17:56:38507
Wan-Teh Chang75fd5322020-04-08 01:32:18508// Enables the AV1 Image File Format (AVIF).
509const base::Feature kAVIF{"AVIF", base::FEATURE_DISABLED_BY_DEFAULT};
510
Xiaocheng Hu66795f02020-04-25 00:26:47511// Make all pending 'display: auto' web fonts enter the swap or failure period
Xiaocheng Hu9e2055c2020-04-09 20:35:28512// immediately before reaching the LCP time limit (~2500ms), so that web fonts
513// do not become a source of bad LCP.
514const base::Feature kAlignFontDisplayAutoTimeoutWithLCPGoal{
515 "AlignFontDisplayAutoTimeoutWithLCPGoal",
516 base::FEATURE_DISABLED_BY_DEFAULT};
517
Xiaocheng Hu66795f02020-04-25 00:26:47518// The amount of time allowed for 'display: auto' web fonts to load without
519// intervention, counted from navigation start.
520const base::FeatureParam<int>
521 kAlignFontDisplayAutoTimeoutWithLCPGoalTimeoutParam{
522 &kAlignFontDisplayAutoTimeoutWithLCPGoal, "lcp-limit-in-ms", 2000};
523
524const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode>::Option
525 align_font_display_auto_timeout_with_lcp_goal_modes[] = {
526 {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod,
527 "failure"},
528 {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToSwapPeriod, "swap"}};
529const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode>
530 kAlignFontDisplayAutoTimeoutWithLCPGoalModeParam{
531 &kAlignFontDisplayAutoTimeoutWithLCPGoal, "intervention-mode",
532 AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod,
533 &align_font_display_auto_timeout_with_lcp_goal_modes};
Xiaocheng Hu9e2055c2020-04-09 20:35:28534
Ben Kellyd52869b2020-04-20 17:17:43535// Enable throttling of fetch() requests from service workers in the
536// installing state.
537const base::Feature kThrottleInstallingServiceWorker{
538 "ThrottleInstallingServiceWorker", base::FEATURE_DISABLED_BY_DEFAULT};
539const base::FeatureParam<int> kInstallingServiceWorkerOutstandingThrottledLimit{
540 &kThrottleInstallingServiceWorker, "limit", 5};
541
Dave Tapuskafea88942020-05-05 18:50:32542const base::Feature kResamplingScrollEvents{"ResamplingScrollEvents",
543 base::FEATURE_ENABLED_BY_DEFAULT};
544
Yoav Weiss200214d52020-05-13 23:58:42545// Enables the device-memory, resource-width, viewport-width and DPR client
546// hints to be sent to third-party origins if the first-party has opted in to
547// receiving client hints, regardless of Feature Policy.
548#if defined(OS_ANDROID)
549const base::Feature kAllowClientHintsToThirdParty{
550 "AllowClientHintsToThirdParty", base::FEATURE_ENABLED_BY_DEFAULT};
551#else
552const base::Feature kAllowClientHintsToThirdParty{
553 "AllowClientHintsToThirdParty", base::FEATURE_DISABLED_BY_DEFAULT};
554#endif
555
Dave Tapuskafea88942020-05-05 18:50:32556const char kScrollPredictorNameLsq[] = "lsq";
557const char kScrollPredictorNameKalman[] = "kalman";
558const char kScrollPredictorNameLinearFirst[] = "linear_first";
559const char kScrollPredictorNameLinearSecond[] = "linear_second";
560const char kScrollPredictorNameLinearResampling[] = "linear_resampling";
561const char kScrollPredictorNameEmpty[] = "empty";
562
563const base::Feature kFilteringScrollPrediction{
564 "FilteringScrollPrediction", base::FEATURE_DISABLED_BY_DEFAULT};
565
566const char kFilterNameEmpty[] = "empty_filter";
567const char kFilterNameOneEuro[] = "one_euro_filter";
568
569const base::Feature kKalmanHeuristics{"KalmanHeuristics",
570 base::FEATURE_DISABLED_BY_DEFAULT};
571
572const base::Feature kKalmanDirectionCutOff{"KalmanDirectionCutOff",
573 base::FEATURE_DISABLED_BY_DEFAULT};
574
575const base::Feature kSkipTouchEventFilter{"SkipTouchEventFilter",
576 base::FEATURE_ENABLED_BY_DEFAULT};
577const char kSkipTouchEventFilterTypeParamName[] = "type";
578const char kSkipTouchEventFilterTypeParamValueDiscrete[] = "discrete";
579const char kSkipTouchEventFilterTypeParamValueAll[] = "all";
580const char kSkipTouchEventFilterFilteringProcessParamName[] =
581 "skip_filtering_process";
582const char kSkipTouchEventFilterFilteringProcessParamValueBrowser[] = "browser";
583const char kSkipTouchEventFilterFilteringProcessParamValueBrowserAndRenderer[] =
584 "browser_and_renderer";
585
Matt Falkenhagen5cc652792018-06-21 10:34:33586} // namespace features
587} // namespace blink