blob: cf9b28c6237e5906799eead4d854cbf3503d7f14 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "build/build_config.h"
#include "content/public/common/content_features.h"
namespace features {
// All features in alphabetical order.
// Enables the allowActivationDelegation attribute on iframes.
const base::Feature kAllowActivationDelegationAttr{
"AllowActivationDelegationAttr", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables content-initiated, main frame navigations to data URLs.
// TODO(meacer): Remove when the deprecation is complete.
const base::Feature kAllowContentInitiatedDataUrlNavigations{
// Enables asm.js to WebAssembly V8 backend.
const base::Feature kAsmJsToWebAssembly{"AsmJsToWebAssembly",
// Enables async wheel events. Note that this feature depends on
// TouchpadAndWheelScrollLatching and enabling it when latching is disabled
// won't have any impacts.
const base::Feature kAsyncWheelEvents{"AsyncWheelEvents",
// Block subresource requests whose URLs contain embedded credentials (e.g.
// ``).
const base::Feature kBlockCredentialedSubresources{
"BlockCredentialedSubresources", base::FEATURE_ENABLED_BY_DEFAULT};
// Puts save-data header in the holdback mode. This disables sending of
// save-data header to origins, and to the renderer processes within Chrome.
const base::Feature kDataSaverHoldback{"DataSaverHoldback",
// Enables brotli "Accept-Encoding" advertising and "Content-Encoding" support.
// Brotli format specification:
const base::Feature kBrotliEncoding{"brotli-encoding",
// Browser side navigation (aka PlzNavigate) is using blob URLs to deliver
// the body of the main resource to the renderer process. When enabled, the
// NavigationMojoResponse feature replaces this mechanism by a Mojo DataPipe.
// Design doc:
const base::Feature kNavigationMojoResponse{"NavigationMojoResponse",
// If Canvas2D Image Chromium is allowed, this feature controls whether it is
// enabled.
const base::Feature kCanvas2DImageChromium {
#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
// Enabled decoding images asynchronously from raster in the renderer
// compositor.
const base::Feature kCheckerImaging{"CheckerImaging",
// Enables the compositing of fixed position content that is opaque and can
// preserve LCD text.
const base::Feature kCompositeOpaqueFixedPosition{
"CompositeOpaqueFixedPosition", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables the compositing of scrolling content that supports painting the
// background with the foreground, such that LCD text will still be enabled.
const base::Feature kCompositeOpaqueScrollers{"CompositeOpaqueScrollers",
const base::Feature kCompositorImageAnimation{
"CompositorImageAnimation", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables handling touch events in compositor using impl side touch action
// knowledge.
const base::Feature kCompositorTouchAction{"CompositorTouchAction",
// Enables blocking cross-site document responses (not paying attention to
// whether a site isolation mode is also enabled).
const base::Feature kCrossSiteDocumentBlockingAlways{
"CrossSiteDocumentBlockingAlways", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables blocking cross-site document responses if one of site isolation modes
// is (e.g. site-per-process or isolate-origins) is enabled.
const base::Feature kCrossSiteDocumentBlockingIfIsolating{
"CrossSiteDocumentBlockingIfIsolating", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables exposing back/forward mouse buttons to the renderer and the web.
const base::Feature kExtendedMouseButtons{"ExtendedMouseButtons",
// Throttle tasks in Blink background timer queues based on CPU budgets
// for the background tab. Bug:
const base::Feature kExpensiveBackgroundTimerThrottling{
"ExpensiveBackgroundTimerThrottling", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables the Feature Policy framework for granting and removing access to
// other features through HTTP headers.
const base::Feature kFeaturePolicy{"FeaturePolicy",
// Enables a blink::FontCache optimization that reuses a font to serve different
// size of font.
const base::Feature kFontCacheScaling{"FontCacheScaling",
// Enables a security restriction on iframes navigating their top frame.
// When enabled, the navigation will only be permitted if the iframe is
// same-origin to the top frame, or if a user gesture is being processed.
const base::Feature kFramebustingNeedsSameOriginOrUserGesture{
// Enables extended Gamepad API features like motion tracking and haptics.
const base::Feature kGamepadExtensions{"GamepadExtensions",
// Causes the implementations of guests (inner WebContents) to use
// out-of-process iframes.
const base::Feature kGuestViewCrossProcessFrames{
"GuestViewCrossProcessFrames", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables BlinkGC heap compaction.
const base::Feature kHeapCompaction{"HeapCompaction",
// Enable lazy initialization of the media controls.
const base::Feature kLazyInitializeMediaControls{
"LazyInitializeMediaControls", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables lazily parsing css properties for performance.
const base::Feature kLazyParseCSS{"LazyParseCSS",
// Enables lowering the priority of the resources in iframes.
const base::Feature kLowPriorityIframes{"LowPriorityIframes",
// If this feature is enabled, media-device enumerations use a cache that is
// invalidated upon notifications sent by base::SystemMonitor. If disabled, the
// cache is considered invalid on every enumeration request.
const base::Feature kMediaDevicesSystemMonitorCache{
#if defined(OS_MACOSX) || defined(OS_WIN)
// Enables the memory coordinator.
// The memory coordinator is not ready for use and enabling this may cause
// unexpected memory regression at this point. Please do not enable this.
const base::Feature kMemoryCoordinator {
"MemoryCoordinator", base::FEATURE_DISABLED_BY_DEFAULT
// Enables the network service.
const base::Feature kNetworkService{"NetworkService",
// If the network service is enabled, runs it in process.
const base::Feature kNetworkServiceInProcess{"NetworkServiceInProcess",
// Kill switch for Web Notification content images.
const base::Feature kNotificationContentImage{"NotificationContentImage",
// An experiment forcing events to be non-blocking when the main thread is
// deemed unresponsive. See
const base::Feature kMainThreadBusyScrollIntervention{
"MainThreadBusyScrollIntervention", base::FEATURE_DISABLED_BY_DEFAULT};
// Mojo-based Input Event routing.
const base::Feature kMojoInputMessages{"MojoInputMessages",
// Mojo-based Session Storage.
const base::Feature kMojoSessionStorage{"MojoSessionStorage",
// ES6 Modules dynamic imports.
const base::Feature kModuleScriptsDynamicImport{
"ModuleScriptsDynamicImport", base::FEATURE_ENABLED_BY_DEFAULT};
// ES6 Modules import.meta.url.
const base::Feature kModuleScriptsImportMetaUrl{
"ModuleScriptsImportMetaUrl", base::FEATURE_ENABLED_BY_DEFAULT};
// Use Mojo IPC for notifications.
const base::Feature kNotificationsWithMojo{"NotificationsWithMojo",
// Origin Manifest. See
const base::Feature kOriginManifest{"OriginManifest",
// Origin Trials for controlling access to feature/API experiments.
const base::Feature kOriginTrials{"OriginTrials",
// Out of Blink CORS
const base::Feature kOutOfBlinkCORS{"OutOfBlinkCORS",
// Whether a download can be handled by parallel jobs.
const base::Feature kParallelDownloading{
#if defined(OS_ANDROID)
// Whether document level event listeners should default 'passive' to true.
const base::Feature kPassiveDocumentEventListeners{
"PassiveDocumentEventListeners", base::FEATURE_ENABLED_BY_DEFAULT};
// Whether we should force a touchstart and first touchmove per scroll event
// listeners to be non-blocking during fling.
const base::Feature kPassiveEventListenersDueToFling{
"PassiveEventListenersDueToFling", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables Purge+Throttle on platforms except Android and MacOS.
// (Android) Purge+Throttle depends on TabManager, but TabManager doesn't
// support Android. Enable after Android is supported.
// (MacOS X) Enable after Purge+Throttle handles memory pressure signals
// send by OS correctly.
const base::Feature kPurgeAndSuspend {
#if defined(OS_MACOSX) || defined(OS_ANDROID)
// If Pepper 3D Image Chromium is allowed, this feature controls whether it is
// enabled.
const base::Feature kPepper3DImageChromium {
#if defined(OS_MACOSX)
// Generate V8 full code cache for PWAs.
const base::Feature kPWAFullCodeCache{"PWAFullCodeCache",
// Port some content::ResourceScheduler functionalities to renderer.
const base::Feature kRendererSideResourceScheduler{
"RendererSideResourceScheduler", base::FEATURE_DISABLED_BY_DEFAULT};
// Throttle Blink's rendering pipeline based on frame visibility.
const base::Feature kRenderingPipelineThrottling{
"RenderingPipelineThrottling", base::FEATURE_ENABLED_BY_DEFAULT};
// Collect renderer peak memory usage during page loads.
const base::Feature kReportRendererPeakMemoryStats{
"ReportRendererPeakMemoryStats", base::FEATURE_DISABLED_BY_DEFAULT};
// When loading CSS from a 'file:' URL, require a CSS-like file extension.
const base::Feature kRequireCSSExtensionForFile{
"RequireCSSExtensionForFile", base::FEATURE_ENABLED_BY_DEFAULT};
// Loading Dispatcher v0 support with ResourceLoadScheduler (
const base::Feature kResourceLoadScheduler{"ResourceLoadScheduler",
// Scrolls to compensate for layout movements (
const base::Feature kScrollAnchoring{"ScrollAnchoring",
// Save the scroll anchor and use it to restore scroll position.
const base::Feature kScrollAnchorSerialization{
"ScrollAnchorSerialization", base::FEATURE_DISABLED_BY_DEFAULT};
// Make sendBeacon throw for a Blob with a non simple type.
const base::Feature kSendBeaconThrowForBlobWithNonSimpleType{
// Service worker based payment apps as defined by w3c here:
const base::Feature kServiceWorkerPaymentApps{
"ServiceWorkerPaymentApps", base::FEATURE_DISABLED_BY_DEFAULT};
// Streaming installed scripts on starting service workers.
const base::Feature kServiceWorkerScriptStreaming{
"ServiceWorkerScriptStreaming", base::FEATURE_ENABLED_BY_DEFAULT};
// Generate V8 full code cache of service worker scripts.
const base::Feature kServiceWorkerScriptFullCodeCache{
"ServiceWorkerScriptFullCodeCache", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kSharedArrayBuffer{"SharedArrayBuffer",
// An experiment to require process isolation for the sign-in origin,
// Launch bug:
const base::Feature kSignInProcessIsolation{"sign-in-process-isolation",
// Alternative to switches::kSitePerProcess, for turning on full site isolation.
// Launch bug:
const base::Feature kSitePerProcess{"site-per-process",
// Paint invalidation based on slimming paint. See
const base::Feature kSlimmingPaintInvalidation{
"SlimmingPaintInvalidation", base::FEATURE_ENABLED_BY_DEFAULT};
// Stop scheduler task queues in background after allowed grace time.
const base::Feature kStopInBackground {
#if defined(OS_ANDROID)
// Stop loading tasks and loading of resources in background, on Android,
// after allowed grace time. Launch bug:
const base::Feature kStopLoadingInBackground{"stop-loading-in-background",
// Throttle Blink timers in out-of-view cross origin frames.
const base::Feature kTimerThrottlingForHiddenFrames{
"TimerThrottlingForHiddenFrames", base::FEATURE_ENABLED_BY_DEFAULT};
// An experimental simple user-activation model where the user gesture state is
// tracked through a frame-based state instead of the gesture tokens we use
// today.
const base::Feature kUserActivationV2{"UserActivationV2",
// Groups all out-of-process iframes to a different process from the process of
// the top document. This is a performance isolation mode. Launch bug:
const base::Feature kTopDocumentIsolation{"top-document-isolation",
// Enables touchpad and wheel scroll latching.
const base::Feature kTouchpadAndWheelScrollLatching{
"TouchpadAndWheelScrollLatching", base::FEATURE_ENABLED_BY_DEFAULT};
// An experiment to turn off compositing for 2D transform & opacity animations.
const base::Feature kTurnOff2DAndOpacityCompositorAnimations{
// Use Feature Policy to gate the use of permission features like midi,
// geolocation, camera, microphone, etc.
const base::Feature kUseFeaturePolicyForPermissions{
"UseFeaturePolicyForPermissions", base::FEATURE_ENABLED_BY_DEFAULT};
// Use MojoAudioInputIPC and RenderFrameAudioInputStreamFactory rather than
// AudioInputMessageFilter and AudioInputRendererHost.
const base::Feature kUseMojoAudioInputStreamFactory{
"UseMojoAudioInputStreamFactory", base::FEATURE_DISABLED_BY_DEFAULT};
// Use MojoAudioOutputIPC and RenderFrameAudioOutputStreamFactory rather than
// AudioMessageFilter and AudioRendererHost.
const base::Feature kUseMojoAudioOutputStreamFactory{
"UseMojoAudioOutputStreamFactory", base::FEATURE_DISABLED_BY_DEFAULT};
// Controls whether vibrate requires user gesture.
const base::Feature kVibrateRequiresUserGesture{
"VibrateRequiresUserGesture", base::FEATURE_ENABLED_BY_DEFAULT};
// Enable WebAssembly structured cloning.
const base::Feature kWebAssembly{"WebAssembly",
// Enable WebAssembly streamed compilation.
const base::Feature kWebAssemblyStreaming{"WebAssemblyStreaming",
// Enable WebAssembly streamed compilation.
const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler",
// Controls whether the WebAuthentication API is enabled:
const base::Feature kWebAuth{"WebAuthentication",
// If WebGL Image Chromium is allowed, this feature controls whether it is
// enabled.
const base::Feature kWebGLImageChromium{"WebGLImageChromium",
// The JavaScript API for payments on the web.
const base::Feature kWebPayments{"WebPayments",
// Makes WebRTC use ECDSA certs by default (i.e., when no cert type was
// specified in JS).
const base::Feature kWebRtcEcdsaDefault {"WebRTC-EnableWebRtcEcdsa",
// Use GpuMemoryBuffer backed VideoFrames in media streams.
const base::Feature kWebRtcUseGpuMemoryBufferVideoFrames{
// Enables HW H264 encoding on Android.
const base::Feature kWebRtcHWH264Encoding{
"WebRtcHWH264Encoding", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables HW VP8 encoding on Android.
const base::Feature kWebRtcHWVP8Encoding {
#if defined(OS_ANDROID)
// Fallback from hardware encoder (if available) to software, for WebRTC
// screensharing that uses temporal scalability.
const base::Feature kWebRtcScreenshareSwEncoding{
"WebRtcScreenshareSwEncoding", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables the WebRTC Echo Canceller version 3 (AEC3). Feature for
// This value is sent to WebRTC's echo canceller to
// toggle which echo canceller should be used.
const base::Feature kWebRtcUseEchoCanceller3{"WebRtcUseEchoCanceller3",
// Controls whether the WebUSB API is enabled:
const base::Feature kWebUsb{"WebUSB", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables/disables the Image Capture API.
const base::Feature kImageCaptureAPI{"ImageCaptureAPI",
// Alternative to switches::kIsolateOrigins, for turning on origin isolation.
// List of origins to isolate has to be specified via
// kIsolateOriginsFieldTrialParamName.
const base::Feature kIsolateOrigins{"IsolateOrigins",
const char kIsolateOriginsFieldTrialParamName[] = "OriginsList";
const base::Feature kKeepAliveRendererForKeepaliveRequests{
"KeepAliveRendererForKeepaliveRequests", base::FEATURE_ENABLED_BY_DEFAULT};
// Controls whether WebVR VSync-aligned render loop timing is enabled.
const base::Feature kWebVrVsyncAlign{"WebVrVsyncAlign",
// Controls whether the WebXR Device API is enabled.
const base::Feature kWebXr{"WebXR", base::FEATURE_DISABLED_BY_DEFAULT};
// Controls whether the orientation sensor based device is enabled.
const base::Feature kWebXrOrientationSensorDevice{
"WebXROrientationSensorDevice", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_ANDROID)
// Controls whether an override for the WebXR presentation render path is
// enabled. The param value specifies the requested specific render path. This
// is combined with a runtime capability check, the option is ignored if the
// requested render path is unsupported.
const base::Feature kWebXrRenderPath{"WebXrRenderPath",
const char kWebXrRenderPathParamName[] = "RenderPath";
const char kWebXrRenderPathParamValueClientWait[] = "ClientWait";
const char kWebXrRenderPathParamValueGpuFence[] = "GpuFence";
#endif // defined(OS_ANDROID)
// Enabled "work stealing" in the script runner.
const base::Feature kWorkStealingInScriptRunner{
"WorkStealingInScriptRunner", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_ANDROID)
// Autofill Accessibility in Android.
const base::Feature kAndroidAutofillAccessibility{
"AndroidAutofillAccessibility", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables hiding incorrectly-sized frames while in fullscreen.
const base::Feature kHideIncorrectlySizedFullscreenFrames{
"HideIncorrectlySizedFullscreenFrames", base::FEATURE_ENABLED_BY_DEFAULT};
// Controls whether the WebNFC API is enabled:
const base::Feature kWebNfc{"WebNFC", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // defined(OS_ANDROID)
#if defined(OS_MACOSX)
// Enables caching of media devices for the purpose of enumerating them.
const base::Feature kDeviceMonitorMac{"DeviceMonitorMac",
// The V2 sandbox on MacOS removes the unsandboed warmup phase and sandboxes the
// entire life of the process.
const base::Feature kMacV2Sandbox{"MacV2Sandbox",
#endif // defined(OS_MACOSX)
// Enables V8 background compilation
const base::Feature kV8BackgroundCompile{"V8BackgroundCompile",
// Enables to use a snapshot file in creating V8 contexts.
const base::Feature kV8ContextSnapshot{"V8ContextSnapshot",
// Enables future V8 VM features
const base::Feature kV8VmFuture{"V8VmFuture",
} // namespace features