Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "third_party/blink/public/common/features.h" |
| 6 | |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 7 | #include "base/feature_list.h" |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 8 | #include "build/build_config.h" |
Hiroki Nakagawa | 893ee50 | 2019-02-04 06:49:53 | [diff] [blame] | 9 | #include "services/network/public/cpp/features.h" |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 10 | #include "third_party/blink/public/common/forcedark/forcedark_switches.h" |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 11 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 12 | namespace blink { |
| 13 | namespace features { |
| 14 | |
Yao Xiao | 2c1171a | 2019-04-01 23:44:32 | [diff] [blame] | 15 | // Enable intervention for download that was initiated from or occurred in an ad |
| 16 | // frame without user activation. |
| 17 | const base::Feature kBlockingDownloadsInAdFrameWithoutUserActivation{ |
| 18 | "BlockingDownloadsInAdFrameWithoutUserActivation", |
Yao Xiao | 3f9e427 | 2019-05-23 15:22:46 | [diff] [blame] | 19 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Yao Xiao | 2c1171a | 2019-04-01 23:44:32 | [diff] [blame] | 20 | |
Stephen Chenney | de6e5c8 | 2019-01-21 01:56:04 | [diff] [blame] | 21 | // Enable defer commits a bit to avoid flash. |
| 22 | const base::Feature kAvoidFlashBetweenNavigation{ |
Stephen Chenney | ebb056b | 2019-09-06 11:58:02 | [diff] [blame] | 23 | "AvoidFlashBetweenNavigation", base::FEATURE_ENABLED_BY_DEFAULT}; |
Stephen Chenney | de6e5c8 | 2019-01-21 01:56:04 | [diff] [blame] | 24 | |
Matt Falkenhagen | c25fea4 | 2018-07-17 07:13:52 | [diff] [blame] | 25 | // Enable eagerly setting up a CacheStorage interface pointer and |
| 26 | // passing it to service workers on startup as an optimization. |
| 27 | const base::Feature kEagerCacheStorageSetupForServiceWorkers{ |
| 28 | "EagerCacheStorageSetupForServiceWorkers", |
| 29 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 30 | |
Eric Karl | 0623ec7 | 2018-10-30 19:43:26 | [diff] [blame] | 31 | // Controls the user-specified viewport restriction for GPU Rasterization on |
| 32 | // mobile. See https://crbug.com/899399 |
| 33 | const base::Feature kEnableGpuRasterizationViewportRestriction{ |
| 34 | "EnableGpuRasterizationViewportRestriction", |
Eric Karl | 3594464 | 2019-07-17 23:58:24 | [diff] [blame] | 35 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Eric Karl | 0623ec7 | 2018-10-30 19:43:26 | [diff] [blame] | 36 | |
Peter Kvitek | 197eaf7 | 2018-12-04 19:14:56 | [diff] [blame] | 37 | // Controls script streaming. |
| 38 | const base::Feature kScriptStreaming{"ScriptStreaming", |
| 39 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 40 | |
Leszek Swirski | f75c191 | 2019-05-29 10:08:25 | [diff] [blame] | 41 | // Allow streaming small (<30kB) scripts. |
| 42 | const base::Feature kSmallScriptStreaming{"SmallScriptStreaming", |
| 43 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 44 | |
Keishi Hattori | 9e10692 | 2019-04-15 09:06:03 | [diff] [blame] | 45 | // Enables user level memory pressure signal generation on Android. |
| 46 | const base::Feature kUserLevelMemoryPressureSignal{ |
| 47 | "UserLevelMemoryPressureSignal", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 48 | |
Liquan(Max) Gu | 4e243fc | 2018-11-17 00:13:02 | [diff] [blame] | 49 | // Enable FCP++ by experiment. See https://crbug.com/869924 |
| 50 | const base::Feature kFirstContentfulPaintPlusPlus{ |
Liquan(Max) Gu | 739af15 | 2019-06-07 19:27:19 | [diff] [blame] | 51 | "FirstContentfulPaintPlusPlus", base::FEATURE_ENABLED_BY_DEFAULT}; |
Liquan(Max) Gu | 4e243fc | 2018-11-17 00:13:02 | [diff] [blame] | 52 | |
Aditya Keerthi | 6a93390 | 2019-03-14 21:09:27 | [diff] [blame] | 53 | // Perform memory purges after freezing only if all pages are frozen. |
| 54 | const base::Feature kFreezePurgeMemoryAllPagesFrozen{ |
| 55 | "FreezePurgeMemoryAllPagesFrozen", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 56 | |
John Delaney | ac24e57 | 2019-04-30 19:47:02 | [diff] [blame] | 57 | // Freezes the user-agent as part of https://github.com/WICG/ua-client-hints. |
| 58 | const base::Feature kFreezeUserAgent{"FreezeUserAgent", |
| 59 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 60 | |
Mason Freed | c166cf1 | 2019-06-14 19:04:26 | [diff] [blame] | 61 | // Enable a new CSS property called backdrop-filter. |
Mason Freed | 34663f4 | 2019-09-06 22:40:05 | [diff] [blame] | 62 | const base::Feature kCSSBackdropFilter{"CSSBackdropFilter", |
| 63 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Mason Freed | c166cf1 | 2019-06-14 19:04:26 | [diff] [blame] | 64 | |
Vladimir Levin | 43758ecc | 2019-05-09 18:04:03 | [diff] [blame] | 65 | // Enable Display Locking JavaScript APIs. |
| 66 | const base::Feature kDisplayLocking{"DisplayLocking", |
| 67 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 68 | |
Chris Harrelson | 6e41e3ae | 2019-05-03 23:09:40 | [diff] [blame] | 69 | // Enable applying rounded corner masks via a GL shader rather than |
| 70 | // a mask layer. |
Chris Harrelson | 3f7e3611 | 2019-08-21 19:15:48 | [diff] [blame] | 71 | const 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 Harrelson | 6e41e3ae | 2019-05-03 23:09:40 | [diff] [blame] | 81 | |
Ian Kilpatrick | e68ef11a | 2018-07-04 03:52:10 | [diff] [blame] | 82 | // Enable LayoutNG. |
Emil A Eklund | 69eeb56 | 2019-07-03 01:38:30 | [diff] [blame] | 83 | const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT}; |
Ian Kilpatrick | e68ef11a | 2018-07-04 03:52:10 | [diff] [blame] | 84 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 85 | const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent", |
| 86 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 87 | |
Tarun Bansal | 422f901 | 2019-01-23 16:55:58 | [diff] [blame] | 88 | // 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 Semenova | e4e07615 | 2019-07-29 20:10:27 | [diff] [blame] | 94 | const 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 Bansal | 422f901 | 2019-01-23 16:55:58 | [diff] [blame] | 102 | |
Kenichi Ishibashi | 0b9b91b | 2019-08-29 01:01:09 | [diff] [blame] | 103 | // Start service workers on a background thread. |
Kenichi Ishibashi | 27bdc95 | 2019-08-16 03:16:30 | [diff] [blame] | 104 | // https://crbug.com/692909 |
| 105 | const base::Feature kOffMainThreadServiceWorkerStartup{ |
Kenichi Ishibashi | 083ed48 | 2019-09-05 23:50:15 | [diff] [blame] | 106 | "OffMainThreadServiceWorkerStartup", base::FEATURE_ENABLED_BY_DEFAULT}; |
Kenichi Ishibashi | 27bdc95 | 2019-08-16 03:16:30 | [diff] [blame] | 107 | |
Hiroki Nakagawa | 61ee004 | 2019-01-22 06:30:26 | [diff] [blame] | 108 | // Enable browser-initiated dedicated worker script loading |
| 109 | // (PlzDedicatedWorker). https://crbug.com/906991 |
| 110 | const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker", |
| 111 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 112 | |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 113 | // Enable Portals. https://crbug.com/865123. |
| 114 | const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 115 | |
Tarun Bansal | 8df12b5 | 2019-02-15 05:46:30 | [diff] [blame] | 116 | // Enable limiting previews loading hints to specific resource types. |
| 117 | const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{ |
| 118 | "PreviewsResourceLoadingHintsSpecificResourceTypes", |
| 119 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 120 | |
Aditya Keerthi | e84331b3 | 2019-03-20 15:25:52 | [diff] [blame] | 121 | // 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 |
| 127 | const 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 Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 136 | // Enable Implicit Root Scroller. https://crbug.com/903260. |
David Bokan | 145b547 | 2019-05-22 14:38:44 | [diff] [blame] | 137 | // TODO(bokan): Temporarily disabled on desktop platforms to address issues |
| 138 | // with non-overlay scrollbars. https://crbug.com/948059. |
| 139 | const 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 Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 147 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 148 | // Enables usage of getDisplayMedia() that allows capture of web content, see |
| 149 | // https://crbug.com/865060. |
| 150 | const 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). |
| 157 | const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault", |
Henrik Boström | 07021ec8 | 2019-01-17 22:23:56 | [diff] [blame] | 158 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 159 | |
Johannes Kron | ad5a453 | 2019-01-09 11:17:46 | [diff] [blame] | 160 | // 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. |
| 164 | const base::Feature kRTCOfferExtmapAllowMixed{ |
| 165 | "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 166 | |
Antonio Gomes | 76a8ec6 | 2019-09-03 23:20:17 | [diff] [blame] | 167 | // Enables HW VP8 encoding on Android. |
| 168 | const 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. |
| 178 | const 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. |
| 188 | const base::Feature kWebRtcHWH264Encoding{"WebRtcHWH264Encoding", |
| 189 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 190 | |
Antonio Gomes | b471857 | 2019-09-11 02:55:48 | [diff] [blame] | 191 | // Enables negotiation of experimental multiplex codec in SDP. |
| 192 | const 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 |
| 198 | const base::Feature kWebRtcHideLocalIpsWithMdns{ |
| 199 | "WebRtcHideLocalIpsWithMdns", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 200 | |
Antonio Gomes | f3bcd51 | 2019-09-03 21:27:17 | [diff] [blame] | 201 | #if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) |
| 202 | // Run-time feature for the |rtc_use_h264| encoder/decoder. |
| 203 | const base::Feature kWebRtcH264WithOpenH264FFmpeg{ |
| 204 | "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 205 | #endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) |
| 206 | |
Ben Kelly | 24e20aa | 2019-04-25 21:27:16 | [diff] [blame] | 207 | const base::Feature kServiceWorkerIsolateInForeground{ |
Ben Kelly | b27f17e8 | 2019-06-26 05:31:41 | [diff] [blame] | 208 | "ServiceWorkerIsolateInForeground", base::FEATURE_ENABLED_BY_DEFAULT}; |
Ben Kelly | 24e20aa | 2019-04-25 21:27:16 | [diff] [blame] | 209 | |
momohatt | fc35229 | 2018-08-29 05:12:36 | [diff] [blame] | 210 | const base::Feature kServiceWorkerImportedScriptUpdateCheck{ |
Makoto Shimazu | b9067eb0 | 2019-08-18 23:42:53 | [diff] [blame] | 211 | "ServiceWorkerImportedScriptUpdateCheck", base::FEATURE_ENABLED_BY_DEFAULT}; |
momohatt | fc35229 | 2018-08-29 05:12:36 | [diff] [blame] | 212 | |
Kenichi Ishibashi | 42f883d | 2019-01-11 08:26:14 | [diff] [blame] | 213 | const base::Feature kServiceWorkerAggressiveCodeCache{ |
| 214 | "ServiceWorkerAggressiveCodeCache", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 215 | |
Makoto Shimazu | a8b3d74 | 2019-04-05 06:55:51 | [diff] [blame] | 216 | // Experiment of the delay from navigation to starting an update of a service |
| 217 | // worker's script. |
| 218 | const base::Feature kServiceWorkerUpdateDelay{ |
| 219 | "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 220 | |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 221 | // Freeze scheduler task queues in background after allowed grace time. |
| 222 | // "stop" is a legacy name. |
| 223 | const 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 Sakamoto | c19fc2b | 2019-04-10 06:30:52 | [diff] [blame] | 232 | // Freeze scheduler task queues in background on network idle. |
| 233 | // This feature only works if stop-in-background is enabled. |
| 234 | const base::Feature kFreezeBackgroundTabOnNetworkIdle{ |
| 235 | "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 236 | |
Shubhie Panicker | 60bd4b0 | 2018-09-26 00:02:15 | [diff] [blame] | 237 | // Freeze non-timer task queues in background, after allowed grace time. |
| 238 | // "stop" is a legacy name. |
Dave Tapuska | 9140c55 | 2019-05-30 16:18:56 | [diff] [blame] | 239 | const base::Feature kStopNonTimersInBackground{ |
| 240 | "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT}; |
Scott Haseley | 7757f6c | 2018-08-03 14:33:23 | [diff] [blame] | 241 | |
Brandon Maslen | da12cf8 | 2019-08-23 20:54:18 | [diff] [blame] | 242 | // Enable the Storage Access API. https://crbug.com/989663. |
| 243 | const base::Feature kStorageAccessAPI{"StorageAccessAPI", |
| 244 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 245 | |
David Bokan | e9370c2 | 2019-02-14 15:19:58 | [diff] [blame] | 246 | // Enable text snippets in URL fragments. https://crbug.com/919204. |
| 247 | const base::Feature kTextFragmentAnchor{"TextFragmentAnchor", |
| 248 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 249 | |
Bill Budge | 4d028f1 | 2018-11-20 15:05:12 | [diff] [blame] | 250 | // 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. |
| 253 | const base::Feature kWasmCodeCache = {"WasmCodeCache", |
| 254 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 255 | |
Marijn Kruisselbrink | ca4bb5e | 2019-04-22 18:19:42 | [diff] [blame] | 256 | // Writable files and native file system access. https://crbug.com/853326 |
| 257 | const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI", |
Marijn Kruisselbrink | 4cc3ec2 | 2019-09-04 16:28:20 | [diff] [blame] | 258 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 259 | |
Jay Harris | 583f4892 | 2019-05-06 05:55:24 | [diff] [blame] | 260 | // File handling integration. https://crbug.com/829689 |
| 261 | const base::Feature kFileHandlingAPI{"FileHandlingAPI", |
| 262 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 263 | |
kdillon | 66bf5b52 | 2019-01-02 22:08:30 | [diff] [blame] | 264 | // Allows for synchronous XHR requests during page dismissal |
| 265 | const base::Feature kForbidSyncXHRInPageDismissal{ |
Katie Dillon | cdae076 | 2019-09-13 00:08:38 | [diff] [blame] | 266 | "ForbidSyncXHRInPageDismissal", base::FEATURE_ENABLED_BY_DEFAULT}; |
kdillon | 66bf5b52 | 2019-01-02 22:08:30 | [diff] [blame] | 267 | |
Dominic Farolino | 780df94 | 2019-09-04 06:49:44 | [diff] [blame] | 268 | // Prefetch request properties are updated to be privacy-preserving. See |
| 269 | // crbug.com/988956. |
| 270 | const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges", |
| 271 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Dominic Farolino | 693fd72d | 2019-08-05 11:09:44 | [diff] [blame] | 272 | |
Carlos IL | d3be52b | 2018-10-08 17:57:18 | [diff] [blame] | 273 | const char kMixedContentAutoupgradeModeParamName[] = "mode"; |
| 274 | const char kMixedContentAutoupgradeModeBlockable[] = "blockable"; |
| 275 | const char kMixedContentAutoupgradeModeOptionallyBlockable[] = |
| 276 | "optionally-blockable"; |
| 277 | |
Sasha McIntosh | e889f9f | 2019-09-03 21:01:57 | [diff] [blame] | 278 | // 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. |
| 281 | const base::Feature kDecodeJpeg420ImagesToYUV{ |
| 282 | "DecodeJpeg420ImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 283 | |
Madeleine Barowsky | 45be21a4 | 2018-12-07 18:39:30 | [diff] [blame] | 284 | // 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. |
| 286 | const base::Feature kDecodeLossyWebPImagesToYUV{ |
| 287 | "DecodeLossyWebPImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 288 | |
Tarun Bansal | e4ad347 | 2019-07-09 03:59:28 | [diff] [blame] | 289 | // Enables usage of render frame observer as the receiver of the resource |
| 290 | // loading hints in the render process. |
| 291 | // https://crbug.com/891328. |
| 292 | const base::Feature kSendPreviewsLoadingHintsBeforeCommit{ |
| 293 | "SendPreviewsLoadingHintsBeforeCommit", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 294 | |
Takashi Toyoshima | a91506d | 2019-03-28 05:44:42 | [diff] [blame] | 295 | // 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. |
| 298 | const 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 Karamad | be95d12 | 2019-05-10 17:59:06 | [diff] [blame] | 307 | // Enabled to block programmatic focus in subframes when not triggered by user |
| 308 | // activation (see htpps://crbug.com/954349). |
| 309 | const base::Feature kBlockingFocusWithoutUserActivation{ |
| 310 | "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 311 | |
Hongchan Choi | 370d3af | 2019-05-20 20:56:58 | [diff] [blame] | 312 | const base::Feature kAudioWorkletRealtimeThread{ |
| 313 | "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 314 | |
Ryan Sturm | 139c3ac | 2019-07-12 18:52:53 | [diff] [blame] | 315 | // A feature to reduce the set of resources fetched by No-State Prefetch. |
| 316 | const base::Feature kLightweightNoStatePrefetch{ |
Ryan Sturm | 37bcbec | 2019-07-26 12:53:08 | [diff] [blame] | 317 | "LightweightNoStatePrefetch", base::FEATURE_DISABLED_BY_DEFAULT}; |
Ryan Sturm | 139c3ac | 2019-07-12 18:52:53 | [diff] [blame] | 318 | |
Daniel Libby | 7da24b7 | 2019-05-22 05:46:35 | [diff] [blame] | 319 | // Use scroll gestures for scrollbar scrolls (see https://crbug.com/954007). |
| 320 | const base::Feature kScrollbarInjectScrollGestures{ |
Daniel Libby | 97b4475 | 2019-05-31 23:00:07 | [diff] [blame] | 321 | "ScrollbarInjectScrollGestures", base::FEATURE_ENABLED_BY_DEFAULT}; |
Daniel Libby | 7da24b7 | 2019-05-22 05:46:35 | [diff] [blame] | 322 | |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 323 | // Automatically convert light-themed pages to use a Blink-generated dark theme |
| 324 | const base::Feature kForceWebContentsDarkMode{ |
| 325 | "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 326 | |
| 327 | // Which algorithm should be used for color inversion? |
| 328 | const base::FeatureParam<ForceDarkInversionMethod>::Option |
| 329 | forcedark_inversion_method_options[] = { |
| 330 | {ForceDarkInversionMethod::kUseBlinkSettings, |
| 331 | "use_blink_settings_for_method"}, |
| 332 | {ForceDarkInversionMethod::kHslBased, "hsl_based"}, |
Aran Gilman | 8b3ca41c | 2019-08-12 18:59:04 | [diff] [blame] | 333 | {ForceDarkInversionMethod::kCielabBased, "cielab_based"}, |
| 334 | {ForceDarkInversionMethod::kRgbBased, "rgb_based"}}; |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 335 | |
| 336 | const base::FeatureParam<ForceDarkInversionMethod> |
| 337 | kForceDarkInversionMethodParam{&kForceWebContentsDarkMode, |
| 338 | "inversion_method", |
| 339 | ForceDarkInversionMethod::kUseBlinkSettings, |
| 340 | &forcedark_inversion_method_options}; |
| 341 | |
| 342 | // Should images be inverted? |
| 343 | const 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 | |
| 350 | const 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 |
| 358 | const 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 |
| 364 | const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{ |
| 365 | &kForceWebContentsDarkMode, "background_lightness_threshold", -1}; |
| 366 | |
Fernando Serboncini | f318616 | 2019-06-10 20:03:47 | [diff] [blame] | 367 | const base::Feature kCanvasAlwaysDeferral{"CanvasAlwaysDeferral", |
| 368 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 369 | |
Adam Rice | 8e55e80 | 2019-06-24 11:58:03 | [diff] [blame] | 370 | // Use the new C++ implementation of WHATWG Streams. See |
| 371 | // https://crbug.com/977500. |
| 372 | const base::Feature kStreamsNative{"StreamsNative", |
Adam Rice | 3c4fc7b | 2019-08-15 08:51:13 | [diff] [blame] | 373 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Adam Rice | 8e55e80 | 2019-06-24 11:58:03 | [diff] [blame] | 374 | |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 375 | // Blink garbage collection. |
| 376 | // Enables compaction of backing stores on Blink's heap. |
| 377 | const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction", |
| 378 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 379 | // Enables concurrently marking Blink's heap. |
| 380 | const base::Feature kBlinkHeapConcurrentMarking{ |
| 381 | "BlinkHeapConcurrentMarking", base::FEATURE_DISABLED_BY_DEFAULT}; |
Anton Bikineev | 9b7b372 | 2019-07-09 13:48:39 | [diff] [blame] | 382 | // Enables concurrently sweeping Blink's heap. |
| 383 | const base::Feature kBlinkHeapConcurrentSweeping{ |
Anton Bikineev | 204cc75 | 2019-08-07 00:26:37 | [diff] [blame] | 384 | "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT}; |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 385 | // Enables incrementally marking Blink's heap. |
| 386 | const 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. |
| 390 | const base::Feature kBlinkHeapIncrementalMarkingStress{ |
| 391 | "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT}; |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 392 | |
Ben Kelly | 298d8e0 | 2019-07-10 17:37:49 | [diff] [blame] | 393 | // Enables a delay before BufferingBytesConsumer begins reading from its |
| 394 | // underlying consumer when instantiated with CreateWithDelay(). |
| 395 | const base::Feature kBufferingBytesConsumerDelay{ |
Ben Kelly | b97951a | 2019-08-05 19:59:51 | [diff] [blame] | 396 | "BufferingBytesConsumerDelay", base::FEATURE_ENABLED_BY_DEFAULT}; |
Ben Kelly | 298d8e0 | 2019-07-10 17:37:49 | [diff] [blame] | 397 | const base::FeatureParam<int> kBufferingBytesConsumerDelayMilliseconds{ |
| 398 | &kBufferingBytesConsumerDelay, "milliseconds", 50}; |
| 399 | |
Yoav Weiss | ddfb8d2e | 2019-07-15 22:34:03 | [diff] [blame] | 400 | // Enables removing AppCache delays when triggering requests when the HTML was |
| 401 | // not fetched from AppCache. |
| 402 | const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{ |
| 403 | "VerifyHTMLFetchedFromAppCacheBeforeDelay", |
| 404 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 405 | |
Michael Spang | 8d2303e | 2019-07-26 01:56:32 | [diff] [blame] | 406 | // Controls whether we use ThreadPriority::DISPLAY for renderer |
| 407 | // compositor & IO threads. |
| 408 | const 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 Shiino | a812f49 | 2019-08-23 06:47:46 | [diff] [blame] | 417 | // Ignores cross origin windows in the named property interceptor of Window. |
| 418 | // https://crbug.com/538562 |
| 419 | const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{ |
| 420 | "IgnoreCrossOriginWindowWhenNamedAccessOnWindow", |
| 421 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 422 | |
Tarun Bansal | 3879246 | 2019-09-04 16:08:11 | [diff] [blame] | 423 | // When enabled, loading priority of JavaScript requests is lowered when they |
| 424 | // are force deferred by the intervention. |
| 425 | const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{ |
| 426 | "LowerJavaScriptPriorityWhenForceDeferred", |
| 427 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 428 | |
Hiroshige Hayashizaki | 8ee3f7e6 | 2019-09-05 07:17:47 | [diff] [blame] | 429 | const base::Feature kHtmlImportsRequestInitiatorLock{ |
| 430 | "HtmlImportsRequestInitiatorLock", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 431 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 432 | } // namespace features |
| 433 | } // namespace blink |