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" |
| 8 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 9 | namespace blink { |
| 10 | namespace features { |
| 11 | |
Fabio Tirelo | 9b423c7b | 2018-08-15 14:32:18 | [diff] [blame] | 12 | const base::Feature kAutofillPreviewStyleExperiment{ |
| 13 | "AutofillPreviewStyleExperiment", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 14 | |
Stephen Chenney | de6e5c8 | 2019-01-21 01:56:04 | [diff] [blame] | 15 | // Enable defer commits a bit to avoid flash. |
| 16 | const base::Feature kAvoidFlashBetweenNavigation{ |
| 17 | "AvoidFlashBetweenNavigation", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 18 | |
Matt Falkenhagen | c25fea4 | 2018-07-17 07:13:52 | [diff] [blame] | 19 | // Enable eagerly setting up a CacheStorage interface pointer and |
| 20 | // passing it to service workers on startup as an optimization. |
| 21 | const base::Feature kEagerCacheStorageSetupForServiceWorkers{ |
| 22 | "EagerCacheStorageSetupForServiceWorkers", |
| 23 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 24 | |
Eric Karl | 0623ec7 | 2018-10-30 19:43:26 | [diff] [blame] | 25 | // Controls the user-specified viewport restriction for GPU Rasterization on |
| 26 | // mobile. See https://crbug.com/899399 |
| 27 | const base::Feature kEnableGpuRasterizationViewportRestriction{ |
| 28 | "EnableGpuRasterizationViewportRestriction", |
| 29 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 30 | |
Peter Kvitek | 197eaf7 | 2018-12-04 19:14:56 | [diff] [blame] | 31 | // Controls script streaming. |
| 32 | const base::Feature kScriptStreaming{"ScriptStreaming", |
| 33 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 34 | |
Liquan(Max) Gu | 4e243fc | 2018-11-17 00:13:02 | [diff] [blame] | 35 | // Enable FCP++ by experiment. See https://crbug.com/869924 |
| 36 | const base::Feature kFirstContentfulPaintPlusPlus{ |
| 37 | "FirstContentfulPaintPlusPlus", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 38 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 39 | // Tracks "jank" from layout objects changing their visual location between |
| 40 | // animation frames (see crbug.com/581518). |
| 41 | const base::Feature kJankTracking{"JankTracking", |
| 42 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 43 | |
Steve Kobes | aa9c7c2 | 2019-01-21 18:24:13 | [diff] [blame] | 44 | const base::Feature kJankTrackingSweepLine{"JankTrackingSweepLine", |
| 45 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 46 | |
Philip Rogers | 6348133 | 2018-12-01 22:16:51 | [diff] [blame] | 47 | // Enable a new compositing mode called BlinkGenPropertyTrees where Blink |
| 48 | // generates the compositor property trees. See: https://crbug.com/836884. |
| 49 | const base::Feature kBlinkGenPropertyTrees{"BlinkGenPropertyTrees", |
| 50 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 51 | |
Ian Kilpatrick | e68ef11a | 2018-07-04 03:52:10 | [diff] [blame] | 52 | // Enable LayoutNG. |
| 53 | const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 54 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 55 | const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent", |
| 56 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 57 | |
Marijn Kruisselbrink | cde6463 | 2018-06-22 22:45:16 | [diff] [blame] | 58 | // Enable mojo Blob URL interface and better blob URL lifetime management. |
| 59 | // Can be enabled independently of NetworkService. |
| 60 | const base::Feature kMojoBlobURLs{"MojoBlobURLs", |
| 61 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 62 | |
Tarun Bansal | 422f901 | 2019-01-23 16:55:58 | [diff] [blame] | 63 | // Used to control the collection of anchor element metrics (crbug.com/856683). |
| 64 | // If kNavigationPredictor is enabled, then metrics of anchor elements |
| 65 | // in the first viewport after the page load and the metrics of the clicked |
| 66 | // anchor element will be extracted and recorded. Additionally, navigation |
| 67 | // predictor may preconnect/prefetch to resources/origins to make the |
| 68 | // future navigations faster. |
| 69 | const base::Feature kNavigationPredictor{"NavigationPredictor", |
| 70 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 71 | |
Hiroki Nakagawa | df83a6f | 2019-01-28 06:07:46 | [diff] [blame] | 72 | // Enable off-the-main-thread dedicated worker script fetch. |
| 73 | // (https://crbug.com/835717) |
| 74 | const base::Feature kOffMainThreadDedicatedWorkerScriptFetch{ |
| 75 | "OffMainThreadDedicatedWorkerScriptFetch", |
| 76 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 77 | |
Daniel Murphy | 80ce302 | 2018-10-18 07:28:07 | [diff] [blame] | 78 | // Onion souping for all DOMStorage. https://crbug.com/781870 |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 79 | const base::Feature kOnionSoupDOMStorage{"OnionSoupDOMStorage", |
Daniel Murphy | b584e22 | 2019-01-31 01:09:38 | [diff] [blame] | 80 | base::FEATURE_DISABLED_BY_DEFAULT}; |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 81 | |
Hiroki Nakagawa | 61ee004 | 2019-01-22 06:30:26 | [diff] [blame] | 82 | // Enable browser-initiated dedicated worker script loading |
| 83 | // (PlzDedicatedWorker). https://crbug.com/906991 |
| 84 | const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker", |
| 85 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 86 | |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 87 | // Enable Portals. https://crbug.com/865123. |
| 88 | const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 89 | |
David Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 90 | // Enable Implicit Root Scroller. https://crbug.com/903260. |
| 91 | const base::Feature kImplicitRootScroller{"ImplicitRootScroller", |
David Bokan | 5173a50 | 2019-01-11 22:06:48 | [diff] [blame] | 92 | base::FEATURE_ENABLED_BY_DEFAULT}; |
David Bokan | 911bded | 2018-11-27 23:23:32 | [diff] [blame] | 93 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 94 | // Enables usage of getDisplayMedia() that allows capture of web content, see |
| 95 | // https://crbug.com/865060. |
| 96 | const base::Feature kRTCGetDisplayMedia{"RTCGetDisplayMedia", |
| 97 | base::FEATURE_ENABLED_BY_DEFAULT}; |
| 98 | |
| 99 | // Changes the default RTCPeerConnection constructor behavior to use Unified |
| 100 | // Plan as the SDP semantics. When the feature is enabled, Unified Plan is used |
| 101 | // unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the |
| 102 | // argument). |
| 103 | const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault", |
Henrik Boström | 07021ec8 | 2019-01-17 22:23:56 | [diff] [blame] | 104 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 105 | |
Johannes Kron | ad5a453 | 2019-01-09 11:17:46 | [diff] [blame] | 106 | // Determines if the SDP attrbute extmap-allow-mixed should be offered by |
| 107 | // default or not. The default value can be overridden by passing |
| 108 | // {offerExtmapAllowMixed:true} as an argument to the RTCPeerConnection |
| 109 | // constructor. |
| 110 | const base::Feature kRTCOfferExtmapAllowMixed{ |
| 111 | "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 112 | |
Makoto Shimazu | fc82e99 | 2018-12-05 07:14:28 | [diff] [blame] | 113 | // Enables to load the response body through Mojo data pipe passed by |
| 114 | // WebURLLoaderClient::DidStartLoadingResponseBody() instead of |
| 115 | // WebURLLoaderClient::DidReceiveData(). |
| 116 | const base::Feature kResourceLoadViaDataPipe{"ResourceLoadViaDataPipe", |
Makoto Shimazu | 8d98fb5 | 2019-02-04 06:22:07 | [diff] [blame] | 117 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Makoto Shimazu | fc82e99 | 2018-12-05 07:14:28 | [diff] [blame] | 118 | |
momohatt | fc35229 | 2018-08-29 05:12:36 | [diff] [blame] | 119 | const base::Feature kServiceWorkerImportedScriptUpdateCheck{ |
| 120 | "ServiceWorkerImportedScriptUpdateCheck", |
| 121 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 122 | |
Ben Kelly | e20dc40 | 2018-09-18 01:55:42 | [diff] [blame] | 123 | // Enables reading a subresource's body data and side data in parallel. |
| 124 | const base::Feature kServiceWorkerParallelSideDataReading{ |
| 125 | "ServiceWorkerParallelSideDataReading", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 126 | |
Kenichi Ishibashi | 42f883d | 2019-01-11 08:26:14 | [diff] [blame] | 127 | const base::Feature kServiceWorkerAggressiveCodeCache{ |
| 128 | "ServiceWorkerAggressiveCodeCache", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 129 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 130 | // Enable new service worker glue for NetworkService. Can be |
| 131 | // enabled independently of NetworkService. |
| 132 | const base::Feature kServiceWorkerServicification{ |
Matt Falkenhagen | 5d2271c | 2018-10-17 10:12:44 | [diff] [blame] | 133 | "ServiceWorkerServicification", base::FEATURE_ENABLED_BY_DEFAULT}; |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 134 | |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 135 | // Freeze scheduler task queues in background after allowed grace time. |
| 136 | // "stop" is a legacy name. |
| 137 | const base::Feature kStopInBackground { |
| 138 | "stop-in-background", |
| 139 | #if defined(OS_ANDROID) |
| 140 | base::FEATURE_ENABLED_BY_DEFAULT |
| 141 | #else |
| 142 | base::FEATURE_DISABLED_BY_DEFAULT |
| 143 | #endif |
| 144 | }; |
| 145 | |
Shubhie Panicker | 60bd4b0 | 2018-09-26 00:02:15 | [diff] [blame] | 146 | // Freeze non-timer task queues in background, after allowed grace time. |
| 147 | // "stop" is a legacy name. |
| 148 | const base::Feature kStopNonTimersInBackground { |
| 149 | "stop-non-timers-in-background", |
| 150 | #if defined(OS_ANDROID) |
| 151 | base::FEATURE_ENABLED_BY_DEFAULT |
| 152 | #else |
| 153 | base::FEATURE_DISABLED_BY_DEFAULT |
| 154 | #endif |
| 155 | }; |
Scott Haseley | 7757f6c | 2018-08-03 14:33:23 | [diff] [blame] | 156 | |
Bill Budge | 4d028f1 | 2018-11-20 15:05:12 | [diff] [blame] | 157 | // Enables the site isolated Wasm code cache that is keyed on the resource URL |
| 158 | // and the origin lock of the renderer that is requesting the resource. When |
| 159 | // this flag is enabled, content/GeneratedCodeCache handles code cache requests. |
| 160 | const base::Feature kWasmCodeCache = {"WasmCodeCache", |
| 161 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 162 | |
Makoto Shimazu | 172eec0 | 2018-11-29 06:21:44 | [diff] [blame] | 163 | // Writable files and native filesystem access. https://crbug.com/853326 |
| 164 | const base::Feature kWritableFilesAPI{"WritableFilesAPI", |
| 165 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 166 | |
kdillon | 66bf5b52 | 2019-01-02 22:08:30 | [diff] [blame] | 167 | // Allows for synchronous XHR requests during page dismissal |
| 168 | const base::Feature kForbidSyncXHRInPageDismissal{ |
| 169 | "ForbidSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 170 | |
Fabio Tirelo | 9b423c7b | 2018-08-15 14:32:18 | [diff] [blame] | 171 | const char kAutofillPreviewStyleExperimentBgColorParameterName[] = "bg_color"; |
| 172 | |
| 173 | const char kAutofillPreviewStyleExperimentColorParameterName[] = "color"; |
| 174 | |
Carlos IL | d3be52b | 2018-10-08 17:57:18 | [diff] [blame] | 175 | const char kMixedContentAutoupgradeModeParamName[] = "mode"; |
| 176 | const char kMixedContentAutoupgradeModeBlockable[] = "blockable"; |
| 177 | const char kMixedContentAutoupgradeModeOptionallyBlockable[] = |
| 178 | "optionally-blockable"; |
| 179 | |
Madeleine Barowsky | 45be21a4 | 2018-12-07 18:39:30 | [diff] [blame] | 180 | // Decodes lossy WebP images to YUV instead of RGBX and stores in this format |
| 181 | // in the image decode cache. See crbug.com/900264 for details on the feature. |
| 182 | const base::Feature kDecodeLossyWebPImagesToYUV{ |
| 183 | "DecodeLossyWebPImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 184 | |
Aaron Krajeski | f2f827d42 | 2019-01-08 15:08:34 | [diff] [blame] | 185 | // Use accelerated canvases whenever possible see https://crbug.com/909937 |
| 186 | const base::Feature kAlwaysAccelerateCanvas{"AlwaysAccelerateCanvas", |
| 187 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 188 | |
Takashi Toyoshima | 67bee39 | 2019-01-29 11:30:36 | [diff] [blame] | 189 | // Enables cache-aware WebFonts loading. See https://crbug.com/570205. |
| 190 | const base::Feature kWebFontsCacheAwareTimeoutAdaption{ |
| 191 | "WebFontsCacheAwareTimeoutAdaption", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 192 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 193 | } // namespace features |
| 194 | } // namespace blink |