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