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 | |
Liquan(Max) Gu | 4e243fc | 2018-11-17 00:13:02 | [diff] [blame] | 27 | // Enable FCP++ by experiment. See https://crbug.com/869924 |
| 28 | const base::Feature kFirstContentfulPaintPlusPlus{ |
| 29 | "FirstContentfulPaintPlusPlus", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 30 | |
Ian Kilpatrick | e68ef11a | 2018-07-04 03:52:10 | [diff] [blame] | 31 | // Enable LayoutNG. |
| 32 | const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 33 | |
Marijn Kruisselbrink | cde6463 | 2018-06-22 22:45:16 | [diff] [blame] | 34 | // Enable mojo Blob URL interface and better blob URL lifetime management. |
| 35 | // Can be enabled independently of NetworkService. |
| 36 | const base::Feature kMojoBlobURLs{"MojoBlobURLs", |
| 37 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 38 | |
Daniel Murphy | 80ce302 | 2018-10-18 07:28:07 | [diff] [blame] | 39 | // Onion souping for all DOMStorage. https://crbug.com/781870 |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 40 | const base::Feature kOnionSoupDOMStorage{"OnionSoupDOMStorage", |
Daniel Murphy | 80ce302 | 2018-10-18 07:28:07 | [diff] [blame] | 41 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Daniel Murphy | 95792ef | 2018-10-04 01:29:55 | [diff] [blame] | 42 | |
| 43 | // Enable Portals. https://crbug.com/865123. |
| 44 | const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 45 | |
| 46 | // Used to control the collection of anchor element metrics (crbug.com/856683). |
| 47 | // If kRecordAnchorMetricsClicked is enabled, then metrics of anchor elements |
| 48 | // clicked by the user will be extracted and recorded. |
| 49 | // If kRecordAnchorMetricsVisible is enabled, then metrics of anchor elements |
| 50 | // in the first viewport after the page load will be extracted and recorded. |
| 51 | const base::Feature kRecordAnchorMetricsClicked{ |
| 52 | "RecordAnchorMetricsClicked", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 53 | const base::Feature kRecordAnchorMetricsVisible{ |
| 54 | "RecordAnchorMetricsVisible", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 55 | |
momohatt | fc35229 | 2018-08-29 05:12:36 | [diff] [blame] | 56 | const base::Feature kServiceWorkerImportedScriptUpdateCheck{ |
| 57 | "ServiceWorkerImportedScriptUpdateCheck", |
| 58 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 59 | |
Ben Kelly | e20dc40 | 2018-09-18 01:55:42 | [diff] [blame] | 60 | // Enables reading a subresource's body data and side data in parallel. |
| 61 | const base::Feature kServiceWorkerParallelSideDataReading{ |
| 62 | "ServiceWorkerParallelSideDataReading", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 63 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 64 | // Enable new service worker glue for NetworkService. Can be |
| 65 | // enabled independently of NetworkService. |
| 66 | const base::Feature kServiceWorkerServicification{ |
Matt Falkenhagen | 5d2271c | 2018-10-17 10:12:44 | [diff] [blame] | 67 | "ServiceWorkerServicification", base::FEATURE_ENABLED_BY_DEFAULT}; |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 68 | |
Scott Haseley | 8eefdcd | 2018-08-22 16:50:19 | [diff] [blame] | 69 | // Freeze scheduler task queues in background after allowed grace time. |
| 70 | // "stop" is a legacy name. |
| 71 | const base::Feature kStopInBackground { |
| 72 | "stop-in-background", |
| 73 | #if defined(OS_ANDROID) |
| 74 | base::FEATURE_ENABLED_BY_DEFAULT |
| 75 | #else |
| 76 | base::FEATURE_DISABLED_BY_DEFAULT |
| 77 | #endif |
| 78 | }; |
| 79 | |
Shubhie Panicker | 60bd4b0 | 2018-09-26 00:02:15 | [diff] [blame] | 80 | // Freeze non-timer task queues in background, after allowed grace time. |
| 81 | // "stop" is a legacy name. |
| 82 | const base::Feature kStopNonTimersInBackground { |
| 83 | "stop-non-timers-in-background", |
| 84 | #if defined(OS_ANDROID) |
| 85 | base::FEATURE_ENABLED_BY_DEFAULT |
| 86 | #else |
| 87 | base::FEATURE_DISABLED_BY_DEFAULT |
| 88 | #endif |
| 89 | }; |
Scott Haseley | 7757f6c | 2018-08-03 14:33:23 | [diff] [blame] | 90 | |
Marijn Kruisselbrink | 52a6313 | 2018-08-29 16:25:21 | [diff] [blame] | 91 | // Writable files and native filesystem access. https://crbug.com/853326 |
| 92 | const base::Feature kWritableFilesAPI{"WritableFilesAPI", |
| 93 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 94 | |
Carlos IL | e30fab2 | 2018-10-02 01:47:48 | [diff] [blame] | 95 | const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent", |
| 96 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 97 | |
Steve Kobes | 6bd8396 | 2018-10-04 20:11:29 | [diff] [blame] | 98 | // Tracks "jank" from layout objects changing their visual location between |
| 99 | // animation frames (see crbug.com/581518). |
| 100 | const base::Feature kJankTracking{"JankTracking", |
| 101 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 102 | |
Henrik Boström | 386afc6d6 | 2018-10-08 07:47:15 | [diff] [blame] | 103 | // Changes the default RTCPeerConnection constructor behavior to use Unified |
| 104 | // Plan as the SDP semantics. When the feature is enabled, Unified Plan is used |
| 105 | // unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the |
| 106 | // argument). |
| 107 | const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault", |
| 108 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 109 | |
Bill Budge | 4d028f1 | 2018-11-20 15:05:12 | [diff] [blame^] | 110 | // Enables the site isolated Wasm code cache that is keyed on the resource URL |
| 111 | // and the origin lock of the renderer that is requesting the resource. When |
| 112 | // this flag is enabled, content/GeneratedCodeCache handles code cache requests. |
| 113 | const base::Feature kWasmCodeCache = {"WasmCodeCache", |
| 114 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 115 | |
Fabio Tirelo | 9b423c7b | 2018-08-15 14:32:18 | [diff] [blame] | 116 | const char kAutofillPreviewStyleExperimentBgColorParameterName[] = "bg_color"; |
| 117 | |
| 118 | const char kAutofillPreviewStyleExperimentColorParameterName[] = "color"; |
| 119 | |
Carlos IL | d3be52b | 2018-10-08 17:57:18 | [diff] [blame] | 120 | const char kMixedContentAutoupgradeModeParamName[] = "mode"; |
| 121 | const char kMixedContentAutoupgradeModeBlockable[] = "blockable"; |
| 122 | const char kMixedContentAutoupgradeModeOptionallyBlockable[] = |
| 123 | "optionally-blockable"; |
| 124 | |
Matt Falkenhagen | 5cc65279 | 2018-06-21 10:34:33 | [diff] [blame] | 125 | } // namespace features |
| 126 | } // namespace blink |