blob: 6c894a3c1d84859d772464045aed29e8b53f82a3 [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.
27const base::Feature kEagerCacheStorageSetupForServiceWorkers{
28 "EagerCacheStorageSetupForServiceWorkers",
29 base::FEATURE_ENABLED_BY_DEFAULT};
30
Peter Kvitek197eaf72018-12-04 19:14:5631// Controls script streaming.
32const base::Feature kScriptStreaming{"ScriptStreaming",
33 base::FEATURE_ENABLED_BY_DEFAULT};
34
Leszek Swirskif75c1912019-05-29 10:08:2535// Allow streaming small (<30kB) scripts.
36const base::Feature kSmallScriptStreaming{"SmallScriptStreaming",
37 base::FEATURE_DISABLED_BY_DEFAULT};
38
Keishi Hattori9e106922019-04-15 09:06:0339// Enables user level memory pressure signal generation on Android.
40const base::Feature kUserLevelMemoryPressureSignal{
41 "UserLevelMemoryPressureSignal", base::FEATURE_DISABLED_BY_DEFAULT};
42
Aditya Keerthi6a933902019-03-14 21:09:2743// Perform memory purges after freezing only if all pages are frozen.
44const base::Feature kFreezePurgeMemoryAllPagesFrozen{
45 "FreezePurgeMemoryAllPagesFrozen", base::FEATURE_DISABLED_BY_DEFAULT};
46
John Delaneyac24e572019-04-30 19:47:0247// Freezes the user-agent as part of https://github.com/WICG/ua-client-hints.
48const base::Feature kFreezeUserAgent{"FreezeUserAgent",
49 base::FEATURE_DISABLED_BY_DEFAULT};
50
Sam Fortiner7c87736f2019-12-12 22:42:0051// When enabled, enter assumed-overlap mode in compositing overlap testing
52// anytime a fixed or sticky position element is encountered.
53const base::Feature kAssumeOverlapAfterFixedOrStickyPosition{
54 "AssumeOverlapAfterFixedOrStickyPosition",
55 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
Ian Kilpatricke68ef11a2018-07-04 03:52:1064// Enable LayoutNG.
Emil A Eklund69eeb562019-07-03 01:38:3065const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT};
Ian Kilpatricke68ef11a2018-07-04 03:52:1066
Makoto Shimazu172eec02018-11-29 06:21:4467const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent",
Carlos IL9970a942020-02-14 01:16:5068 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:4469
Tarun Bansal422f9012019-01-23 16:55:5870// Used to control the collection of anchor element metrics (crbug.com/856683).
71// If kNavigationPredictor is enabled, then metrics of anchor elements
72// in the first viewport after the page load and the metrics of the clicked
73// anchor element will be extracted and recorded. Additionally, navigation
74// predictor may preconnect/prefetch to resources/origins to make the
75// future navigations faster.
Sofiya Semenovae4e076152019-07-29 20:10:2776const base::Feature kNavigationPredictor {
77 "NavigationPredictor",
78#if defined(OS_ANDROID)
79 base::FEATURE_ENABLED_BY_DEFAULT
80#else
81 base::FEATURE_DISABLED_BY_DEFAULT
82#endif
83};
Tarun Bansal422f9012019-01-23 16:55:5884
Kenichi Ishibashi0b9b91b2019-08-29 01:01:0985// Start service workers on a background thread.
Kenichi Ishibashi27bdc952019-08-16 03:16:3086// https://crbug.com/692909
87const base::Feature kOffMainThreadServiceWorkerStartup{
Kenichi Ishibashi083ed482019-09-05 23:50:1588 "OffMainThreadServiceWorkerStartup", base::FEATURE_ENABLED_BY_DEFAULT};
Kenichi Ishibashi27bdc952019-08-16 03:16:3089
Hiroki Nakagawa61ee0042019-01-22 06:30:2690// Enable browser-initiated dedicated worker script loading
91// (PlzDedicatedWorker). https://crbug.com/906991
92const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker",
93 base::FEATURE_DISABLED_BY_DEFAULT};
94
Daniel Murphy95792ef2018-10-04 01:29:5595// Enable Portals. https://crbug.com/865123.
96const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT};
97
Jeremy Roman20366e42019-10-22 17:48:0898// When kPortals is enabled, allow portals to load content that is third-party
99// (cross-origin) to the hosting page. Otherwise has no effect.
100//
101// This will be disabled by default by the time Portals is generally available,
102// either in origin trial or shipped.
103//
104// https://crbug.com/1013389
105const base::Feature kPortalsCrossOrigin{"PortalsCrossOrigin",
106 base::FEATURE_ENABLED_BY_DEFAULT};
107
Tarun Bansal8df12b52019-02-15 05:46:30108// Enable limiting previews loading hints to specific resource types.
109const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{
110 "PreviewsResourceLoadingHintsSpecificResourceTypes",
111 base::FEATURE_DISABLED_BY_DEFAULT};
112
Aditya Keerthie84331b32019-03-20 15:25:52113// Perform a memory purge after a renderer is backgrounded. Formerly labelled as
114// the "PurgeAndSuspend" experiment.
115//
116// TODO(adityakeerthi): Disabled by default on Mac and Android for historical
117// reasons. Consider enabling by default if experiment results are positive.
118// https://crbug.com/926186
119const base::Feature kPurgeRendererMemoryWhenBackgrounded {
120 "PurgeRendererMemoryWhenBackgrounded",
121#if defined(OS_MACOSX) || defined(OS_ANDROID)
122 base::FEATURE_DISABLED_BY_DEFAULT
123#else
124 base::FEATURE_ENABLED_BY_DEFAULT
125#endif
126};
127
David Bokan911bded2018-11-27 23:23:32128// Enable Implicit Root Scroller. https://crbug.com/903260.
David Bokan145b5472019-05-22 14:38:44129// TODO(bokan): Temporarily disabled on desktop platforms to address issues
130// with non-overlay scrollbars. https://crbug.com/948059.
131const base::Feature kImplicitRootScroller {
132 "ImplicitRootScroller",
133#if defined(OS_ANDROID)
134 base::FEATURE_ENABLED_BY_DEFAULT
135#else
136 base::FEATURE_DISABLED_BY_DEFAULT
137#endif
138};
David Bokan911bded2018-11-27 23:23:32139
Cathie Cheneac70602019-10-10 02:55:29140// Enable CSSOM View Scroll Coordinates. https://crbug.com/721759.
141const base::Feature kCSSOMViewScrollCoordinates{
142 "CSSOMViewScrollCoordinates", base::FEATURE_DISABLED_BY_DEFAULT};
143
Darwin Huangf588cc8e2019-12-13 22:24:56144// Enables Raw Clipboard. https://crbug.com/897289.
145const base::Feature kRawClipboard{"RawClipboard",
146 base::FEATURE_DISABLED_BY_DEFAULT};
147
Makoto Shimazu172eec02018-11-29 06:21:44148// Enables usage of getDisplayMedia() that allows capture of web content, see
149// https://crbug.com/865060.
150const base::Feature kRTCGetDisplayMedia{"RTCGetDisplayMedia",
151 base::FEATURE_ENABLED_BY_DEFAULT};
152
153// Changes the default RTCPeerConnection constructor behavior to use Unified
154// Plan as the SDP semantics. When the feature is enabled, Unified Plan is used
155// unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the
156// argument).
157const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault",
Henrik Boström07021ec82019-01-17 22:23:56158 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44159
Johannes Kronad5a4532019-01-09 11:17:46160// Determines if the SDP attrbute extmap-allow-mixed should be offered by
161// default or not. The default value can be overridden by passing
162// {offerExtmapAllowMixed:true} as an argument to the RTCPeerConnection
163// constructor.
164const base::Feature kRTCOfferExtmapAllowMixed{
165 "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT};
166
Antonio Gomesb4718572019-09-11 02:55:48167// Enables negotiation of experimental multiplex codec in SDP.
168const base::Feature kWebRtcMultiplexCodec{"WebRTC-MultiplexCodec",
169 base::FEATURE_DISABLED_BY_DEFAULT};
170
171// Causes WebRTC to replace host ICE candidate IP addresses with generated
172// names ending in ".local" and resolve them using mDNS.
173// http://crbug.com/878465
174const base::Feature kWebRtcHideLocalIpsWithMdns{
175 "WebRtcHideLocalIpsWithMdns", base::FEATURE_ENABLED_BY_DEFAULT};
176
Antonio Gomesf3bcd512019-09-03 21:27:17177#if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
178// Run-time feature for the |rtc_use_h264| encoder/decoder.
179const base::Feature kWebRtcH264WithOpenH264FFmpeg{
180 "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT};
181#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
182
Makoto Shimazua8b3d742019-04-05 06:55:51183// Experiment of the delay from navigation to starting an update of a service
184// worker's script.
185const base::Feature kServiceWorkerUpdateDelay{
186 "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT};
187
Scott Haseley8eefdcd2018-08-22 16:50:19188// Freeze scheduler task queues in background after allowed grace time.
189// "stop" is a legacy name.
190const base::Feature kStopInBackground {
191 "stop-in-background",
192#if defined(OS_ANDROID)
193 base::FEATURE_ENABLED_BY_DEFAULT
194#else
195 base::FEATURE_DISABLED_BY_DEFAULT
196#endif
197};
198
Takashi Sakamotoc19fc2b2019-04-10 06:30:52199// Freeze scheduler task queues in background on network idle.
200// This feature only works if stop-in-background is enabled.
201const base::Feature kFreezeBackgroundTabOnNetworkIdle{
202 "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT};
203
Shubhie Panicker60bd4b02018-09-26 00:02:15204// Freeze non-timer task queues in background, after allowed grace time.
205// "stop" is a legacy name.
Dave Tapuska9140c552019-05-30 16:18:56206const base::Feature kStopNonTimersInBackground{
207 "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT};
Scott Haseley7757f6c2018-08-03 14:33:23208
Brandon Maslenda12cf82019-08-23 20:54:18209// Enable the Storage Access API. https://crbug.com/989663.
210const base::Feature kStorageAccessAPI{"StorageAccessAPI",
211 base::FEATURE_DISABLED_BY_DEFAULT};
212
David Bokane9370c22019-02-14 15:19:58213// Enable text snippets in URL fragments. https://crbug.com/919204.
214const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
Nick Burris62f8d5f02020-01-16 22:54:51215 base::FEATURE_ENABLED_BY_DEFAULT};
David Bokane9370c22019-02-14 15:19:58216
Bill Budge4d028f12018-11-20 15:05:12217// Enables the site isolated Wasm code cache that is keyed on the resource URL
218// and the origin lock of the renderer that is requesting the resource. When
219// this flag is enabled, content/GeneratedCodeCache handles code cache requests.
220const base::Feature kWasmCodeCache = {"WasmCodeCache",
Bill Budgedd9b39d2019-12-16 11:53:49221 base::FEATURE_ENABLED_BY_DEFAULT};
Bill Budge4d028f12018-11-20 15:05:12222
Marijn Kruisselbrinkca4bb5e2019-04-22 18:19:42223// Writable files and native file system access. https://crbug.com/853326
224const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI",
Marijn Kruisselbrink4cc3ec22019-09-04 16:28:20225 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44226
Jay Harris583f48922019-05-06 05:55:24227// File handling integration. https://crbug.com/829689
228const base::Feature kFileHandlingAPI{"FileHandlingAPI",
229 base::FEATURE_DISABLED_BY_DEFAULT};
230
kdillon66bf5b522019-01-02 22:08:30231// Allows for synchronous XHR requests during page dismissal
Katie Dillon8b357312019-09-19 13:23:23232const base::Feature kAllowSyncXHRInPageDismissal{
233 "AllowSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT};
kdillon66bf5b522019-01-02 22:08:30234
Olivier Yiptongb60d2c42020-01-10 22:47:15235// Font enumeration and table access. https://crbug.com/535764 and
236// https://crbug.com/982054.
237const base::Feature kFontAccess{"FontAccess",
238 base::FEATURE_DISABLED_BY_DEFAULT};
239
Mason Freed490f2a22019-11-05 21:41:29240// Allows Web Components v0 to be re-enabled.
241const base::Feature kWebComponentsV0Enabled{"WebComponentsV0Enabled",
242 base::FEATURE_DISABLED_BY_DEFAULT};
243
Dominic Farolino780df942019-09-04 06:49:44244// Prefetch request properties are updated to be privacy-preserving. See
245// crbug.com/988956.
246const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges",
247 base::FEATURE_DISABLED_BY_DEFAULT};
Dominic Farolino693fd72d2019-08-05 11:09:44248
Carlos ILd3be52b2018-10-08 17:57:18249const char kMixedContentAutoupgradeModeParamName[] = "mode";
Carlos IL9970a942020-02-14 01:16:50250const char kMixedContentAutoupgradeModeAllPassive[] = "all-passive";
Carlos ILd3be52b2018-10-08 17:57:18251
Sasha McIntoshe889f9f2019-09-03 21:01:57252// Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this
253// format in the image decode cache. See crbug.com/919627 for details on the
254// feature.
255const base::Feature kDecodeJpeg420ImagesToYUV{
256 "DecodeJpeg420ImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT};
257
Madeleine Barowsky45be21a42018-12-07 18:39:30258// Decodes lossy WebP images to YUV instead of RGBX and stores in this format
259// in the image decode cache. See crbug.com/900264 for details on the feature.
260const base::Feature kDecodeLossyWebPImagesToYUV{
Sasha McIntoshf670a6b2020-01-09 18:27:09261 "DecodeLossyWebPImagesToYUV", base::FEATURE_ENABLED_BY_DEFAULT};
Madeleine Barowsky45be21a42018-12-07 18:39:30262
Takashi Toyoshimaa91506d2019-03-28 05:44:42263// Enables cache-aware WebFonts loading. See https://crbug.com/570205.
264// The feature is disabled on Android for WebView API issue discussed at
265// https://crbug.com/942440.
266const base::Feature kWebFontsCacheAwareTimeoutAdaption {
267 "WebFontsCacheAwareTimeoutAdaption",
268#if defined(OS_ANDROID)
269 base::FEATURE_DISABLED_BY_DEFAULT
270#else
271 base::FEATURE_ENABLED_BY_DEFAULT
272#endif
273};
274
Ehsan Karamadbe95d122019-05-10 17:59:06275// Enabled to block programmatic focus in subframes when not triggered by user
276// activation (see htpps://crbug.com/954349).
277const base::Feature kBlockingFocusWithoutUserActivation{
278 "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT};
279
Hongchan Choi370d3af2019-05-20 20:56:58280const base::Feature kAudioWorkletRealtimeThread{
281 "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT};
282
Ryan Sturm139c3ac2019-07-12 18:52:53283// A feature to reduce the set of resources fetched by No-State Prefetch.
284const base::Feature kLightweightNoStatePrefetch{
Ryan Sturmf223cb02019-10-04 18:02:00285 "LightweightNoStatePrefetch",
286#if defined(OS_ANDROID)
287 base::FEATURE_ENABLED_BY_DEFAULT
288#else
289 base::FEATURE_DISABLED_BY_DEFAULT
290#endif
291};
Ryan Sturm139c3ac2019-07-12 18:52:53292
Robert Ogden8dddf562019-11-21 18:20:36293// A feature to enable web fonts to be fetched by No-State Prefetch.
294const base::Feature kLightweightNoStatePrefetch_FetchFonts{
295 "LightweightNoStatePrefetch_FetchFonts", base::FEATURE_DISABLED_BY_DEFAULT};
296
Aran Gilman5e9672bed2019-08-02 19:07:49297// Automatically convert light-themed pages to use a Blink-generated dark theme
298const base::Feature kForceWebContentsDarkMode{
299 "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT};
300
301// Which algorithm should be used for color inversion?
302const base::FeatureParam<ForceDarkInversionMethod>::Option
303 forcedark_inversion_method_options[] = {
304 {ForceDarkInversionMethod::kUseBlinkSettings,
305 "use_blink_settings_for_method"},
306 {ForceDarkInversionMethod::kHslBased, "hsl_based"},
Aran Gilman8b3ca41c2019-08-12 18:59:04307 {ForceDarkInversionMethod::kCielabBased, "cielab_based"},
308 {ForceDarkInversionMethod::kRgbBased, "rgb_based"}};
Aran Gilman5e9672bed2019-08-02 19:07:49309
310const base::FeatureParam<ForceDarkInversionMethod>
311 kForceDarkInversionMethodParam{&kForceWebContentsDarkMode,
312 "inversion_method",
313 ForceDarkInversionMethod::kUseBlinkSettings,
314 &forcedark_inversion_method_options};
315
316// Should images be inverted?
317const base::FeatureParam<ForceDarkImageBehavior>::Option
318 forcedark_image_behavior_options[] = {
319 {ForceDarkImageBehavior::kUseBlinkSettings,
320 "use_blink_settings_for_images"},
321 {ForceDarkImageBehavior::kInvertNone, "none"},
322 {ForceDarkImageBehavior::kInvertSelectively, "selective"}};
323
324const base::FeatureParam<ForceDarkImageBehavior> kForceDarkImageBehaviorParam{
325 &kForceWebContentsDarkMode, "image_behavior",
326 ForceDarkImageBehavior::kUseBlinkSettings,
327 &forcedark_image_behavior_options};
328
329// Do not invert text lighter than this.
330// Range: 0 (do not invert any text) to 256 (invert all text)
331// Can also set to -1 to let Blink's internal settings control the value
332const base::FeatureParam<int> kForceDarkTextLightnessThresholdParam{
333 &kForceWebContentsDarkMode, "text_lightness_threshold", -1};
334
335// Do not invert backgrounds darker than this.
336// Range: 0 (invert all backgrounds) to 256 (invert no backgrounds)
337// Can also set to -1 to let Blink's internal settings control the value
338const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{
339 &kForceWebContentsDarkMode, "background_lightness_threshold", -1};
340
Sergey Silkinc33244f2020-01-31 17:21:30341// Instructs WebRTC to honor the Min/Max Video Encode Accelerator dimensions.
342const base::Feature kWebRtcUseMinMaxVEADimensions{
343 "WebRtcUseMinMaxVEADimensions", base::FEATURE_DISABLED_BY_DEFAULT};
344
Michael Lippautze670df9f2019-07-09 11:39:49345// Blink garbage collection.
346// Enables compaction of backing stores on Blink's heap.
347const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction",
348 base::FEATURE_ENABLED_BY_DEFAULT};
349// Enables concurrently marking Blink's heap.
350const base::Feature kBlinkHeapConcurrentMarking{
Omer Katz1757893c2020-02-17 12:09:19351 "BlinkHeapConcurrentMarking", base::FEATURE_ENABLED_BY_DEFAULT};
Anton Bikineev9b7b3722019-07-09 13:48:39352// Enables concurrently sweeping Blink's heap.
353const base::Feature kBlinkHeapConcurrentSweeping{
Anton Bikineev204cc752019-08-07 00:26:37354 "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49355// Enables incrementally marking Blink's heap.
356const base::Feature kBlinkHeapIncrementalMarking{
357 "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT};
358// Enables a marking stress mode that schedules more garbage collections and
359// also adds additional verification passes.
360const base::Feature kBlinkHeapIncrementalMarkingStress{
361 "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49362
Yoav Weissddfb8d2e2019-07-15 22:34:03363// Enables removing AppCache delays when triggering requests when the HTML was
364// not fetched from AppCache.
365const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{
366 "VerifyHTMLFetchedFromAppCacheBeforeDelay",
367 base::FEATURE_DISABLED_BY_DEFAULT};
368
Michael Spang8d2303e2019-07-26 01:56:32369// Controls whether we use ThreadPriority::DISPLAY for renderer
370// compositor & IO threads.
371const base::Feature kBlinkCompositorUseDisplayThreadPriority {
372 "BlinkCompositorUseDisplayThreadPriority",
Sunny Sachanandani16944252019-12-04 03:40:49373#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
Michael Spang8d2303e2019-07-26 01:56:32374 base::FEATURE_ENABLED_BY_DEFAULT
375#else
376 base::FEATURE_DISABLED_BY_DEFAULT
377#endif
378};
379
Yuki Shiinoa812f492019-08-23 06:47:46380// Ignores cross origin windows in the named property interceptor of Window.
381// https://crbug.com/538562
382const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{
383 "IgnoreCrossOriginWindowWhenNamedAccessOnWindow",
384 base::FEATURE_DISABLED_BY_DEFAULT};
385
Tarun Bansal38792462019-09-04 16:08:11386// When enabled, loading priority of JavaScript requests is lowered when they
387// are force deferred by the intervention.
388const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{
389 "LowerJavaScriptPriorityWhenForceDeferred",
Tarun Bansal755268fe2019-10-18 18:57:40390 base::FEATURE_DISABLED_BY_DEFAULT};
Tarun Bansal38792462019-09-04 16:08:11391
Tarun Bansalf32aaa22020-02-12 16:16:44392// When enabled, scripts in iframes are not force deferred by the DeferAllScript
393// intervention.
394const base::Feature kDisableForceDeferInChildFrames{
395 "DisableForceDeferInChildFrames", base::FEATURE_DISABLED_BY_DEFAULT};
396
Hiroshige Hayashizaki8ee3f7e62019-09-05 07:17:47397const base::Feature kHtmlImportsRequestInitiatorLock{
Yutaka Hiranoe7c0e4d2019-10-10 18:04:32398 "HtmlImportsRequestInitiatorLock", base::FEATURE_ENABLED_BY_DEFAULT};
Hiroshige Hayashizaki8ee3f7e62019-09-05 07:17:47399
rajendrantd5db55f2019-10-19 01:56:59400// Enables redirecting subresources in the page to better compressed and
401// optimized versions to provide data savings.
402const base::Feature kSubresourceRedirect{"SubresourceRedirect",
403 base::FEATURE_DISABLED_BY_DEFAULT};
404
Stefan Zagerfd18161c2019-10-22 20:44:31405// When 'enabled', all cross-origin iframes will get a compositing layer.
406const base::Feature kCompositeCrossOriginIframes{
407 "CompositeCrossOriginIframes", base::FEATURE_DISABLED_BY_DEFAULT};
Yutaka Hirano0b3c319b2019-10-25 17:19:15408
Stefan Zager1e600b32019-12-11 00:31:52409// When 'enabled', an accurate occlusion test will be performed to improve the
410// quality of viz hit test data.
411const base::Feature kVizHitTestOcclusionCheck{
412 "VizHitTestOcclusionCheck", base::FEATURE_DISABLED_BY_DEFAULT};
413
Yutaka Hirano0b3c319b2019-10-25 17:19:15414// When enabled, beacons (and friends) have ResourceLoadPriority::kLow,
415// not ResourceLoadPriority::kVeryLow.
416const base::Feature kSetLowPriorityForBeacon{"SetLowPriorityForBeacon",
417 base::FEATURE_DISABLED_BY_DEFAULT};
418
Ben Kelly776f59d2019-11-06 16:25:30419// When enabled allows the header name used in the blink
420// CacheStorageCodeCacheHint runtime feature to be modified. This runtime
421// feature disables generating full code cache for responses stored in
422// cache_storage during a service worker install event. The runtime feature
423// must be enabled via the blink runtime feature mechanism, however.
424const base::Feature kCacheStorageCodeCacheHintHeader{
425 "CacheStorageCodeCacheHintHeader", base::FEATURE_DISABLED_BY_DEFAULT};
426const base::FeatureParam<std::string> kCacheStorageCodeCacheHintHeaderName{
427 &kCacheStorageCodeCacheHintHeader, "name", "x-CacheStorageCodeCacheHint"};
428
Francois Doray563453432019-11-20 15:32:17429// When enabled, the beforeunload handler is dispatched when a frame is frozen.
430// This allows the browser to know whether discarding the frame could result in
431// lost user data, at the cost of extra CPU usage. The feature will be removed
432// once we have determine whether the CPU cost is acceptable.
433const base::Feature kDispatchBeforeUnloadOnFreeze{
434 "DispatchBeforeUnloadOnFreeze", base::FEATURE_ENABLED_BY_DEFAULT};
435
Sunny Sachanandani26463422019-12-05 21:35:40436// Enables the use of GpuMemoryBuffer images for low latency 2d canvas.
437// TODO(khushalsagar): Enable this if we're using SurfaceControl and GMBs allow
438// us to overlay these resources.
439const base::Feature kLowLatencyCanvas2dImageChromium {
440 "LowLatencyCanvas2dImageChromium",
441#if defined(OS_CHROMEOS)
442 base::FEATURE_ENABLED_BY_DEFAULT
443#else
444 base::FEATURE_DISABLED_BY_DEFAULT
445#endif // OS_CHROMEOS
446};
447
448// Enables the use of shared image swap chains for low latency 2d canvas.
449const base::Feature kLowLatencyCanvas2dSwapChain{
Sunny Sachanandanib954dc7c2019-12-12 02:50:51450 "LowLatencyCanvas2dSwapChain", base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40451
452// Enables the use of shared image swap chains for low latency webgl canvas.
Sunny Sachanandanib954dc7c2019-12-12 02:50:51453const base::Feature kLowLatencyWebGLSwapChain{"LowLatencyWebGLSwapChain",
454 base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40455
Yao Xiaoc646d0b2020-01-31 22:30:59456// Enables forcing additional rendering of subframes for the purpose of sticky
457// frame tracking.
458const base::Feature kForceExtraRenderingToTrackStickyFrame{
459 "ForceExtraRenderingToTrackStickyFrame", base::FEATURE_DISABLED_BY_DEFAULT};
460
Xiaocheng Hud5197fd2020-02-06 07:26:08461const base::Feature kCSSReducedFontLoadingInvalidations{
462 "CSSReducedFontLoadingInvalidations", base::FEATURE_DISABLED_BY_DEFAULT};
463
Egor Pasko28ec46952020-02-07 15:17:57464// When enabled, frees up CachedMetadata after consumption by script resources
465// and modules. Needed for the experiment in http://crbug.com/1045052.
466const base::Feature kDiscardCodeCacheAfterFirstUse{
467 "DiscardCodeCacheAfterFirstUse", base::FEATURE_DISABLED_BY_DEFAULT};
468
Matt Falkenhagen5cc652792018-06-21 10:34:33469} // namespace features
470} // namespace blink