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{ |
| 23 | "AvoidFlashBetweenNavigation", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 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 | |
Steve Kobes | b51c2fed | 2019-02-27 15:36:31 | [diff] [blame] | 61 | // Enables the experimental sweep-line algorithm for tracking "jank" from |
| 62 | // layout objects changing their visual location between animation frames. |
Steve Kobes | aa9c7c2 | 2019-01-21 18:24:13 | [diff] [blame] | 63 | const base::Feature kJankTrackingSweepLine{"JankTrackingSweepLine", |
| 64 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 65 | |
Mason Freed | c166cf1 | 2019-06-14 19:04:26 | [diff] [blame] | 66 | // Enable a new CSS property called backdrop-filter. |
Mason Freed | 9a96b50 | 2019-08-29 18:28:41 | [diff] [blame] | 67 | const base::Feature kCSSBackdropFilter { |
| 68 | "CSSBackdropFilter", |
| 69 | #if defined(OS_ANDROID) |
| 70 | // There are two bugs in the backdrop-filter feature for Android Webview |
| 71 | // only (crbug.com/990535 and crbug.com/991869). Because there is no |
| 72 | // compile-time flag for Webview, this disables all of Android, and the |
| 73 | // feature will be re-enabled for non-Webview Android by Finch. |
| 74 | base::FEATURE_DISABLED_BY_DEFAULT |
| 75 | #else |
| 76 | base::FEATURE_ENABLED_BY_DEFAULT |
| 77 | #endif |
| 78 | }; |
Mason Freed | c166cf1 | 2019-06-14 19:04:26 | [diff] [blame] | 79 | |
Vladimir Levin | 43758ecc | 2019-05-09 18:04:03 | [diff] [blame] | 80 | // Enable Display Locking JavaScript APIs. |
| 81 | const base::Feature kDisplayLocking{"DisplayLocking", |
| 82 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 83 | |
Chris Harrelson | 6e41e3ae | 2019-05-03 23:09:40 | [diff] [blame] | 84 | // Enable applying rounded corner masks via a GL shader rather than |
| 85 | // a mask layer. |
Chris Harrelson | 3f7e3611 | 2019-08-21 19:15:48 | [diff] [blame] | 86 | const base::Feature kFastBorderRadius { |
| 87 | "FastBorderRadius", |
| 88 | #if defined(OS_MACOSX) |
| 89 | // A FastBorderRadiusMac experiment is rolling out separately for that |
| 90 | // platform, due to complications with CALayer overlay optimizations. |
| 91 | base::FEATURE_DISABLED_BY_DEFAULT |
| 92 | #else |
| 93 | base::FEATURE_ENABLED_BY_DEFAULT |
| 94 | #endif |
| 95 | }; |
Chris Harrelson | 6e41e3ae | 2019-05-03 23:09:40 | [diff] [blame] | 96 | |
Ian Kilpatrick | e68ef11a | 2018-07-04 03:52:10 | [diff] [blame] | 97 | // Enable LayoutNG. |
Emil A Eklund | 69eeb56 | 2019-07-03 01:38:30 | [diff] [blame] | 98 | const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT}; |
Ian Kilpatrick | e68ef11a | 2018-07-04 03:52:10 | [diff] [blame] | 99 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 100 | const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent", |
| 101 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 102 | |
Tarun Bansal | 422f901 | 2019-01-23 16:55:58 | [diff] [blame] | 103 | // Used to control the collection of anchor element metrics (crbug.com/856683). |
| 104 | // If kNavigationPredictor is enabled, then metrics of anchor elements |
| 105 | // in the first viewport after the page load and the metrics of the clicked |
| 106 | // anchor element will be extracted and recorded. Additionally, navigation |
| 107 | // predictor may preconnect/prefetch to resources/origins to make the |
| 108 | // future navigations faster. |
Sofiya Semenova | e4e07615 | 2019-07-29 20:10:27 | [diff] [blame] | 109 | const base::Feature kNavigationPredictor { |
| 110 | "NavigationPredictor", |
| 111 | #if defined(OS_ANDROID) |
| 112 | base::FEATURE_ENABLED_BY_DEFAULT |
| 113 | #else |
| 114 | base::FEATURE_DISABLED_BY_DEFAULT |
| 115 | #endif |
| 116 | }; |
Tarun Bansal | 422f901 | 2019-01-23 16:55:58 | [diff] [blame] | 117 | |
Kenichi Ishibashi | 0b9b91b | 2019-08-29 01:01:09 | [diff] [blame] | 118 | // Start service workers on a background thread. |
Kenichi Ishibashi | 27bdc95 | 2019-08-16 03:16:30 | [diff] [blame] | 119 | // https://crbug.com/692909 |
| 120 | const base::Feature kOffMainThreadServiceWorkerStartup{ |
| 121 | "OffMainThreadServiceWorkerStartup", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 122 | |
Hiroki Nakagawa | 61ee004 | 2019-01-22 06:30:26 | [diff] [blame] | 123 | // Enable browser-initiated dedicated worker script loading |
| 124 | // (PlzDedicatedWorker). https://crbug.com/906991 |
| 125 | const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker", |
| 126 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 127 | |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 128 | // Enable Portals. https://crbug.com/865123. |
| 129 | const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 130 | |
Tarun Bansal | 8df12b5 | 2019-02-15 05:46:30 | [diff] [blame] | 131 | // Enable limiting previews loading hints to specific resource types. |
| 132 | const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{ |
| 133 | "PreviewsResourceLoadingHintsSpecificResourceTypes", |
| 134 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 135 | |
Aditya Keerthi | e84331b3 | 2019-03-20 15:25:52 | [diff] [blame] | 136 | // Perform a memory purge after a renderer is backgrounded. Formerly labelled as |
| 137 | // the "PurgeAndSuspend" experiment. |
| 138 | // |
| 139 | // TODO(adityakeerthi): Disabled by default on Mac and Android for historical |
| 140 | // reasons. Consider enabling by default if experiment results are positive. |
| 141 | // https://crbug.com/926186 |
| 142 | const base::Feature kPurgeRendererMemoryWhenBackgrounded { |
| 143 | "PurgeRendererMemoryWhenBackgrounded", |
| 144 | #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 145 | base::FEATURE_DISABLED_BY_DEFAULT |
| 146 | #else |
| 147 | base::FEATURE_ENABLED_BY_DEFAULT |
| 148 | #endif |
| 149 | }; |
| 150 | |
David Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 151 | // Enable Implicit Root Scroller. https://crbug.com/903260. |
David Bokan | 145b547 | 2019-05-22 14:38:44 | [diff] [blame] | 152 | // TODO(bokan): Temporarily disabled on desktop platforms to address issues |
| 153 | // with non-overlay scrollbars. https://crbug.com/948059. |
| 154 | const base::Feature kImplicitRootScroller { |
| 155 | "ImplicitRootScroller", |
| 156 | #if defined(OS_ANDROID) |
| 157 | base::FEATURE_ENABLED_BY_DEFAULT |
| 158 | #else |
| 159 | base::FEATURE_DISABLED_BY_DEFAULT |
| 160 | #endif |
| 161 | }; |
David Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 162 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 163 | // Enables usage of getDisplayMedia() that allows capture of web content, see |
| 164 | // https://crbug.com/865060. |
| 165 | const base::Feature kRTCGetDisplayMedia{"RTCGetDisplayMedia", |
| 166 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 167 | |
| 168 | // Changes the default RTCPeerConnection constructor behavior to use Unified |
| 169 | // Plan as the SDP semantics. When the feature is enabled, Unified Plan is used |
| 170 | // unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the |
| 171 | // argument). |
| 172 | const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault", |
Henrik Boström | 07021ec8 | 2019-01-17 22:23:56 | [diff] [blame] | 173 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 174 | |
Johannes Kron | ad5a453 | 2019-01-09 11:17:46 | [diff] [blame] | 175 | // Determines if the SDP attrbute extmap-allow-mixed should be offered by |
| 176 | // default or not. The default value can be overridden by passing |
| 177 | // {offerExtmapAllowMixed:true} as an argument to the RTCPeerConnection |
| 178 | // constructor. |
| 179 | const base::Feature kRTCOfferExtmapAllowMixed{ |
| 180 | "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 181 | |
Antonio Gomes | 76a8ec6 | 2019-09-03 23:20:17 | [diff] [blame] | 182 | // Enables HW VP8 encoding on Android. |
| 183 | const base::Feature kWebRtcHWVP8Encoding { |
| 184 | "WebRtcHWVP8Encoding", |
| 185 | #if defined(OS_ANDROID) |
| 186 | base::FEATURE_DISABLED_BY_DEFAULT |
| 187 | #else |
| 188 | base::FEATURE_ENABLED_BY_DEFAULT |
| 189 | #endif |
| 190 | }; |
| 191 | |
| 192 | // Enables HW VP9 encoding on Android. |
| 193 | const base::Feature kWebRtcHWVP9Encoding { |
| 194 | "WebRtcHWVP9Encoding", |
| 195 | #if defined(OS_ANDROID) |
| 196 | base::FEATURE_DISABLED_BY_DEFAULT |
| 197 | #else |
| 198 | base::FEATURE_DISABLED_BY_DEFAULT |
| 199 | #endif |
| 200 | }; |
| 201 | |
| 202 | // Enables HW H264 encoding on Android. |
| 203 | const base::Feature kWebRtcHWH264Encoding{"WebRtcHWH264Encoding", |
| 204 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 205 | |
Antonio Gomes | f3bcd51 | 2019-09-03 21:27:17 | [diff] [blame] | 206 | #if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) |
| 207 | // Run-time feature for the |rtc_use_h264| encoder/decoder. |
| 208 | const base::Feature kWebRtcH264WithOpenH264FFmpeg{ |
| 209 | "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 210 | #endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) |
| 211 | |
Ben Kelly | 24e20aa | 2019-04-25 21:27:16 | [diff] [blame] | 212 | const base::Feature kServiceWorkerIsolateInForeground{ |
Ben Kelly | b27f17e8 | 2019-06-26 05:31:41 | [diff] [blame] | 213 | "ServiceWorkerIsolateInForeground", base::FEATURE_ENABLED_BY_DEFAULT}; |
Ben Kelly | 24e20aa | 2019-04-25 21:27:16 | [diff] [blame] | 214 | |
momohatt | fc35229 | 2018-08-29 05:12:36 | [diff] [blame] | 215 | const base::Feature kServiceWorkerImportedScriptUpdateCheck{ |
Makoto Shimazu | b9067eb0 | 2019-08-18 23:42:53 | [diff] [blame] | 216 | "ServiceWorkerImportedScriptUpdateCheck", base::FEATURE_ENABLED_BY_DEFAULT}; |
momohatt | fc35229 | 2018-08-29 05:12:36 | [diff] [blame] | 217 | |
Kenichi Ishibashi | 42f883d | 2019-01-11 08:26:14 | [diff] [blame] | 218 | const base::Feature kServiceWorkerAggressiveCodeCache{ |
| 219 | "ServiceWorkerAggressiveCodeCache", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 220 | |
Makoto Shimazu | a8b3d74 | 2019-04-05 06:55:51 | [diff] [blame] | 221 | // Experiment of the delay from navigation to starting an update of a service |
| 222 | // worker's script. |
| 223 | const base::Feature kServiceWorkerUpdateDelay{ |
| 224 | "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 225 | |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 226 | // Freeze scheduler task queues in background after allowed grace time. |
| 227 | // "stop" is a legacy name. |
| 228 | const base::Feature kStopInBackground { |
| 229 | "stop-in-background", |
| 230 | #if defined(OS_ANDROID) |
| 231 | base::FEATURE_ENABLED_BY_DEFAULT |
| 232 | #else |
| 233 | base::FEATURE_DISABLED_BY_DEFAULT |
| 234 | #endif |
| 235 | }; |
| 236 | |
Takashi Sakamoto | c19fc2b | 2019-04-10 06:30:52 | [diff] [blame] | 237 | // Freeze scheduler task queues in background on network idle. |
| 238 | // This feature only works if stop-in-background is enabled. |
| 239 | const base::Feature kFreezeBackgroundTabOnNetworkIdle{ |
| 240 | "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 241 | |
Shubhie Panicker | 60bd4b0 | 2018-09-26 00:02:15 | [diff] [blame] | 242 | // Freeze non-timer task queues in background, after allowed grace time. |
| 243 | // "stop" is a legacy name. |
Dave Tapuska | 9140c55 | 2019-05-30 16:18:56 | [diff] [blame] | 244 | const base::Feature kStopNonTimersInBackground{ |
| 245 | "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT}; |
Scott Haseley | 7757f6c | 2018-08-03 14:33:23 | [diff] [blame] | 246 | |
Brandon Maslen | da12cf8 | 2019-08-23 20:54:18 | [diff] [blame] | 247 | // Enable the Storage Access API. https://crbug.com/989663. |
| 248 | const base::Feature kStorageAccessAPI{"StorageAccessAPI", |
| 249 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 250 | |
David Bokan | e9370c2 | 2019-02-14 15:19:58 | [diff] [blame] | 251 | // Enable text snippets in URL fragments. https://crbug.com/919204. |
| 252 | const base::Feature kTextFragmentAnchor{"TextFragmentAnchor", |
| 253 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 254 | |
Bill Budge | 4d028f1 | 2018-11-20 15:05:12 | [diff] [blame] | 255 | // Enables the site isolated Wasm code cache that is keyed on the resource URL |
| 256 | // and the origin lock of the renderer that is requesting the resource. When |
| 257 | // this flag is enabled, content/GeneratedCodeCache handles code cache requests. |
| 258 | const base::Feature kWasmCodeCache = {"WasmCodeCache", |
| 259 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 260 | |
Marijn Kruisselbrink | ca4bb5e | 2019-04-22 18:19:42 | [diff] [blame] | 261 | // Writable files and native file system access. https://crbug.com/853326 |
| 262 | const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI", |
Marijn Kruisselbrink | 4cc3ec2 | 2019-09-04 16:28:20 | [diff] [blame^] | 263 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 264 | |
Jay Harris | 583f4892 | 2019-05-06 05:55:24 | [diff] [blame] | 265 | // File handling integration. https://crbug.com/829689 |
| 266 | const base::Feature kFileHandlingAPI{"FileHandlingAPI", |
| 267 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 268 | |
kdillon | 66bf5b52 | 2019-01-02 22:08:30 | [diff] [blame] | 269 | // Allows for synchronous XHR requests during page dismissal |
| 270 | const base::Feature kForbidSyncXHRInPageDismissal{ |
Katie Dillon | 54c1ad22 | 2019-04-18 23:49:52 | [diff] [blame] | 271 | "ForbidSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT}; |
kdillon | 66bf5b52 | 2019-01-02 22:08:30 | [diff] [blame] | 272 | |
Dominic Farolino | 780df94 | 2019-09-04 06:49:44 | [diff] [blame] | 273 | // Prefetch request properties are updated to be privacy-preserving. See |
| 274 | // crbug.com/988956. |
| 275 | const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges", |
| 276 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Dominic Farolino | 693fd72d | 2019-08-05 11:09:44 | [diff] [blame] | 277 | |
Carlos IL | d3be52b | 2018-10-08 17:57:18 | [diff] [blame] | 278 | const char kMixedContentAutoupgradeModeParamName[] = "mode"; |
| 279 | const char kMixedContentAutoupgradeModeBlockable[] = "blockable"; |
| 280 | const char kMixedContentAutoupgradeModeOptionallyBlockable[] = |
| 281 | "optionally-blockable"; |
| 282 | |
Sasha McIntosh | e889f9f | 2019-09-03 21:01:57 | [diff] [blame] | 283 | // Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this |
| 284 | // format in the image decode cache. See crbug.com/919627 for details on the |
| 285 | // feature. |
| 286 | const base::Feature kDecodeJpeg420ImagesToYUV{ |
| 287 | "DecodeJpeg420ImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 288 | |
Madeleine Barowsky | 45be21a4 | 2018-12-07 18:39:30 | [diff] [blame] | 289 | // Decodes lossy WebP images to YUV instead of RGBX and stores in this format |
| 290 | // in the image decode cache. See crbug.com/900264 for details on the feature. |
| 291 | const base::Feature kDecodeLossyWebPImagesToYUV{ |
| 292 | "DecodeLossyWebPImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 293 | |
Tarun Bansal | e4ad347 | 2019-07-09 03:59:28 | [diff] [blame] | 294 | // Enables usage of render frame observer as the receiver of the resource |
| 295 | // loading hints in the render process. |
| 296 | // https://crbug.com/891328. |
| 297 | const base::Feature kSendPreviewsLoadingHintsBeforeCommit{ |
| 298 | "SendPreviewsLoadingHintsBeforeCommit", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 299 | |
Takashi Toyoshima | a91506d | 2019-03-28 05:44:42 | [diff] [blame] | 300 | // Enables cache-aware WebFonts loading. See https://crbug.com/570205. |
| 301 | // The feature is disabled on Android for WebView API issue discussed at |
| 302 | // https://crbug.com/942440. |
| 303 | const base::Feature kWebFontsCacheAwareTimeoutAdaption { |
| 304 | "WebFontsCacheAwareTimeoutAdaption", |
| 305 | #if defined(OS_ANDROID) |
| 306 | base::FEATURE_DISABLED_BY_DEFAULT |
| 307 | #else |
| 308 | base::FEATURE_ENABLED_BY_DEFAULT |
| 309 | #endif |
| 310 | }; |
| 311 | |
Ehsan Karamad | be95d12 | 2019-05-10 17:59:06 | [diff] [blame] | 312 | // Enabled to block programmatic focus in subframes when not triggered by user |
| 313 | // activation (see htpps://crbug.com/954349). |
| 314 | const base::Feature kBlockingFocusWithoutUserActivation{ |
| 315 | "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 316 | |
Hongchan Choi | 370d3af | 2019-05-20 20:56:58 | [diff] [blame] | 317 | const base::Feature kAudioWorkletRealtimeThread{ |
| 318 | "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 319 | |
Ryan Sturm | 139c3ac | 2019-07-12 18:52:53 | [diff] [blame] | 320 | // A feature to reduce the set of resources fetched by No-State Prefetch. |
| 321 | const base::Feature kLightweightNoStatePrefetch{ |
Ryan Sturm | 37bcbec | 2019-07-26 12:53:08 | [diff] [blame] | 322 | "LightweightNoStatePrefetch", base::FEATURE_DISABLED_BY_DEFAULT}; |
Ryan Sturm | 139c3ac | 2019-07-12 18:52:53 | [diff] [blame] | 323 | |
Daniel Libby | 7da24b7 | 2019-05-22 05:46:35 | [diff] [blame] | 324 | // Use scroll gestures for scrollbar scrolls (see https://crbug.com/954007). |
| 325 | const base::Feature kScrollbarInjectScrollGestures{ |
Daniel Libby | 97b4475 | 2019-05-31 23:00:07 | [diff] [blame] | 326 | "ScrollbarInjectScrollGestures", base::FEATURE_ENABLED_BY_DEFAULT}; |
Daniel Libby | 7da24b7 | 2019-05-22 05:46:35 | [diff] [blame] | 327 | |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 328 | // Automatically convert light-themed pages to use a Blink-generated dark theme |
| 329 | const base::Feature kForceWebContentsDarkMode{ |
| 330 | "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 331 | |
| 332 | // Which algorithm should be used for color inversion? |
| 333 | const base::FeatureParam<ForceDarkInversionMethod>::Option |
| 334 | forcedark_inversion_method_options[] = { |
| 335 | {ForceDarkInversionMethod::kUseBlinkSettings, |
| 336 | "use_blink_settings_for_method"}, |
| 337 | {ForceDarkInversionMethod::kHslBased, "hsl_based"}, |
Aran Gilman | 8b3ca41c | 2019-08-12 18:59:04 | [diff] [blame] | 338 | {ForceDarkInversionMethod::kCielabBased, "cielab_based"}, |
| 339 | {ForceDarkInversionMethod::kRgbBased, "rgb_based"}}; |
Aran Gilman | 5e9672bed | 2019-08-02 19:07:49 | [diff] [blame] | 340 | |
| 341 | const base::FeatureParam<ForceDarkInversionMethod> |
| 342 | kForceDarkInversionMethodParam{&kForceWebContentsDarkMode, |
| 343 | "inversion_method", |
| 344 | ForceDarkInversionMethod::kUseBlinkSettings, |
| 345 | &forcedark_inversion_method_options}; |
| 346 | |
| 347 | // Should images be inverted? |
| 348 | const base::FeatureParam<ForceDarkImageBehavior>::Option |
| 349 | forcedark_image_behavior_options[] = { |
| 350 | {ForceDarkImageBehavior::kUseBlinkSettings, |
| 351 | "use_blink_settings_for_images"}, |
| 352 | {ForceDarkImageBehavior::kInvertNone, "none"}, |
| 353 | {ForceDarkImageBehavior::kInvertSelectively, "selective"}}; |
| 354 | |
| 355 | const base::FeatureParam<ForceDarkImageBehavior> kForceDarkImageBehaviorParam{ |
| 356 | &kForceWebContentsDarkMode, "image_behavior", |
| 357 | ForceDarkImageBehavior::kUseBlinkSettings, |
| 358 | &forcedark_image_behavior_options}; |
| 359 | |
| 360 | // Do not invert text lighter than this. |
| 361 | // Range: 0 (do not invert any text) to 256 (invert all text) |
| 362 | // Can also set to -1 to let Blink's internal settings control the value |
| 363 | const base::FeatureParam<int> kForceDarkTextLightnessThresholdParam{ |
| 364 | &kForceWebContentsDarkMode, "text_lightness_threshold", -1}; |
| 365 | |
| 366 | // Do not invert backgrounds darker than this. |
| 367 | // Range: 0 (invert all backgrounds) to 256 (invert no backgrounds) |
| 368 | // Can also set to -1 to let Blink's internal settings control the value |
| 369 | const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{ |
| 370 | &kForceWebContentsDarkMode, "background_lightness_threshold", -1}; |
| 371 | |
Fernando Serboncini | f318616 | 2019-06-10 20:03:47 | [diff] [blame] | 372 | const base::Feature kCanvasAlwaysDeferral{"CanvasAlwaysDeferral", |
| 373 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 374 | |
Adam Rice | 8e55e80 | 2019-06-24 11:58:03 | [diff] [blame] | 375 | // Use the new C++ implementation of WHATWG Streams. See |
| 376 | // https://crbug.com/977500. |
| 377 | const base::Feature kStreamsNative{"StreamsNative", |
Adam Rice | 3c4fc7b | 2019-08-15 08:51:13 | [diff] [blame] | 378 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Adam Rice | 8e55e80 | 2019-06-24 11:58:03 | [diff] [blame] | 379 | |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 380 | // Blink garbage collection. |
| 381 | // Enables compaction of backing stores on Blink's heap. |
| 382 | const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction", |
| 383 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 384 | // Enables concurrently marking Blink's heap. |
| 385 | const base::Feature kBlinkHeapConcurrentMarking{ |
| 386 | "BlinkHeapConcurrentMarking", base::FEATURE_DISABLED_BY_DEFAULT}; |
Anton Bikineev | 9b7b372 | 2019-07-09 13:48:39 | [diff] [blame] | 387 | // Enables concurrently sweeping Blink's heap. |
| 388 | const base::Feature kBlinkHeapConcurrentSweeping{ |
Anton Bikineev | 204cc75 | 2019-08-07 00:26:37 | [diff] [blame] | 389 | "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT}; |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 390 | // Enables incrementally marking Blink's heap. |
| 391 | const base::Feature kBlinkHeapIncrementalMarking{ |
| 392 | "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 393 | // Enables a marking stress mode that schedules more garbage collections and |
| 394 | // also adds additional verification passes. |
| 395 | const base::Feature kBlinkHeapIncrementalMarkingStress{ |
| 396 | "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 397 | // Enables unified heap garbage collection scheduling where scheduling is |
| 398 | // delegated to V8's heap controller. |
| 399 | const base::Feature kBlinkHeapUnifiedGCScheduling{ |
| 400 | "BlinkHeapUnifiedGCScheduling", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 401 | |
Ben Kelly | 298d8e0 | 2019-07-10 17:37:49 | [diff] [blame] | 402 | // Enables a delay before BufferingBytesConsumer begins reading from its |
| 403 | // underlying consumer when instantiated with CreateWithDelay(). |
| 404 | const base::Feature kBufferingBytesConsumerDelay{ |
Ben Kelly | b97951a | 2019-08-05 19:59:51 | [diff] [blame] | 405 | "BufferingBytesConsumerDelay", base::FEATURE_ENABLED_BY_DEFAULT}; |
Ben Kelly | 298d8e0 | 2019-07-10 17:37:49 | [diff] [blame] | 406 | const base::FeatureParam<int> kBufferingBytesConsumerDelayMilliseconds{ |
| 407 | &kBufferingBytesConsumerDelay, "milliseconds", 50}; |
| 408 | |
Yoav Weiss | ddfb8d2e | 2019-07-15 22:34:03 | [diff] [blame] | 409 | // Enables removing AppCache delays when triggering requests when the HTML was |
| 410 | // not fetched from AppCache. |
| 411 | const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{ |
| 412 | "VerifyHTMLFetchedFromAppCacheBeforeDelay", |
| 413 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 414 | |
Michael Spang | 8d2303e | 2019-07-26 01:56:32 | [diff] [blame] | 415 | // Controls whether we use ThreadPriority::DISPLAY for renderer |
| 416 | // compositor & IO threads. |
| 417 | const base::Feature kBlinkCompositorUseDisplayThreadPriority { |
| 418 | "BlinkCompositorUseDisplayThreadPriority", |
| 419 | #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 420 | base::FEATURE_ENABLED_BY_DEFAULT |
| 421 | #else |
| 422 | base::FEATURE_DISABLED_BY_DEFAULT |
| 423 | #endif |
| 424 | }; |
| 425 | |
Yuki Shiino | a812f49 | 2019-08-23 06:47:46 | [diff] [blame] | 426 | // Ignores cross origin windows in the named property interceptor of Window. |
| 427 | // https://crbug.com/538562 |
| 428 | const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{ |
| 429 | "IgnoreCrossOriginWindowWhenNamedAccessOnWindow", |
| 430 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 431 | |
Tarun Bansal | 3879246 | 2019-09-04 16:08:11 | [diff] [blame] | 432 | // When enabled, loading priority of JavaScript requests is lowered when they |
| 433 | // are force deferred by the intervention. |
| 434 | const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{ |
| 435 | "LowerJavaScriptPriorityWhenForceDeferred", |
| 436 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 437 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 438 | } // namespace features |
| 439 | } // namespace blink |