blob: 8c8500125c33198619a979ac35f2a14aa8c0df49 [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 Chenneyde6e5c82019-01-21 01:56:0421// Enable defer commits a bit to avoid flash.
22const base::Feature kAvoidFlashBetweenNavigation{
Stephen Chenneyebb056b2019-09-06 11:58:0223 "AvoidFlashBetweenNavigation", 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
Eric Karl0623ec72018-10-30 19:43:2631// Controls the user-specified viewport restriction for GPU Rasterization on
32// mobile. See https://crbug.com/899399
33const base::Feature kEnableGpuRasterizationViewportRestriction{
34 "EnableGpuRasterizationViewportRestriction",
Eric Karl35944642019-07-17 23:58:2435 base::FEATURE_DISABLED_BY_DEFAULT};
Eric Karl0623ec72018-10-30 19:43:2636
Peter Kvitek197eaf72018-12-04 19:14:5637// Controls script streaming.
38const base::Feature kScriptStreaming{"ScriptStreaming",
39 base::FEATURE_ENABLED_BY_DEFAULT};
40
Leszek Swirskif75c1912019-05-29 10:08:2541// Allow streaming small (<30kB) scripts.
42const base::Feature kSmallScriptStreaming{"SmallScriptStreaming",
43 base::FEATURE_DISABLED_BY_DEFAULT};
44
Keishi Hattori9e106922019-04-15 09:06:0345// Enables user level memory pressure signal generation on Android.
46const base::Feature kUserLevelMemoryPressureSignal{
47 "UserLevelMemoryPressureSignal", base::FEATURE_DISABLED_BY_DEFAULT};
48
Liquan(Max) Gu4e243fc2018-11-17 00:13:0249// Enable FCP++ by experiment. See https://crbug.com/869924
50const base::Feature kFirstContentfulPaintPlusPlus{
Liquan(Max) Gu739af152019-06-07 19:27:1951 "FirstContentfulPaintPlusPlus", base::FEATURE_ENABLED_BY_DEFAULT};
Liquan(Max) Gu4e243fc2018-11-17 00:13:0252
Aditya Keerthi6a933902019-03-14 21:09:2753// Perform memory purges after freezing only if all pages are frozen.
54const base::Feature kFreezePurgeMemoryAllPagesFrozen{
55 "FreezePurgeMemoryAllPagesFrozen", base::FEATURE_DISABLED_BY_DEFAULT};
56
John Delaneyac24e572019-04-30 19:47:0257// Freezes the user-agent as part of https://github.com/WICG/ua-client-hints.
58const base::Feature kFreezeUserAgent{"FreezeUserAgent",
59 base::FEATURE_DISABLED_BY_DEFAULT};
60
Mason Freedc166cf12019-06-14 19:04:2661// Enable a new CSS property called backdrop-filter.
Mason Freed34663f42019-09-06 22:40:0562const base::Feature kCSSBackdropFilter{"CSSBackdropFilter",
63 base::FEATURE_ENABLED_BY_DEFAULT};
Mason Freedc166cf12019-06-14 19:04:2664
Vladimir Levin43758ecc2019-05-09 18:04:0365// Enable Display Locking JavaScript APIs.
66const base::Feature kDisplayLocking{"DisplayLocking",
67 base::FEATURE_DISABLED_BY_DEFAULT};
68
Chris Harrelson6e41e3ae2019-05-03 23:09:4069// Enable applying rounded corner masks via a GL shader rather than
70// a mask layer.
Chris Harrelson3f7e36112019-08-21 19:15:4871const base::Feature kFastBorderRadius {
72 "FastBorderRadius",
73#if defined(OS_MACOSX)
74 // A FastBorderRadiusMac experiment is rolling out separately for that
75 // platform, due to complications with CALayer overlay optimizations.
76 base::FEATURE_DISABLED_BY_DEFAULT
77#else
78 base::FEATURE_ENABLED_BY_DEFAULT
79#endif
80};
Chris Harrelson6e41e3ae2019-05-03 23:09:4081
Ian Kilpatricke68ef11a2018-07-04 03:52:1082// Enable LayoutNG.
Emil A Eklund69eeb562019-07-03 01:38:3083const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT};
Ian Kilpatricke68ef11a2018-07-04 03:52:1084
Makoto Shimazu172eec02018-11-29 06:21:4485const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent",
86 base::FEATURE_DISABLED_BY_DEFAULT};
87
Tarun Bansal422f9012019-01-23 16:55:5888// Used to control the collection of anchor element metrics (crbug.com/856683).
89// If kNavigationPredictor is enabled, then metrics of anchor elements
90// in the first viewport after the page load and the metrics of the clicked
91// anchor element will be extracted and recorded. Additionally, navigation
92// predictor may preconnect/prefetch to resources/origins to make the
93// future navigations faster.
Sofiya Semenovae4e076152019-07-29 20:10:2794const base::Feature kNavigationPredictor {
95 "NavigationPredictor",
96#if defined(OS_ANDROID)
97 base::FEATURE_ENABLED_BY_DEFAULT
98#else
99 base::FEATURE_DISABLED_BY_DEFAULT
100#endif
101};
Tarun Bansal422f9012019-01-23 16:55:58102
Kenichi Ishibashi0b9b91b2019-08-29 01:01:09103// Start service workers on a background thread.
Kenichi Ishibashi27bdc952019-08-16 03:16:30104// https://crbug.com/692909
105const base::Feature kOffMainThreadServiceWorkerStartup{
Kenichi Ishibashi083ed482019-09-05 23:50:15106 "OffMainThreadServiceWorkerStartup", base::FEATURE_ENABLED_BY_DEFAULT};
Kenichi Ishibashi27bdc952019-08-16 03:16:30107
Hiroki Nakagawa61ee0042019-01-22 06:30:26108// Enable browser-initiated dedicated worker script loading
109// (PlzDedicatedWorker). https://crbug.com/906991
110const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker",
111 base::FEATURE_DISABLED_BY_DEFAULT};
112
Daniel Murphy95792ef2018-10-04 01:29:55113// Enable Portals. https://crbug.com/865123.
114const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT};
115
Tarun Bansal8df12b52019-02-15 05:46:30116// Enable limiting previews loading hints to specific resource types.
117const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{
118 "PreviewsResourceLoadingHintsSpecificResourceTypes",
119 base::FEATURE_DISABLED_BY_DEFAULT};
120
Aditya Keerthie84331b32019-03-20 15:25:52121// Perform a memory purge after a renderer is backgrounded. Formerly labelled as
122// the "PurgeAndSuspend" experiment.
123//
124// TODO(adityakeerthi): Disabled by default on Mac and Android for historical
125// reasons. Consider enabling by default if experiment results are positive.
126// https://crbug.com/926186
127const base::Feature kPurgeRendererMemoryWhenBackgrounded {
128 "PurgeRendererMemoryWhenBackgrounded",
129#if defined(OS_MACOSX) || defined(OS_ANDROID)
130 base::FEATURE_DISABLED_BY_DEFAULT
131#else
132 base::FEATURE_ENABLED_BY_DEFAULT
133#endif
134};
135
David Bokan911bded2018-11-27 23:23:32136// Enable Implicit Root Scroller. https://crbug.com/903260.
David Bokan145b5472019-05-22 14:38:44137// TODO(bokan): Temporarily disabled on desktop platforms to address issues
138// with non-overlay scrollbars. https://crbug.com/948059.
139const base::Feature kImplicitRootScroller {
140 "ImplicitRootScroller",
141#if defined(OS_ANDROID)
142 base::FEATURE_ENABLED_BY_DEFAULT
143#else
144 base::FEATURE_DISABLED_BY_DEFAULT
145#endif
146};
David Bokan911bded2018-11-27 23:23:32147
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 Gomes76a8ec62019-09-03 23:20:17167// Enables HW VP8 encoding on Android.
168const base::Feature kWebRtcHWVP8Encoding {
169 "WebRtcHWVP8Encoding",
170#if defined(OS_ANDROID)
171 base::FEATURE_DISABLED_BY_DEFAULT
172#else
173 base::FEATURE_ENABLED_BY_DEFAULT
174#endif
175};
176
177// Enables HW VP9 encoding on Android.
178const base::Feature kWebRtcHWVP9Encoding {
179 "WebRtcHWVP9Encoding",
180#if defined(OS_ANDROID)
181 base::FEATURE_DISABLED_BY_DEFAULT
182#else
183 base::FEATURE_DISABLED_BY_DEFAULT
184#endif
185};
186
187// Enables HW H264 encoding on Android.
188const base::Feature kWebRtcHWH264Encoding{"WebRtcHWH264Encoding",
189 base::FEATURE_ENABLED_BY_DEFAULT};
190
Antonio Gomesb4718572019-09-11 02:55:48191// Enables negotiation of experimental multiplex codec in SDP.
192const base::Feature kWebRtcMultiplexCodec{"WebRTC-MultiplexCodec",
193 base::FEATURE_DISABLED_BY_DEFAULT};
194
195// Causes WebRTC to replace host ICE candidate IP addresses with generated
196// names ending in ".local" and resolve them using mDNS.
197// http://crbug.com/878465
198const base::Feature kWebRtcHideLocalIpsWithMdns{
199 "WebRtcHideLocalIpsWithMdns", base::FEATURE_ENABLED_BY_DEFAULT};
200
Antonio Gomesf3bcd512019-09-03 21:27:17201#if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
202// Run-time feature for the |rtc_use_h264| encoder/decoder.
203const base::Feature kWebRtcH264WithOpenH264FFmpeg{
204 "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT};
205#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
206
Ben Kelly24e20aa2019-04-25 21:27:16207const base::Feature kServiceWorkerIsolateInForeground{
Ben Kellyb27f17e82019-06-26 05:31:41208 "ServiceWorkerIsolateInForeground", base::FEATURE_ENABLED_BY_DEFAULT};
Ben Kelly24e20aa2019-04-25 21:27:16209
momohattfc352292018-08-29 05:12:36210const base::Feature kServiceWorkerImportedScriptUpdateCheck{
Makoto Shimazub9067eb02019-08-18 23:42:53211 "ServiceWorkerImportedScriptUpdateCheck", base::FEATURE_ENABLED_BY_DEFAULT};
momohattfc352292018-08-29 05:12:36212
Kenichi Ishibashi42f883d2019-01-11 08:26:14213const base::Feature kServiceWorkerAggressiveCodeCache{
214 "ServiceWorkerAggressiveCodeCache", base::FEATURE_DISABLED_BY_DEFAULT};
215
Makoto Shimazua8b3d742019-04-05 06:55:51216// Experiment of the delay from navigation to starting an update of a service
217// worker's script.
218const base::Feature kServiceWorkerUpdateDelay{
219 "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT};
220
Scott Haseley8eefdcd2018-08-22 16:50:19221// Freeze scheduler task queues in background after allowed grace time.
222// "stop" is a legacy name.
223const base::Feature kStopInBackground {
224 "stop-in-background",
225#if defined(OS_ANDROID)
226 base::FEATURE_ENABLED_BY_DEFAULT
227#else
228 base::FEATURE_DISABLED_BY_DEFAULT
229#endif
230};
231
Takashi Sakamotoc19fc2b2019-04-10 06:30:52232// Freeze scheduler task queues in background on network idle.
233// This feature only works if stop-in-background is enabled.
234const base::Feature kFreezeBackgroundTabOnNetworkIdle{
235 "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT};
236
Shubhie Panicker60bd4b02018-09-26 00:02:15237// Freeze non-timer task queues in background, after allowed grace time.
238// "stop" is a legacy name.
Dave Tapuska9140c552019-05-30 16:18:56239const base::Feature kStopNonTimersInBackground{
240 "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT};
Scott Haseley7757f6c2018-08-03 14:33:23241
Brandon Maslenda12cf82019-08-23 20:54:18242// Enable the Storage Access API. https://crbug.com/989663.
243const base::Feature kStorageAccessAPI{"StorageAccessAPI",
244 base::FEATURE_DISABLED_BY_DEFAULT};
245
David Bokane9370c22019-02-14 15:19:58246// Enable text snippets in URL fragments. https://crbug.com/919204.
247const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
248 base::FEATURE_DISABLED_BY_DEFAULT};
249
Bill Budge4d028f12018-11-20 15:05:12250// Enables the site isolated Wasm code cache that is keyed on the resource URL
251// and the origin lock of the renderer that is requesting the resource. When
252// this flag is enabled, content/GeneratedCodeCache handles code cache requests.
253const base::Feature kWasmCodeCache = {"WasmCodeCache",
254 base::FEATURE_DISABLED_BY_DEFAULT};
255
Marijn Kruisselbrinkca4bb5e2019-04-22 18:19:42256// Writable files and native file system access. https://crbug.com/853326
257const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI",
Marijn Kruisselbrink4cc3ec22019-09-04 16:28:20258 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44259
Jay Harris583f48922019-05-06 05:55:24260// File handling integration. https://crbug.com/829689
261const base::Feature kFileHandlingAPI{"FileHandlingAPI",
262 base::FEATURE_DISABLED_BY_DEFAULT};
263
kdillon66bf5b522019-01-02 22:08:30264// Allows for synchronous XHR requests during page dismissal
265const base::Feature kForbidSyncXHRInPageDismissal{
Katie Dilloncdae0762019-09-13 00:08:38266 "ForbidSyncXHRInPageDismissal", base::FEATURE_ENABLED_BY_DEFAULT};
kdillon66bf5b522019-01-02 22:08:30267
Dominic Farolino780df942019-09-04 06:49:44268// Prefetch request properties are updated to be privacy-preserving. See
269// crbug.com/988956.
270const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges",
271 base::FEATURE_DISABLED_BY_DEFAULT};
Dominic Farolino693fd72d2019-08-05 11:09:44272
Carlos ILd3be52b2018-10-08 17:57:18273const char kMixedContentAutoupgradeModeParamName[] = "mode";
274const char kMixedContentAutoupgradeModeBlockable[] = "blockable";
275const char kMixedContentAutoupgradeModeOptionallyBlockable[] =
276 "optionally-blockable";
277
Sasha McIntoshe889f9f2019-09-03 21:01:57278// Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this
279// format in the image decode cache. See crbug.com/919627 for details on the
280// feature.
281const base::Feature kDecodeJpeg420ImagesToYUV{
282 "DecodeJpeg420ImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT};
283
Madeleine Barowsky45be21a42018-12-07 18:39:30284// Decodes lossy WebP images to YUV instead of RGBX and stores in this format
285// in the image decode cache. See crbug.com/900264 for details on the feature.
286const base::Feature kDecodeLossyWebPImagesToYUV{
287 "DecodeLossyWebPImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT};
288
Tarun Bansale4ad3472019-07-09 03:59:28289// Enables usage of render frame observer as the receiver of the resource
290// loading hints in the render process.
291// https://crbug.com/891328.
292const base::Feature kSendPreviewsLoadingHintsBeforeCommit{
293 "SendPreviewsLoadingHintsBeforeCommit", base::FEATURE_ENABLED_BY_DEFAULT};
294
Takashi Toyoshimaa91506d2019-03-28 05:44:42295// Enables cache-aware WebFonts loading. See https://crbug.com/570205.
296// The feature is disabled on Android for WebView API issue discussed at
297// https://crbug.com/942440.
298const base::Feature kWebFontsCacheAwareTimeoutAdaption {
299 "WebFontsCacheAwareTimeoutAdaption",
300#if defined(OS_ANDROID)
301 base::FEATURE_DISABLED_BY_DEFAULT
302#else
303 base::FEATURE_ENABLED_BY_DEFAULT
304#endif
305};
306
Ehsan Karamadbe95d122019-05-10 17:59:06307// Enabled to block programmatic focus in subframes when not triggered by user
308// activation (see htpps://crbug.com/954349).
309const base::Feature kBlockingFocusWithoutUserActivation{
310 "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT};
311
Hongchan Choi370d3af2019-05-20 20:56:58312const base::Feature kAudioWorkletRealtimeThread{
313 "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT};
314
Ryan Sturm139c3ac2019-07-12 18:52:53315// A feature to reduce the set of resources fetched by No-State Prefetch.
316const base::Feature kLightweightNoStatePrefetch{
Ryan Sturm37bcbec2019-07-26 12:53:08317 "LightweightNoStatePrefetch", base::FEATURE_DISABLED_BY_DEFAULT};
Ryan Sturm139c3ac2019-07-12 18:52:53318
Daniel Libby7da24b72019-05-22 05:46:35319// Use scroll gestures for scrollbar scrolls (see https://crbug.com/954007).
320const base::Feature kScrollbarInjectScrollGestures{
Daniel Libby97b44752019-05-31 23:00:07321 "ScrollbarInjectScrollGestures", base::FEATURE_ENABLED_BY_DEFAULT};
Daniel Libby7da24b72019-05-22 05:46:35322
Aran Gilman5e9672bed2019-08-02 19:07:49323// Automatically convert light-themed pages to use a Blink-generated dark theme
324const base::Feature kForceWebContentsDarkMode{
325 "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT};
326
327// Which algorithm should be used for color inversion?
328const base::FeatureParam<ForceDarkInversionMethod>::Option
329 forcedark_inversion_method_options[] = {
330 {ForceDarkInversionMethod::kUseBlinkSettings,
331 "use_blink_settings_for_method"},
332 {ForceDarkInversionMethod::kHslBased, "hsl_based"},
Aran Gilman8b3ca41c2019-08-12 18:59:04333 {ForceDarkInversionMethod::kCielabBased, "cielab_based"},
334 {ForceDarkInversionMethod::kRgbBased, "rgb_based"}};
Aran Gilman5e9672bed2019-08-02 19:07:49335
336const base::FeatureParam<ForceDarkInversionMethod>
337 kForceDarkInversionMethodParam{&kForceWebContentsDarkMode,
338 "inversion_method",
339 ForceDarkInversionMethod::kUseBlinkSettings,
340 &forcedark_inversion_method_options};
341
342// Should images be inverted?
343const base::FeatureParam<ForceDarkImageBehavior>::Option
344 forcedark_image_behavior_options[] = {
345 {ForceDarkImageBehavior::kUseBlinkSettings,
346 "use_blink_settings_for_images"},
347 {ForceDarkImageBehavior::kInvertNone, "none"},
348 {ForceDarkImageBehavior::kInvertSelectively, "selective"}};
349
350const base::FeatureParam<ForceDarkImageBehavior> kForceDarkImageBehaviorParam{
351 &kForceWebContentsDarkMode, "image_behavior",
352 ForceDarkImageBehavior::kUseBlinkSettings,
353 &forcedark_image_behavior_options};
354
355// Do not invert text lighter than this.
356// Range: 0 (do not invert any text) to 256 (invert all text)
357// Can also set to -1 to let Blink's internal settings control the value
358const base::FeatureParam<int> kForceDarkTextLightnessThresholdParam{
359 &kForceWebContentsDarkMode, "text_lightness_threshold", -1};
360
361// Do not invert backgrounds darker than this.
362// Range: 0 (invert all backgrounds) to 256 (invert no backgrounds)
363// Can also set to -1 to let Blink's internal settings control the value
364const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{
365 &kForceWebContentsDarkMode, "background_lightness_threshold", -1};
366
Fernando Serboncinif3186162019-06-10 20:03:47367const base::Feature kCanvasAlwaysDeferral{"CanvasAlwaysDeferral",
368 base::FEATURE_ENABLED_BY_DEFAULT};
369
Adam Rice8e55e802019-06-24 11:58:03370// Use the new C++ implementation of WHATWG Streams. See
371// https://crbug.com/977500.
372const base::Feature kStreamsNative{"StreamsNative",
Adam Rice3c4fc7b2019-08-15 08:51:13373 base::FEATURE_ENABLED_BY_DEFAULT};
Adam Rice8e55e802019-06-24 11:58:03374
Michael Lippautze670df9f2019-07-09 11:39:49375// Blink garbage collection.
376// Enables compaction of backing stores on Blink's heap.
377const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction",
378 base::FEATURE_ENABLED_BY_DEFAULT};
379// Enables concurrently marking Blink's heap.
380const base::Feature kBlinkHeapConcurrentMarking{
381 "BlinkHeapConcurrentMarking", base::FEATURE_DISABLED_BY_DEFAULT};
Anton Bikineev9b7b3722019-07-09 13:48:39382// Enables concurrently sweeping Blink's heap.
383const base::Feature kBlinkHeapConcurrentSweeping{
Anton Bikineev204cc752019-08-07 00:26:37384 "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49385// Enables incrementally marking Blink's heap.
386const base::Feature kBlinkHeapIncrementalMarking{
387 "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT};
388// Enables a marking stress mode that schedules more garbage collections and
389// also adds additional verification passes.
390const base::Feature kBlinkHeapIncrementalMarkingStress{
391 "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49392
Ben Kelly298d8e02019-07-10 17:37:49393// Enables a delay before BufferingBytesConsumer begins reading from its
394// underlying consumer when instantiated with CreateWithDelay().
395const base::Feature kBufferingBytesConsumerDelay{
Ben Kellyb97951a2019-08-05 19:59:51396 "BufferingBytesConsumerDelay", base::FEATURE_ENABLED_BY_DEFAULT};
Ben Kelly298d8e02019-07-10 17:37:49397const base::FeatureParam<int> kBufferingBytesConsumerDelayMilliseconds{
398 &kBufferingBytesConsumerDelay, "milliseconds", 50};
399
Yoav Weissddfb8d2e2019-07-15 22:34:03400// Enables removing AppCache delays when triggering requests when the HTML was
401// not fetched from AppCache.
402const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{
403 "VerifyHTMLFetchedFromAppCacheBeforeDelay",
404 base::FEATURE_DISABLED_BY_DEFAULT};
405
Michael Spang8d2303e2019-07-26 01:56:32406// Controls whether we use ThreadPriority::DISPLAY for renderer
407// compositor & IO threads.
408const base::Feature kBlinkCompositorUseDisplayThreadPriority {
409 "BlinkCompositorUseDisplayThreadPriority",
410#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
411 base::FEATURE_ENABLED_BY_DEFAULT
412#else
413 base::FEATURE_DISABLED_BY_DEFAULT
414#endif
415};
416
Yuki Shiinoa812f492019-08-23 06:47:46417// Ignores cross origin windows in the named property interceptor of Window.
418// https://crbug.com/538562
419const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{
420 "IgnoreCrossOriginWindowWhenNamedAccessOnWindow",
421 base::FEATURE_DISABLED_BY_DEFAULT};
422
Tarun Bansal38792462019-09-04 16:08:11423// When enabled, loading priority of JavaScript requests is lowered when they
424// are force deferred by the intervention.
425const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{
426 "LowerJavaScriptPriorityWhenForceDeferred",
427 base::FEATURE_ENABLED_BY_DEFAULT};
428
Hiroshige Hayashizaki8ee3f7e62019-09-05 07:17:47429const base::Feature kHtmlImportsRequestInitiatorLock{
430 "HtmlImportsRequestInitiatorLock", base::FEATURE_ENABLED_BY_DEFAULT};
431
Matt Falkenhagen5cc652792018-06-21 10:34:33432} // namespace features
433} // namespace blink