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 | |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 7 | #include "build/build_config.h" |
Hiroki Nakagawa | 893ee50 | 2019-02-04 06:49:53 | [diff] [blame] | 8 | #include "services/network/public/cpp/features.h" |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 9 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 10 | namespace blink { |
| 11 | namespace features { |
| 12 | |
Yao Xiao | 2c1171a | 2019-04-01 23:44:32 | [diff] [blame] | 13 | // Enable intervention for download that was initiated from or occurred in an ad |
| 14 | // frame without user activation. |
| 15 | const base::Feature kBlockingDownloadsInAdFrameWithoutUserActivation{ |
| 16 | "BlockingDownloadsInAdFrameWithoutUserActivation", |
Yao Xiao | 3f9e427 | 2019-05-23 15:22:46 | [diff] [blame] | 17 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Yao Xiao | 2c1171a | 2019-04-01 23:44:32 | [diff] [blame] | 18 | |
Stephen Chenney | de6e5c8 | 2019-01-21 01:56:04 | [diff] [blame] | 19 | // Enable defer commits a bit to avoid flash. |
| 20 | const base::Feature kAvoidFlashBetweenNavigation{ |
| 21 | "AvoidFlashBetweenNavigation", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 22 | |
Matt Falkenhagen | c25fea4 | 2018-07-17 07:13:52 | [diff] [blame] | 23 | // Enable eagerly setting up a CacheStorage interface pointer and |
| 24 | // passing it to service workers on startup as an optimization. |
| 25 | const base::Feature kEagerCacheStorageSetupForServiceWorkers{ |
| 26 | "EagerCacheStorageSetupForServiceWorkers", |
| 27 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 28 | |
Eric Karl | 0623ec7 | 2018-10-30 19:43:26 | [diff] [blame] | 29 | // Controls the user-specified viewport restriction for GPU Rasterization on |
| 30 | // mobile. See https://crbug.com/899399 |
| 31 | const base::Feature kEnableGpuRasterizationViewportRestriction{ |
| 32 | "EnableGpuRasterizationViewportRestriction", |
| 33 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 34 | |
Peter Kvitek | 197eaf7 | 2018-12-04 19:14:56 | [diff] [blame] | 35 | // Controls script streaming. |
| 36 | const base::Feature kScriptStreaming{"ScriptStreaming", |
| 37 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 38 | |
Leszek Swirski | f75c191 | 2019-05-29 10:08:25 | [diff] [blame] | 39 | // Allow streaming small (<30kB) scripts. |
| 40 | const base::Feature kSmallScriptStreaming{"SmallScriptStreaming", |
| 41 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 42 | |
Keishi Hattori | 9e10692 | 2019-04-15 09:06:03 | [diff] [blame] | 43 | // Enables user level memory pressure signal generation on Android. |
| 44 | const base::Feature kUserLevelMemoryPressureSignal{ |
| 45 | "UserLevelMemoryPressureSignal", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 46 | |
Liquan(Max) Gu | 4e243fc | 2018-11-17 00:13:02 | [diff] [blame] | 47 | // Enable FCP++ by experiment. See https://crbug.com/869924 |
| 48 | const base::Feature kFirstContentfulPaintPlusPlus{ |
Liquan(Max) Gu | 739af15 | 2019-06-07 19:27:19 | [diff] [blame] | 49 | "FirstContentfulPaintPlusPlus", base::FEATURE_ENABLED_BY_DEFAULT}; |
Liquan(Max) Gu | 4e243fc | 2018-11-17 00:13:02 | [diff] [blame] | 50 | |
Aditya Keerthi | 6a93390 | 2019-03-14 21:09:27 | [diff] [blame] | 51 | // Perform memory purges after freezing only if all pages are frozen. |
| 52 | const base::Feature kFreezePurgeMemoryAllPagesFrozen{ |
| 53 | "FreezePurgeMemoryAllPagesFrozen", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 54 | |
John Delaney | ac24e57 | 2019-04-30 19:47:02 | [diff] [blame] | 55 | // Freezes the user-agent as part of https://github.com/WICG/ua-client-hints. |
| 56 | const base::Feature kFreezeUserAgent{"FreezeUserAgent", |
| 57 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 58 | |
Steve Kobes | b51c2fed | 2019-02-27 15:36:31 | [diff] [blame] | 59 | // Enables the experimental sweep-line algorithm for tracking "jank" from |
| 60 | // layout objects changing their visual location between animation frames. |
Steve Kobes | aa9c7c2 | 2019-01-21 18:24:13 | [diff] [blame] | 61 | const base::Feature kJankTrackingSweepLine{"JankTrackingSweepLine", |
| 62 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 63 | |
Philip Rogers | 6348133 | 2018-12-01 22:16:51 | [diff] [blame] | 64 | // Enable a new compositing mode called BlinkGenPropertyTrees where Blink |
| 65 | // generates the compositor property trees. See: https://crbug.com/836884. |
| 66 | const base::Feature kBlinkGenPropertyTrees{"BlinkGenPropertyTrees", |
Philip Rogers | 3010556c | 2019-03-12 20:53:22 | [diff] [blame] | 67 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Philip Rogers | 6348133 | 2018-12-01 22:16:51 | [diff] [blame] | 68 | |
Mason Freed | c166cf1 | 2019-06-14 19:04:26 | [diff] [blame] | 69 | // Enable a new CSS property called backdrop-filter. |
| 70 | const base::Feature kCSSBackdropFilter{"CSSBackdropFilter", |
| 71 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 72 | |
Vladimir Levin | 43758ecc | 2019-05-09 18:04:03 | [diff] [blame] | 73 | // Enable Display Locking JavaScript APIs. |
| 74 | const base::Feature kDisplayLocking{"DisplayLocking", |
| 75 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 76 | |
Chris Harrelson | 6e41e3ae | 2019-05-03 23:09:40 | [diff] [blame] | 77 | // Enable applying rounded corner masks via a GL shader rather than |
| 78 | // a mask layer. |
| 79 | const base::Feature kFastBorderRadius{"FastBorderRadius", |
| 80 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 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 | |
Marijn Kruisselbrink | cde6463 | 2018-06-22 22:45:16 | [diff] [blame] | 88 | // Enable mojo Blob URL interface and better blob URL lifetime management. |
| 89 | // Can be enabled independently of NetworkService. |
| 90 | const base::Feature kMojoBlobURLs{"MojoBlobURLs", |
| 91 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 92 | |
Tarun Bansal | 422f901 | 2019-01-23 16:55:58 | [diff] [blame] | 93 | // Used to control the collection of anchor element metrics (crbug.com/856683). |
| 94 | // If kNavigationPredictor is enabled, then metrics of anchor elements |
| 95 | // in the first viewport after the page load and the metrics of the clicked |
| 96 | // anchor element will be extracted and recorded. Additionally, navigation |
| 97 | // predictor may preconnect/prefetch to resources/origins to make the |
| 98 | // future navigations faster. |
| 99 | const base::Feature kNavigationPredictor{"NavigationPredictor", |
| 100 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 101 | |
Hiroki Nakagawa | df83a6f | 2019-01-28 06:07:46 | [diff] [blame] | 102 | // Enable off-the-main-thread dedicated worker script fetch. |
| 103 | // (https://crbug.com/835717) |
| 104 | const base::Feature kOffMainThreadDedicatedWorkerScriptFetch{ |
| 105 | "OffMainThreadDedicatedWorkerScriptFetch", |
| 106 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 107 | |
Kenichi Ishibashi | 5aa265a9 | 2019-02-28 07:01:45 | [diff] [blame] | 108 | // Enable off-the-main-thread service worker script fetch. |
| 109 | // (https://crbug.com/924043) |
| 110 | const base::Feature kOffMainThreadServiceWorkerScriptFetch{ |
Kenichi Ishibashi | 24c4e1c | 2019-05-22 00:18:20 | [diff] [blame] | 111 | "OffMainThreadServiceWorkerScriptFetch", base::FEATURE_ENABLED_BY_DEFAULT}; |
Kenichi Ishibashi | 5aa265a9 | 2019-02-28 07:01:45 | [diff] [blame] | 112 | |
Hiroki Nakagawa | 893ee50 | 2019-02-04 06:49:53 | [diff] [blame] | 113 | // Enable off-the-main-thread shared worker script fetch. |
| 114 | // (https://crbug.com/924041) |
| 115 | const base::Feature kOffMainThreadSharedWorkerScriptFetch{ |
Hiroki Nakagawa | d0e97e2 | 2019-05-24 04:17:26 | [diff] [blame] | 116 | "OffMainThreadSharedWorkerScriptFetch", base::FEATURE_ENABLED_BY_DEFAULT}; |
Hiroki Nakagawa | 893ee50 | 2019-02-04 06:49:53 | [diff] [blame] | 117 | |
Daniel Murphy | 80ce302 | 2018-10-18 07:28:07 | [diff] [blame] | 118 | // Onion souping for all DOMStorage. https://crbug.com/781870 |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 119 | const base::Feature kOnionSoupDOMStorage{"OnionSoupDOMStorage", |
Daniel Murphy | dc4aa5a7 | 2019-02-07 22:08:47 | [diff] [blame] | 120 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 121 | |
Hiroki Nakagawa | 61ee004 | 2019-01-22 06:30:26 | [diff] [blame] | 122 | // Enable browser-initiated dedicated worker script loading |
| 123 | // (PlzDedicatedWorker). https://crbug.com/906991 |
| 124 | const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker", |
| 125 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 126 | |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 127 | // Enable Portals. https://crbug.com/865123. |
| 128 | const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 129 | |
Tarun Bansal | 8df12b5 | 2019-02-15 05:46:30 | [diff] [blame] | 130 | // Enable limiting previews loading hints to specific resource types. |
| 131 | const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{ |
| 132 | "PreviewsResourceLoadingHintsSpecificResourceTypes", |
| 133 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 134 | |
Aditya Keerthi | e84331b3 | 2019-03-20 15:25:52 | [diff] [blame] | 135 | // Perform a memory purge after a renderer is backgrounded. Formerly labelled as |
| 136 | // the "PurgeAndSuspend" experiment. |
| 137 | // |
| 138 | // TODO(adityakeerthi): Disabled by default on Mac and Android for historical |
| 139 | // reasons. Consider enabling by default if experiment results are positive. |
| 140 | // https://crbug.com/926186 |
| 141 | const base::Feature kPurgeRendererMemoryWhenBackgrounded { |
| 142 | "PurgeRendererMemoryWhenBackgrounded", |
| 143 | #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 144 | base::FEATURE_DISABLED_BY_DEFAULT |
| 145 | #else |
| 146 | base::FEATURE_ENABLED_BY_DEFAULT |
| 147 | #endif |
| 148 | }; |
| 149 | |
David Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 150 | // Enable Implicit Root Scroller. https://crbug.com/903260. |
David Bokan | 145b547 | 2019-05-22 14:38:44 | [diff] [blame] | 151 | // TODO(bokan): Temporarily disabled on desktop platforms to address issues |
| 152 | // with non-overlay scrollbars. https://crbug.com/948059. |
| 153 | const base::Feature kImplicitRootScroller { |
| 154 | "ImplicitRootScroller", |
| 155 | #if defined(OS_ANDROID) |
| 156 | base::FEATURE_ENABLED_BY_DEFAULT |
| 157 | #else |
| 158 | base::FEATURE_DISABLED_BY_DEFAULT |
| 159 | #endif |
| 160 | }; |
David Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 161 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 162 | // Enables usage of getDisplayMedia() that allows capture of web content, see |
| 163 | // https://crbug.com/865060. |
| 164 | const base::Feature kRTCGetDisplayMedia{"RTCGetDisplayMedia", |
| 165 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 166 | |
| 167 | // Changes the default RTCPeerConnection constructor behavior to use Unified |
| 168 | // Plan as the SDP semantics. When the feature is enabled, Unified Plan is used |
| 169 | // unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the |
| 170 | // argument). |
| 171 | const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault", |
Henrik Boström | 07021ec8 | 2019-01-17 22:23:56 | [diff] [blame] | 172 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 173 | |
Johannes Kron | ad5a453 | 2019-01-09 11:17:46 | [diff] [blame] | 174 | // Determines if the SDP attrbute extmap-allow-mixed should be offered by |
| 175 | // default or not. The default value can be overridden by passing |
| 176 | // {offerExtmapAllowMixed:true} as an argument to the RTCPeerConnection |
| 177 | // constructor. |
| 178 | const base::Feature kRTCOfferExtmapAllowMixed{ |
| 179 | "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 180 | |
Ben Kelly | 24e20aa | 2019-04-25 21:27:16 | [diff] [blame] | 181 | const base::Feature kServiceWorkerIsolateInForeground{ |
Ben Kelly | b27f17e8 | 2019-06-26 05:31:41 | [diff] [blame] | 182 | "ServiceWorkerIsolateInForeground", base::FEATURE_ENABLED_BY_DEFAULT}; |
Ben Kelly | 24e20aa | 2019-04-25 21:27:16 | [diff] [blame] | 183 | |
momohatt | fc35229 | 2018-08-29 05:12:36 | [diff] [blame] | 184 | const base::Feature kServiceWorkerImportedScriptUpdateCheck{ |
| 185 | "ServiceWorkerImportedScriptUpdateCheck", |
| 186 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 187 | |
Ben Kelly | e20dc40 | 2018-09-18 01:55:42 | [diff] [blame] | 188 | // Enables reading a subresource's body data and side data in parallel. |
| 189 | const base::Feature kServiceWorkerParallelSideDataReading{ |
| 190 | "ServiceWorkerParallelSideDataReading", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 191 | |
Kenichi Ishibashi | 42f883d | 2019-01-11 08:26:14 | [diff] [blame] | 192 | const base::Feature kServiceWorkerAggressiveCodeCache{ |
| 193 | "ServiceWorkerAggressiveCodeCache", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 194 | |
Makoto Shimazu | a8b3d74 | 2019-04-05 06:55:51 | [diff] [blame] | 195 | // Experiment of the delay from navigation to starting an update of a service |
| 196 | // worker's script. |
| 197 | const base::Feature kServiceWorkerUpdateDelay{ |
| 198 | "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 199 | |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 200 | // Freeze scheduler task queues in background after allowed grace time. |
| 201 | // "stop" is a legacy name. |
| 202 | const 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 Sakamoto | c19fc2b | 2019-04-10 06:30:52 | [diff] [blame] | 211 | // Freeze scheduler task queues in background on network idle. |
| 212 | // This feature only works if stop-in-background is enabled. |
| 213 | const base::Feature kFreezeBackgroundTabOnNetworkIdle{ |
| 214 | "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 215 | |
Shubhie Panicker | 60bd4b0 | 2018-09-26 00:02:15 | [diff] [blame] | 216 | // Freeze non-timer task queues in background, after allowed grace time. |
| 217 | // "stop" is a legacy name. |
Dave Tapuska | 9140c55 | 2019-05-30 16:18:56 | [diff] [blame] | 218 | const base::Feature kStopNonTimersInBackground{ |
| 219 | "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT}; |
Scott Haseley | 7757f6c | 2018-08-03 14:33:23 | [diff] [blame] | 220 | |
David Bokan | e9370c2 | 2019-02-14 15:19:58 | [diff] [blame] | 221 | // Enable text snippets in URL fragments. https://crbug.com/919204. |
| 222 | const base::Feature kTextFragmentAnchor{"TextFragmentAnchor", |
| 223 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 224 | |
Bill Budge | 4d028f1 | 2018-11-20 15:05:12 | [diff] [blame] | 225 | // Enables the site isolated Wasm code cache that is keyed on the resource URL |
| 226 | // and the origin lock of the renderer that is requesting the resource. When |
| 227 | // this flag is enabled, content/GeneratedCodeCache handles code cache requests. |
| 228 | const base::Feature kWasmCodeCache = {"WasmCodeCache", |
| 229 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 230 | |
Marijn Kruisselbrink | ca4bb5e | 2019-04-22 18:19:42 | [diff] [blame] | 231 | // Writable files and native file system access. https://crbug.com/853326 |
| 232 | const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI", |
Marijn Kruisselbrink | fa0e105 | 2019-03-05 22:32:55 | [diff] [blame] | 233 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 234 | |
Jay Harris | 583f4892 | 2019-05-06 05:55:24 | [diff] [blame] | 235 | // File handling integration. https://crbug.com/829689 |
| 236 | const base::Feature kFileHandlingAPI{"FileHandlingAPI", |
| 237 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 238 | |
kdillon | 66bf5b52 | 2019-01-02 22:08:30 | [diff] [blame] | 239 | // Allows for synchronous XHR requests during page dismissal |
| 240 | const base::Feature kForbidSyncXHRInPageDismissal{ |
Katie Dillon | 54c1ad22 | 2019-04-18 23:49:52 | [diff] [blame] | 241 | "ForbidSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT}; |
kdillon | 66bf5b52 | 2019-01-02 22:08:30 | [diff] [blame] | 242 | |
Carlos IL | d3be52b | 2018-10-08 17:57:18 | [diff] [blame] | 243 | const char kMixedContentAutoupgradeModeParamName[] = "mode"; |
| 244 | const char kMixedContentAutoupgradeModeBlockable[] = "blockable"; |
| 245 | const char kMixedContentAutoupgradeModeOptionallyBlockable[] = |
| 246 | "optionally-blockable"; |
| 247 | |
Madeleine Barowsky | 45be21a4 | 2018-12-07 18:39:30 | [diff] [blame] | 248 | // Decodes lossy WebP images to YUV instead of RGBX and stores in this format |
| 249 | // in the image decode cache. See crbug.com/900264 for details on the feature. |
| 250 | const base::Feature kDecodeLossyWebPImagesToYUV{ |
| 251 | "DecodeLossyWebPImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 252 | |
Aaron Krajeski | f2f827d42 | 2019-01-08 15:08:34 | [diff] [blame] | 253 | // Use accelerated canvases whenever possible see https://crbug.com/909937 |
| 254 | const base::Feature kAlwaysAccelerateCanvas{"AlwaysAccelerateCanvas", |
Aaron Krajeski | ccfb912 | 2019-04-25 21:28:44 | [diff] [blame] | 255 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Aaron Krajeski | f2f827d42 | 2019-01-08 15:08:34 | [diff] [blame] | 256 | |
Tarun Bansal | e4ad347 | 2019-07-09 03:59:28 | [diff] [blame] | 257 | // Enables usage of render frame observer as the receiver of the resource |
| 258 | // loading hints in the render process. |
| 259 | // https://crbug.com/891328. |
| 260 | const base::Feature kSendPreviewsLoadingHintsBeforeCommit{ |
| 261 | "SendPreviewsLoadingHintsBeforeCommit", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 262 | |
Takashi Toyoshima | a91506d | 2019-03-28 05:44:42 | [diff] [blame] | 263 | // Enables cache-aware WebFonts loading. See https://crbug.com/570205. |
| 264 | // The feature is disabled on Android for WebView API issue discussed at |
| 265 | // https://crbug.com/942440. |
| 266 | const base::Feature kWebFontsCacheAwareTimeoutAdaption { |
| 267 | "WebFontsCacheAwareTimeoutAdaption", |
| 268 | #if defined(OS_ANDROID) |
| 269 | base::FEATURE_DISABLED_BY_DEFAULT |
| 270 | #else |
| 271 | base::FEATURE_ENABLED_BY_DEFAULT |
| 272 | #endif |
| 273 | }; |
| 274 | |
Ehsan Karamad | be95d12 | 2019-05-10 17:59:06 | [diff] [blame] | 275 | // Enabled to block programmatic focus in subframes when not triggered by user |
| 276 | // activation (see htpps://crbug.com/954349). |
| 277 | const base::Feature kBlockingFocusWithoutUserActivation{ |
| 278 | "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 279 | |
Hongchan Choi | 370d3af | 2019-05-20 20:56:58 | [diff] [blame] | 280 | const base::Feature kAudioWorkletRealtimeThread{ |
| 281 | "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 282 | |
Ryan Sturm | 139c3ac | 2019-07-12 18:52:53 | [diff] [blame^] | 283 | // A feature to reduce the set of resources fetched by No-State Prefetch. |
| 284 | const base::Feature kLightweightNoStatePrefetch{ |
| 285 | "kLightweightNoStatePrefetch", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 286 | |
Daniel Libby | 7da24b7 | 2019-05-22 05:46:35 | [diff] [blame] | 287 | // Use scroll gestures for scrollbar scrolls (see https://crbug.com/954007). |
| 288 | const base::Feature kScrollbarInjectScrollGestures{ |
Daniel Libby | 97b4475 | 2019-05-31 23:00:07 | [diff] [blame] | 289 | "ScrollbarInjectScrollGestures", base::FEATURE_ENABLED_BY_DEFAULT}; |
Daniel Libby | 7da24b7 | 2019-05-22 05:46:35 | [diff] [blame] | 290 | |
Hiroki Nakagawa | 893ee50 | 2019-02-04 06:49:53 | [diff] [blame] | 291 | bool IsOffMainThreadSharedWorkerScriptFetchEnabled() { |
| 292 | // Off-the-main-thread shared worker script fetch depends on PlzSharedWorker |
| 293 | // (NetworkService). |
Hiroki Nakagawa | 893ee50 | 2019-02-04 06:49:53 | [diff] [blame] | 294 | return base::FeatureList::IsEnabled(network::features::kNetworkService) && |
| 295 | base::FeatureList::IsEnabled( |
| 296 | features::kOffMainThreadSharedWorkerScriptFetch); |
| 297 | } |
| 298 | |
Hiroki Nakagawa | 7d8cbfa | 2019-02-07 11:01:28 | [diff] [blame] | 299 | bool IsPlzDedicatedWorkerEnabled() { |
| 300 | // PlzDedicatedWorker depends on off-the-main-thread dedicated worker script |
| 301 | // fetch and NetworkService. |
| 302 | #if DCHECK_IS_ON() |
| 303 | if (base::FeatureList::IsEnabled(features::kPlzDedicatedWorker)) { |
| 304 | DCHECK(base::FeatureList::IsEnabled( |
| 305 | features::kOffMainThreadDedicatedWorkerScriptFetch)) |
| 306 | << "PlzDedicatedWorker is enabled but " |
| 307 | << "OffMainThreadDedicatedWorkerScriptFetch isn't. PlzDedicatedWorker " |
| 308 | << "requires OffMainThreadDedicatedWorkerScriptFetch."; |
| 309 | DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService)) |
| 310 | << "PlzDedicatedWorker is enabled but NetworkService isn't. " |
| 311 | << "PlzDedicatedWorker requires NetworkService."; |
| 312 | } |
| 313 | #endif // DCHECK_IS_ON() |
| 314 | return base::FeatureList::IsEnabled( |
| 315 | features::kOffMainThreadDedicatedWorkerScriptFetch) && |
| 316 | base::FeatureList::IsEnabled(network::features::kNetworkService) && |
| 317 | base::FeatureList::IsEnabled(features::kPlzDedicatedWorker); |
| 318 | } |
| 319 | |
Fernando Serboncini | f318616 | 2019-06-10 20:03:47 | [diff] [blame] | 320 | const base::Feature kCanvasAlwaysDeferral{"CanvasAlwaysDeferral", |
| 321 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 322 | |
Adam Rice | 8e55e80 | 2019-06-24 11:58:03 | [diff] [blame] | 323 | // Use the new C++ implementation of WHATWG Streams. See |
| 324 | // https://crbug.com/977500. |
| 325 | const base::Feature kStreamsNative{"StreamsNative", |
| 326 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 327 | |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 328 | // Blink garbage collection. |
| 329 | // Enables compaction of backing stores on Blink's heap. |
| 330 | const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction", |
| 331 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 332 | // Enables concurrently marking Blink's heap. |
| 333 | const base::Feature kBlinkHeapConcurrentMarking{ |
| 334 | "BlinkHeapConcurrentMarking", base::FEATURE_DISABLED_BY_DEFAULT}; |
Anton Bikineev | 9b7b372 | 2019-07-09 13:48:39 | [diff] [blame] | 335 | // Enables concurrently sweeping Blink's heap. |
| 336 | const base::Feature kBlinkHeapConcurrentSweeping{ |
| 337 | "BlinkHeapConcurrentSweeping", base::FEATURE_DISABLED_BY_DEFAULT}; |
Michael Lippautz | e670df9f | 2019-07-09 11:39:49 | [diff] [blame] | 338 | // Enables incrementally marking Blink's heap. |
| 339 | const base::Feature kBlinkHeapIncrementalMarking{ |
| 340 | "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 341 | // Enables a marking stress mode that schedules more garbage collections and |
| 342 | // also adds additional verification passes. |
| 343 | const base::Feature kBlinkHeapIncrementalMarkingStress{ |
| 344 | "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 345 | // Enables unified heap garbage collection scheduling where scheduling is |
| 346 | // delegated to V8's heap controller. |
| 347 | const base::Feature kBlinkHeapUnifiedGCScheduling{ |
| 348 | "BlinkHeapUnifiedGCScheduling", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 349 | |
Ben Kelly | 298d8e0 | 2019-07-10 17:37:49 | [diff] [blame] | 350 | // Enables a delay before BufferingBytesConsumer begins reading from its |
| 351 | // underlying consumer when instantiated with CreateWithDelay(). |
| 352 | const base::Feature kBufferingBytesConsumerDelay{ |
| 353 | "BufferingBytesConsumerDelay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 354 | const base::FeatureParam<int> kBufferingBytesConsumerDelayMilliseconds{ |
| 355 | &kBufferingBytesConsumerDelay, "milliseconds", 50}; |
| 356 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 357 | } // namespace features |
| 358 | } // namespace blink |