blob: 80e5d058b83548ed683738c9444ba8f8b6e951f8 [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
Philip Rogersed87a7e2019-10-19 00:12:3451// When enabled, the compositing of trivial 3D transforms is disabled.
52const base::Feature kDoNotCompositeTrivial3D{"DoNotCompositeTrivial3D",
Philip Rogers23030422019-10-21 20:27:4953 base::FEATURE_DISABLED_BY_DEFAULT};
Philip Rogersed87a7e2019-10-19 00:12:3454
Sam Fortiner7c87736f2019-12-12 22:42:0055// When enabled, enter assumed-overlap mode in compositing overlap testing
56// anytime a fixed or sticky position element is encountered.
57const base::Feature kAssumeOverlapAfterFixedOrStickyPosition{
58 "AssumeOverlapAfterFixedOrStickyPosition",
59 base::FEATURE_DISABLED_BY_DEFAULT};
60
Vladimir Levin43758ecc2019-05-09 18:04:0361// Enable Display Locking JavaScript APIs.
62const base::Feature kDisplayLocking{"DisplayLocking",
63 base::FEATURE_DISABLED_BY_DEFAULT};
64
Chris Harrelson6e41e3ae2019-05-03 23:09:4065// Enable applying rounded corner masks via a GL shader rather than
66// a mask layer.
Robert Ogden8dddf562019-11-21 18:20:3667const base::Feature kFastBorderRadius{"FastBorderRadius",
68 base::FEATURE_ENABLED_BY_DEFAULT};
Chris Harrelson6e41e3ae2019-05-03 23:09:4069
Sam Sebree2dd45c4f2019-12-13 05:51:4970const base::Feature kJSONModules{"JSONModules",
71 base::FEATURE_DISABLED_BY_DEFAULT};
72
Ian Kilpatricke68ef11a2018-07-04 03:52:1073// Enable LayoutNG.
Emil A Eklund69eeb562019-07-03 01:38:3074const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT};
Ian Kilpatricke68ef11a2018-07-04 03:52:1075
Makoto Shimazu172eec02018-11-29 06:21:4476const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent",
77 base::FEATURE_DISABLED_BY_DEFAULT};
78
Tarun Bansal422f9012019-01-23 16:55:5879// Used to control the collection of anchor element metrics (crbug.com/856683).
80// If kNavigationPredictor is enabled, then metrics of anchor elements
81// in the first viewport after the page load and the metrics of the clicked
82// anchor element will be extracted and recorded. Additionally, navigation
83// predictor may preconnect/prefetch to resources/origins to make the
84// future navigations faster.
Sofiya Semenovae4e076152019-07-29 20:10:2785const base::Feature kNavigationPredictor {
86 "NavigationPredictor",
87#if defined(OS_ANDROID)
88 base::FEATURE_ENABLED_BY_DEFAULT
89#else
90 base::FEATURE_DISABLED_BY_DEFAULT
91#endif
92};
Tarun Bansal422f9012019-01-23 16:55:5893
Kenichi Ishibashi0b9b91b2019-08-29 01:01:0994// Start service workers on a background thread.
Kenichi Ishibashi27bdc952019-08-16 03:16:3095// https://crbug.com/692909
96const base::Feature kOffMainThreadServiceWorkerStartup{
Kenichi Ishibashi083ed482019-09-05 23:50:1597 "OffMainThreadServiceWorkerStartup", base::FEATURE_ENABLED_BY_DEFAULT};
Kenichi Ishibashi27bdc952019-08-16 03:16:3098
Hiroki Nakagawa61ee0042019-01-22 06:30:2699// Enable browser-initiated dedicated worker script loading
100// (PlzDedicatedWorker). https://crbug.com/906991
101const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker",
102 base::FEATURE_DISABLED_BY_DEFAULT};
103
Daniel Murphy95792ef2018-10-04 01:29:55104// Enable Portals. https://crbug.com/865123.
105const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT};
106
Jeremy Roman20366e42019-10-22 17:48:08107// 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
114const base::Feature kPortalsCrossOrigin{"PortalsCrossOrigin",
115 base::FEATURE_ENABLED_BY_DEFAULT};
116
Tarun Bansal8df12b52019-02-15 05:46:30117// Enable limiting previews loading hints to specific resource types.
118const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{
119 "PreviewsResourceLoadingHintsSpecificResourceTypes",
120 base::FEATURE_DISABLED_BY_DEFAULT};
121
Aditya Keerthie84331b32019-03-20 15:25:52122// 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
128const 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 Bokan911bded2018-11-27 23:23:32137// Enable Implicit Root Scroller. https://crbug.com/903260.
David Bokan145b5472019-05-22 14:38:44138// TODO(bokan): Temporarily disabled on desktop platforms to address issues
139// with non-overlay scrollbars. https://crbug.com/948059.
140const 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 Bokan911bded2018-11-27 23:23:32148
Cathie Cheneac70602019-10-10 02:55:29149// Enable CSSOM View Scroll Coordinates. https://crbug.com/721759.
150const base::Feature kCSSOMViewScrollCoordinates{
151 "CSSOMViewScrollCoordinates", base::FEATURE_DISABLED_BY_DEFAULT};
152
Darwin Huangf588cc8e2019-12-13 22:24:56153// Enables Raw Clipboard. https://crbug.com/897289.
154const base::Feature kRawClipboard{"RawClipboard",
155 base::FEATURE_DISABLED_BY_DEFAULT};
156
Makoto Shimazu172eec02018-11-29 06:21:44157// Enables usage of getDisplayMedia() that allows capture of web content, see
158// https://crbug.com/865060.
159const 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).
166const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault",
Henrik Boström07021ec82019-01-17 22:23:56167 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44168
Johannes Kronad5a4532019-01-09 11:17:46169// 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.
173const base::Feature kRTCOfferExtmapAllowMixed{
174 "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT};
175
Antonio Gomesb4718572019-09-11 02:55:48176// Enables negotiation of experimental multiplex codec in SDP.
177const base::Feature kWebRtcMultiplexCodec{"WebRTC-MultiplexCodec",
178 base::FEATURE_DISABLED_BY_DEFAULT};
179
180// Causes WebRTC to replace host ICE candidate IP addresses with generated
181// names ending in ".local" and resolve them using mDNS.
182// http://crbug.com/878465
183const base::Feature kWebRtcHideLocalIpsWithMdns{
184 "WebRtcHideLocalIpsWithMdns", base::FEATURE_ENABLED_BY_DEFAULT};
185
Antonio Gomesf3bcd512019-09-03 21:27:17186#if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
187// Run-time feature for the |rtc_use_h264| encoder/decoder.
188const base::Feature kWebRtcH264WithOpenH264FFmpeg{
189 "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT};
190#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
191
momohattfc352292018-08-29 05:12:36192const base::Feature kServiceWorkerImportedScriptUpdateCheck{
Makoto Shimazub9067eb02019-08-18 23:42:53193 "ServiceWorkerImportedScriptUpdateCheck", base::FEATURE_ENABLED_BY_DEFAULT};
momohattfc352292018-08-29 05:12:36194
Makoto Shimazua8b3d742019-04-05 06:55:51195// Experiment of the delay from navigation to starting an update of a service
196// worker's script.
197const base::Feature kServiceWorkerUpdateDelay{
198 "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT};
199
Scott Haseley8eefdcd2018-08-22 16:50:19200// Freeze scheduler task queues in background after allowed grace time.
201// "stop" is a legacy name.
202const base::Feature kStopInBackground {
203 "stop-in-background",
204#if defined(OS_ANDROID)
205 base::FEATURE_ENABLED_BY_DEFAULT
206#else
207 base::FEATURE_DISABLED_BY_DEFAULT
208#endif
209};
210
Takashi Sakamotoc19fc2b2019-04-10 06:30:52211// Freeze scheduler task queues in background on network idle.
212// This feature only works if stop-in-background is enabled.
213const base::Feature kFreezeBackgroundTabOnNetworkIdle{
214 "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT};
215
Shubhie Panicker60bd4b02018-09-26 00:02:15216// Freeze non-timer task queues in background, after allowed grace time.
217// "stop" is a legacy name.
Dave Tapuska9140c552019-05-30 16:18:56218const base::Feature kStopNonTimersInBackground{
219 "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT};
Scott Haseley7757f6c2018-08-03 14:33:23220
Brandon Maslenda12cf82019-08-23 20:54:18221// Enable the Storage Access API. https://crbug.com/989663.
222const base::Feature kStorageAccessAPI{"StorageAccessAPI",
223 base::FEATURE_DISABLED_BY_DEFAULT};
224
David Bokane9370c22019-02-14 15:19:58225// Enable text snippets in URL fragments. https://crbug.com/919204.
226const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
227 base::FEATURE_DISABLED_BY_DEFAULT};
228
Bill Budge4d028f12018-11-20 15:05:12229// Enables the site isolated Wasm code cache that is keyed on the resource URL
230// and the origin lock of the renderer that is requesting the resource. When
231// this flag is enabled, content/GeneratedCodeCache handles code cache requests.
232const base::Feature kWasmCodeCache = {"WasmCodeCache",
233 base::FEATURE_DISABLED_BY_DEFAULT};
234
Marijn Kruisselbrinkca4bb5e2019-04-22 18:19:42235// Writable files and native file system access. https://crbug.com/853326
236const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI",
Marijn Kruisselbrink4cc3ec22019-09-04 16:28:20237 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44238
Jay Harris583f48922019-05-06 05:55:24239// File handling integration. https://crbug.com/829689
240const base::Feature kFileHandlingAPI{"FileHandlingAPI",
241 base::FEATURE_DISABLED_BY_DEFAULT};
242
kdillon66bf5b522019-01-02 22:08:30243// Allows for synchronous XHR requests during page dismissal
Katie Dillon8b357312019-09-19 13:23:23244const base::Feature kAllowSyncXHRInPageDismissal{
245 "AllowSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT};
kdillon66bf5b522019-01-02 22:08:30246
Mason Freed490f2a22019-11-05 21:41:29247// Allows Web Components v0 to be re-enabled.
248const base::Feature kWebComponentsV0Enabled{"WebComponentsV0Enabled",
249 base::FEATURE_DISABLED_BY_DEFAULT};
250
Dominic Farolino780df942019-09-04 06:49:44251// Prefetch request properties are updated to be privacy-preserving. See
252// crbug.com/988956.
253const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges",
254 base::FEATURE_DISABLED_BY_DEFAULT};
Dominic Farolino693fd72d2019-08-05 11:09:44255
Carlos ILd3be52b2018-10-08 17:57:18256const char kMixedContentAutoupgradeModeParamName[] = "mode";
Carlos IL06a8b242019-11-22 22:46:47257const char kMixedContentAutoupgradeModeNoImages[] = "no-images";
Carlos ILd3be52b2018-10-08 17:57:18258
Sasha McIntoshe889f9f2019-09-03 21:01:57259// Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this
260// format in the image decode cache. See crbug.com/919627 for details on the
261// feature.
262const base::Feature kDecodeJpeg420ImagesToYUV{
263 "DecodeJpeg420ImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT};
264
Madeleine Barowsky45be21a42018-12-07 18:39:30265// Decodes lossy WebP images to YUV instead of RGBX and stores in this format
266// in the image decode cache. See crbug.com/900264 for details on the feature.
267const base::Feature kDecodeLossyWebPImagesToYUV{
268 "DecodeLossyWebPImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT};
269
Takashi Toyoshimaa91506d2019-03-28 05:44:42270// Enables cache-aware WebFonts loading. See https://crbug.com/570205.
271// The feature is disabled on Android for WebView API issue discussed at
272// https://crbug.com/942440.
273const base::Feature kWebFontsCacheAwareTimeoutAdaption {
274 "WebFontsCacheAwareTimeoutAdaption",
275#if defined(OS_ANDROID)
276 base::FEATURE_DISABLED_BY_DEFAULT
277#else
278 base::FEATURE_ENABLED_BY_DEFAULT
279#endif
280};
281
Ehsan Karamadbe95d122019-05-10 17:59:06282// Enabled to block programmatic focus in subframes when not triggered by user
283// activation (see htpps://crbug.com/954349).
284const base::Feature kBlockingFocusWithoutUserActivation{
285 "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT};
286
Hongchan Choi370d3af2019-05-20 20:56:58287const base::Feature kAudioWorkletRealtimeThread{
288 "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT};
289
Ryan Sturm139c3ac2019-07-12 18:52:53290// A feature to reduce the set of resources fetched by No-State Prefetch.
291const base::Feature kLightweightNoStatePrefetch{
Ryan Sturmf223cb02019-10-04 18:02:00292 "LightweightNoStatePrefetch",
293#if defined(OS_ANDROID)
294 base::FEATURE_ENABLED_BY_DEFAULT
295#else
296 base::FEATURE_DISABLED_BY_DEFAULT
297#endif
298};
Ryan Sturm139c3ac2019-07-12 18:52:53299
Robert Ogden8dddf562019-11-21 18:20:36300// A feature to enable web fonts to be fetched by No-State Prefetch.
301const base::Feature kLightweightNoStatePrefetch_FetchFonts{
302 "LightweightNoStatePrefetch_FetchFonts", base::FEATURE_DISABLED_BY_DEFAULT};
303
Aran Gilman5e9672bed2019-08-02 19:07:49304// Automatically convert light-themed pages to use a Blink-generated dark theme
305const base::Feature kForceWebContentsDarkMode{
306 "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT};
307
308// Which algorithm should be used for color inversion?
309const base::FeatureParam<ForceDarkInversionMethod>::Option
310 forcedark_inversion_method_options[] = {
311 {ForceDarkInversionMethod::kUseBlinkSettings,
312 "use_blink_settings_for_method"},
313 {ForceDarkInversionMethod::kHslBased, "hsl_based"},
Aran Gilman8b3ca41c2019-08-12 18:59:04314 {ForceDarkInversionMethod::kCielabBased, "cielab_based"},
315 {ForceDarkInversionMethod::kRgbBased, "rgb_based"}};
Aran Gilman5e9672bed2019-08-02 19:07:49316
317const base::FeatureParam<ForceDarkInversionMethod>
318 kForceDarkInversionMethodParam{&kForceWebContentsDarkMode,
319 "inversion_method",
320 ForceDarkInversionMethod::kUseBlinkSettings,
321 &forcedark_inversion_method_options};
322
323// Should images be inverted?
324const base::FeatureParam<ForceDarkImageBehavior>::Option
325 forcedark_image_behavior_options[] = {
326 {ForceDarkImageBehavior::kUseBlinkSettings,
327 "use_blink_settings_for_images"},
328 {ForceDarkImageBehavior::kInvertNone, "none"},
329 {ForceDarkImageBehavior::kInvertSelectively, "selective"}};
330
331const base::FeatureParam<ForceDarkImageBehavior> kForceDarkImageBehaviorParam{
332 &kForceWebContentsDarkMode, "image_behavior",
333 ForceDarkImageBehavior::kUseBlinkSettings,
334 &forcedark_image_behavior_options};
335
336// Do not invert text lighter than this.
337// Range: 0 (do not invert any text) to 256 (invert all text)
338// Can also set to -1 to let Blink's internal settings control the value
339const base::FeatureParam<int> kForceDarkTextLightnessThresholdParam{
340 &kForceWebContentsDarkMode, "text_lightness_threshold", -1};
341
342// Do not invert backgrounds darker than this.
343// Range: 0 (invert all backgrounds) to 256 (invert no backgrounds)
344// Can also set to -1 to let Blink's internal settings control the value
345const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{
346 &kForceWebContentsDarkMode, "background_lightness_threshold", -1};
347
Miguel Casas72037f822019-12-03 15:27:53348// Instructs WebRTC to honor the Min/Max Video Encode Accelerator dimensions.
349const base::Feature kWebRtcUseMinMaxVEADimensions{
Miguel Casas3b55c9c2019-12-10 02:14:44350 "WebRtcUseMinMaxVEADimensions", base::FEATURE_DISABLED_BY_DEFAULT};
Miguel Casas72037f822019-12-03 15:27:53351
Michael Lippautze670df9f2019-07-09 11:39:49352// Blink garbage collection.
353// Enables compaction of backing stores on Blink's heap.
354const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction",
355 base::FEATURE_ENABLED_BY_DEFAULT};
356// Enables concurrently marking Blink's heap.
357const base::Feature kBlinkHeapConcurrentMarking{
358 "BlinkHeapConcurrentMarking", base::FEATURE_DISABLED_BY_DEFAULT};
Anton Bikineev9b7b3722019-07-09 13:48:39359// Enables concurrently sweeping Blink's heap.
360const base::Feature kBlinkHeapConcurrentSweeping{
Anton Bikineev204cc752019-08-07 00:26:37361 "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49362// Enables incrementally marking Blink's heap.
363const base::Feature kBlinkHeapIncrementalMarking{
364 "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT};
365// Enables a marking stress mode that schedules more garbage collections and
366// also adds additional verification passes.
367const base::Feature kBlinkHeapIncrementalMarkingStress{
368 "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49369
Yoav Weissddfb8d2e2019-07-15 22:34:03370// Enables removing AppCache delays when triggering requests when the HTML was
371// not fetched from AppCache.
372const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{
373 "VerifyHTMLFetchedFromAppCacheBeforeDelay",
374 base::FEATURE_DISABLED_BY_DEFAULT};
375
Michael Spang8d2303e2019-07-26 01:56:32376// Controls whether we use ThreadPriority::DISPLAY for renderer
377// compositor & IO threads.
378const base::Feature kBlinkCompositorUseDisplayThreadPriority {
379 "BlinkCompositorUseDisplayThreadPriority",
Sunny Sachanandani16944252019-12-04 03:40:49380#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
Michael Spang8d2303e2019-07-26 01:56:32381 base::FEATURE_ENABLED_BY_DEFAULT
382#else
383 base::FEATURE_DISABLED_BY_DEFAULT
384#endif
385};
386
Yuki Shiinoa812f492019-08-23 06:47:46387// Ignores cross origin windows in the named property interceptor of Window.
388// https://crbug.com/538562
389const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{
390 "IgnoreCrossOriginWindowWhenNamedAccessOnWindow",
391 base::FEATURE_DISABLED_BY_DEFAULT};
392
Tarun Bansal38792462019-09-04 16:08:11393// When enabled, loading priority of JavaScript requests is lowered when they
394// are force deferred by the intervention.
395const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{
396 "LowerJavaScriptPriorityWhenForceDeferred",
Tarun Bansal755268fe2019-10-18 18:57:40397 base::FEATURE_DISABLED_BY_DEFAULT};
Tarun Bansal38792462019-09-04 16:08:11398
Hiroshige Hayashizaki8ee3f7e62019-09-05 07:17:47399const base::Feature kHtmlImportsRequestInitiatorLock{
Yutaka Hiranoe7c0e4d2019-10-10 18:04:32400 "HtmlImportsRequestInitiatorLock", base::FEATURE_ENABLED_BY_DEFAULT};
Hiroshige Hayashizaki8ee3f7e62019-09-05 07:17:47401
Daniel Libby31b2a922019-10-15 00:58:30402// When 'enabled', directly compositing images is turned off.
403const base::Feature kDisableDirectlyCompositedImages{
404 "DisableDirectlyCompositedImages", base::FEATURE_DISABLED_BY_DEFAULT};
405
rajendrantd5db55f2019-10-19 01:56:59406// Enables redirecting subresources in the page to better compressed and
407// optimized versions to provide data savings.
408const base::Feature kSubresourceRedirect{"SubresourceRedirect",
409 base::FEATURE_DISABLED_BY_DEFAULT};
410
Stefan Zagerfd18161c2019-10-22 20:44:31411// When 'enabled', all cross-origin iframes will get a compositing layer.
412const base::Feature kCompositeCrossOriginIframes{
413 "CompositeCrossOriginIframes", base::FEATURE_DISABLED_BY_DEFAULT};
Yutaka Hirano0b3c319b2019-10-25 17:19:15414
Stefan Zager1e600b32019-12-11 00:31:52415// When 'enabled', an accurate occlusion test will be performed to improve the
416// quality of viz hit test data.
417const base::Feature kVizHitTestOcclusionCheck{
418 "VizHitTestOcclusionCheck", base::FEATURE_DISABLED_BY_DEFAULT};
419
Yutaka Hirano0b3c319b2019-10-25 17:19:15420// When enabled, beacons (and friends) have ResourceLoadPriority::kLow,
421// not ResourceLoadPriority::kVeryLow.
422const base::Feature kSetLowPriorityForBeacon{"SetLowPriorityForBeacon",
423 base::FEATURE_DISABLED_BY_DEFAULT};
424
Bartek Nowierskia41686732019-11-05 11:11:46425// When enabled, JS function calls in a detached window will be reported.
426// Reporting has a non-zero probability of a performance impact, hence an easy
427// way to disable it may come in handy.
428const base::Feature kSetDetachedWindowReasonByNavigation{
429 "SetDetachedWindowReasonByNavigation", base::FEATURE_ENABLED_BY_DEFAULT};
430const base::Feature kSetDetachedWindowReasonByClosing{
431 "SetDetachedWindowReasonByClosing", base::FEATURE_ENABLED_BY_DEFAULT};
432const base::Feature kSetDetachedWindowReasonByOtherReason{
433 "SetDetachedWindowReasonByOtherReason", base::FEATURE_ENABLED_BY_DEFAULT};
434
Ben Kelly776f59d2019-11-06 16:25:30435// When enabled allows the header name used in the blink
436// CacheStorageCodeCacheHint runtime feature to be modified. This runtime
437// feature disables generating full code cache for responses stored in
438// cache_storage during a service worker install event. The runtime feature
439// must be enabled via the blink runtime feature mechanism, however.
440const base::Feature kCacheStorageCodeCacheHintHeader{
441 "CacheStorageCodeCacheHintHeader", base::FEATURE_DISABLED_BY_DEFAULT};
442const base::FeatureParam<std::string> kCacheStorageCodeCacheHintHeaderName{
443 &kCacheStorageCodeCacheHintHeader, "name", "x-CacheStorageCodeCacheHint"};
444
Francois Doray563453432019-11-20 15:32:17445// When enabled, the beforeunload handler is dispatched when a frame is frozen.
446// This allows the browser to know whether discarding the frame could result in
447// lost user data, at the cost of extra CPU usage. The feature will be removed
448// once we have determine whether the CPU cost is acceptable.
449const base::Feature kDispatchBeforeUnloadOnFreeze{
450 "DispatchBeforeUnloadOnFreeze", base::FEATURE_ENABLED_BY_DEFAULT};
451
Sunny Sachanandani26463422019-12-05 21:35:40452// Enables the use of GpuMemoryBuffer images for low latency 2d canvas.
453// TODO(khushalsagar): Enable this if we're using SurfaceControl and GMBs allow
454// us to overlay these resources.
455const base::Feature kLowLatencyCanvas2dImageChromium {
456 "LowLatencyCanvas2dImageChromium",
457#if defined(OS_CHROMEOS)
458 base::FEATURE_ENABLED_BY_DEFAULT
459#else
460 base::FEATURE_DISABLED_BY_DEFAULT
461#endif // OS_CHROMEOS
462};
463
464// Enables the use of shared image swap chains for low latency 2d canvas.
465const base::Feature kLowLatencyCanvas2dSwapChain{
Sunny Sachanandanib954dc7c2019-12-12 02:50:51466 "LowLatencyCanvas2dSwapChain", base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40467
468// Enables the use of shared image swap chains for low latency webgl canvas.
Sunny Sachanandanib954dc7c2019-12-12 02:50:51469const base::Feature kLowLatencyWebGLSwapChain{"LowLatencyWebGLSwapChain",
470 base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40471
Matt Falkenhagen5cc652792018-06-21 10:34:33472} // namespace features
473} // namespace blink