blob: cb2213ea7e4a99905bf52e28e364e352fac9e5e4 [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 "content/public/common/content_features.h"
#include "build/build_config.h"
#if defined(OS_CHROMEOS)
#include "media/capture/video/chromeos/public/cros_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};
// Allows starting services without the browser process.
const base::Feature kAllowStartingServiceManagerOnly{
"AllowStartingServiceManagerOnly", 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{
// Accepts Origin-Signed HTTP Exchanges to be signed with certificates
// that do not have CanSignHttpExchangesDraft extension.
// TODO( Remove when certificates with
// CanSignHttpExchangesDraft extension are available from trusted CAs.
const base::Feature kAllowSignedHTTPExchangeCertsWithoutExtension{
// Creates audio output and input streams using the audio service.
const base::Feature kAudioServiceAudioStreams{
"AudioServiceAudioStreams", base::FEATURE_DISABLED_BY_DEFAULT};
// Launches the audio service on the browser startup.
const base::Feature kAudioServiceLaunchOnStartup{
"AudioServiceLaunchOnStartup", base::FEATURE_DISABLED_BY_DEFAULT};
// Runs the audio service in a separate process.
const base::Feature kAudioServiceOutOfProcess{
"AudioServiceOutOfProcess", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables await taking 1 tick on the microtask queue.
const base::Feature kAwaitOptimization{"AwaitOptimization",
// Kill switch for Background Fetch.
const base::Feature kBackgroundFetch{"BackgroundFetch",
// Enable using the BackForwardCache.
const base::Feature kBackForwardCache{"BackForwardCache",
// Enable incremental marking for Blink's heap managed by the Oilpan garbage
// collector.
const base::Feature kBlinkHeapIncrementalMarking{
"BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT};
// Enable unified garbage collection in Blink.
const base::Feature kBlinkHeapUnifiedGarbageCollection{
"BlinkHeapUnifiedGarbageCollection", base::FEATURE_DISABLED_BY_DEFAULT};
// Enable bloated renderer detection.
const base::Feature kBloatedRendererDetection{
"BloatedRendererDetection", base::FEATURE_DISABLED_BY_DEFAULT};
// Allows swipe left/right from touchpad change browser navigation. Currently
// only enabled by default on CrOS.
const base::Feature kTouchpadOverscrollHistoryNavigation {
#if defined(OS_CHROMEOS) || defined(OS_WIN)
// Block subresource requests whose URLs contain embedded credentials (e.g.
// ``).
const base::Feature kBlockCredentialedSubresources{
"BlockCredentialedSubresources", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables brotli "Accept-Encoding" advertising and "Content-Encoding" support.
// Brotli format specification:
const base::Feature kBrotliEncoding{"brotli-encoding",
// Enables code caching for inline scripts.
const base::Feature kCacheInlineScriptCode{"CacheInlineScriptCode",
// If Canvas2D Image Chromium is allowed, this feature controls whether it is
// enabled.
const base::Feature kCanvas2DImageChromium {
#if defined(OS_MACOSX)
// When CollectLiveNonNodeWrappers is enabled, live non-Node wrappers that are
// re-creatable will get collected by V8's minor garbage collector.
const base::Feature kCollectLiveNonNodeWrappers{
"CollectLiveNonNodeWrappers", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables the compositing of fixed position content that is opaque and can
// preserve LCD text.
const base::Feature kCompositeOpaqueFixedPosition{
"CompositeOpaqueFixedPosition", base::FEATURE_DISABLED_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",
// Enables crash reporting via Reporting API.
const base::Feature kCrashReporting{"CrashReporting",
// Enables specification of a target element in the fragment identifier
// via a CSS selector.
const base::Feature kCSSFragmentIdentifiers{"CSSFragmentIdentifiers",
// 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",
// Enable changing source dynamically for desktop capture.
const base::Feature kDesktopCaptureChangeSource{
"DesktopCaptureChangeSource", base::FEATURE_ENABLED_BY_DEFAULT};
// 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 exposing back/forward mouse buttons to the renderer and the web.
const base::Feature kExtendedMouseButtons{"ExtendedMouseButtons",
// Enables a blink::FontCache optimization that reuses a font to serve different
// size of font.
const base::Feature kFontCacheScaling{"FontCacheScaling",
// Enables fixes for matching src: local() for web fonts correctly against full
// font name or postscript name. Rolling out behind a flag, as enabling this
// enables a font indexer on Android which we need to test in the field first.
const base::Feature kFontSrcLocalMatching{"FontSrcLocalMatching",
// 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 freezing frame support based on feature policies.
const base::Feature kFreezeFramesOnVisibility{
"FreezeFramesOnVisibility", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kFreezePurgeMemoryBackgroundedOnly{
"FreezePurgeMemoryBackgroundedOnly", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables haptic vibration effects on supported gamepads.
const base::Feature kGamepadVibration{"GamepadVibration",
// Puts network quality estimate related Web APIs in the holdback mode. When the
// holdback is enabled the related Web APIs return network quality estimate
// set by the experiment (regardless of the actual quality).
const base::Feature kNetworkQualityEstimatorWebHoldback{
"NetworkQualityEstimatorWebHoldback", base::FEATURE_DISABLED_BY_DEFAULT};
// When WebXR Device API is enabled, exposes VR controllers as Gamepads and
// enables additional Gamepad attributes for use with WebXR Device API. Each
// XRInputSource will have a corresponding Gamepad instance.
const base::Feature kWebXrGamepadSupport{"WebXRGamepadSupport",
// Causes the implementations of guests (inner WebContents) to use
// out-of-process iframes.
// TODO(533069): Remove once BrowserPlugin is removed.
const base::Feature kGuestViewCrossProcessFrames{
"GuestViewCrossProcessFrames", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables BlinkGC heap compaction.
const base::Feature kHeapCompaction{"HeapCompaction",
// If a page does a client side redirect or adds to the history without a user
// gesture, then skip it on back/forward UI.
const base::Feature kHistoryManipulationIntervention{
"HistoryManipulationIntervention", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables/disables the Image Capture API.
const base::Feature kImageCaptureAPI{"ImageCaptureAPI",
// This flag is used to set field parameters to choose predictor we use when
// kResamplingInputEvents is disabled. It's used for gatherig accuracy metrics
// on finch and also for choosing predictor type for predictedEvents API without
// enabling resampling. It does not have any effect when the resampling flag is
// enabled.
const base::Feature kInputPredictorTypeChoice{
"InputPredictorTypeChoice", base::FEATURE_DISABLED_BY_DEFAULT};
// 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";
// Enables an API which allows websites to capture reserved keys in fullscreen.
// Defined by w3c here:
const base::Feature kKeyboardLockAPI{"KeyboardLockAPI",
const base::Feature kLayeredAPI{"LayeredAPI",
const base::Feature kLazyFrameLoading{"LazyFrameLoading",
const base::Feature kLazyFrameVisibleLoadTimeMetrics{
"LazyFrameVisibleLoadTimeMetrics", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kLazyImageLoading{"LazyImageLoading",
const base::Feature kLazyImageVisibleLoadTimeMetrics{
"LazyImageVisibleLoadTimeMetrics", base::FEATURE_DISABLED_BY_DEFAULT};
// Enable lazy initialization of the media controls.
const base::Feature kLazyInitializeMediaControls{
"LazyInitializeMediaControls", base::FEATURE_ENABLED_BY_DEFAULT};
// 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)
// Instead of BrowserPlugin or GuestViews, MimeHandlerView will use a cross
// process frame to render its handler.
const base::Feature kMimeHandlerViewInCrossProcessFrame{
"MimeHandlerViewInCrossProcessFrame", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables/disables the video capture service.
const base::Feature kMojoVideoCapture {
#if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_CHROMEOS)
// A secondary switch used in combination with kMojoVideoCapture.
// This is intended as a kill switch to allow disabling the service on
// particular groups of devices even if they forcibly enable kMojoVideoCapture
// via a command-line argument.
const base::Feature kMojoVideoCaptureSecondary{
"MojoVideoCaptureSecondary", base::FEATURE_ENABLED_BY_DEFAULT};
// 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",
// Origin Policy. See
const base::Feature kOriginPolicy{"OriginPolicy",
// Origin Trials for controlling access to feature/API experiments.
const base::Feature kOriginTrials{"OriginTrials",
// History navigation in response to horizontal overscroll (aka gesture-nav).
const base::Feature kOverscrollHistoryNavigation{
#if defined(OS_ANDROID)
// Blink PageLifecycle feature. See
const base::Feature kPageLifecycle{"PageLifecycle",
// Whether document level event listeners should default 'passive' to true.
const base::Feature kPassiveDocumentEventListeners{
"PassiveDocumentEventListeners", base::FEATURE_ENABLED_BY_DEFAULT};
// Whether document level wheel and mousewheel event listeners should default
// 'passive' to true.
const base::Feature kPassiveDocumentWheelEventListeners{
"PassiveDocumentWheelEventListeners", 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};
// Whether PaymentRequest exposes hasEnrolledInstrument API.
const base::Feature kPaymentRequestHasEnrolledInstrument = {
"PaymentRequestHasEnrolledInstrument", base::FEATURE_DISABLED_BY_DEFAULT};
// Whether PDF files should be rendered in diffent processes based on origin.
const base::Feature kPdfIsolation = {"PdfIsolation",
// Whether we should use the navigation_client mojo interface for navigations.
const base::Feature kPerNavigationMojoInterface = {
"PerNavigationMojoInterface", base::FEATURE_DISABLED_BY_DEFAULT};
// If Pepper 3D Image Chromium is allowed, this feature controls whether it is
// enabled.
const base::Feature kPepper3DImageChromium {
#if defined(OS_MACOSX)
// Whether cross-site frames should get their own SiteInstance even when
// strict site isolation is disabled. These SiteInstances will still be
// grouped into a shared default process based on BrowsingInstance.
const base::Feature kProcessSharingWithStrictSiteInstances{
"ProcessSharingWithStrictSiteInstances", base::FEATURE_DISABLED_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)
// Enable raster-inducing scroll.
const base::Feature kRasterInducingScroll{"RasterInducingScroll",
// Throttle Blink's rendering pipeline based on frame visibility.
const base::Feature kRenderingPipelineThrottling{
"RenderingPipelineThrottling", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables resampling input events on main thread.
const base::Feature kResamplingInputEvents{"ResamplingInputEvents",
// Loading Dispatcher v0 support with ResourceLoadScheduler (
const base::Feature kResourceLoadScheduler{"ResourceLoadScheduler",
// Run video capture service in the Browser process as opposed to a dedicated
// utility process
const base::Feature kRunVideoCaptureServiceInBrowserProcess{
// Save the scroll anchor and use it to restore scroll position.
const base::Feature kScrollAnchorSerialization{
"ScrollAnchorSerialization", base::FEATURE_ENABLED_BY_DEFAULT};
// Make sendBeacon throw for a Blob with a non simple type.
const base::Feature kSendBeaconThrowForBlobWithNonSimpleType{
const base::Feature kSecMetadata{"SecMetadata",
// Keep processes with service workers controlling clients from other
// processes at foreground priority. (
const base::Feature kServiceWorkerForegroundPriority{
"ServiceWorkerForegroundPriority", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables long running message dispatch for service workers.
// This is a temporary addition only to be used for the Android Messages
// integration with ChromeOS (
const base::Feature kServiceWorkerLongRunningMessage{
"ServiceWorkerLongRunningMessage", base::FEATURE_ENABLED_BY_DEFAULT};
// Service worker based payment apps as defined by w3c here:
const base::Feature kServiceWorkerPaymentApps{"ServiceWorkerPaymentApps",
const base::Feature kSharedArrayBuffer {
#if defined(OS_ANDROID)
// Signed Exchange Reporting for distributors
const base::Feature kSignedExchangeReportingForDistributors{
// Origin-Signed HTTP Exchanges (for WebPackage Loading)
const base::Feature kSignedHTTPExchange{"SignedHTTPExchange",
// Send "Accept: application/signed-exchange" header to origins who opt-in.
const base::Feature kSignedHTTPExchangeAcceptHeader{
"SignedHTTPExchangeAcceptHeader", base::FEATURE_DISABLED_BY_DEFAULT};
// Field trial parameter containing the list of origins that opted-in to receive
// "Accept: application/signed-exchange" header.
const char kSignedHTTPExchangeAcceptHeaderFieldTrialParamName[] = "OriginsList";
// Origin Trial of Origin-Signed HTTP Exchanges (for WebPackage Loading)
const base::Feature kSignedHTTPExchangeOriginTrial{
"SignedHTTPExchangeOriginTrial", base::FEATURE_ENABLED_BY_DEFAULT};
// Controls whether SpareRenderProcessHostManager tries to always have a warm
// spare renderer process around for the most recently requested BrowserContext.
// This feature is only consulted in site-per-process mode.
const base::Feature kSpareRendererForSitePerProcess{
"SpareRendererForSitePerProcess", base::FEATURE_ENABLED_BY_DEFAULT};
// Throttle Blink timers in out-of-view cross origin frames.
const base::Feature kTimerThrottlingForHiddenFrames{
"TimerThrottlingForHiddenFrames", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables async touchpad pinch zoom events. We check the ACK of the first
// synthetic wheel event in a pinch sequence, then send the rest of the
// synthetic wheel events of the pinch sequence as non-blocking if the first
// event’s ACK is not canceled.
const base::Feature kTouchpadAsyncPinchEvents{"TouchpadAsyncPinchEvents",
// Skips the browser touch event filter, ensuring that events that reach the
// queue and would otherwise be filtered out will instead be passed onto the
// renderer compositor process as long as the page hasn't timed out. Which event
// types will be always forwarded is controlled by the "type" FeatureParam,
// which can be either "discrete" (default) or "all".
const base::Feature kSkipBrowserTouchFilter{"SkipBrowserTouchFilter",
const char kSkipBrowserTouchFilterTypeParamName[] = "type";
const char kSkipBrowserTouchFilterTypeParamValueDiscrete[] = "discrete";
const char kSkipBrowserTouchFilterTypeParamValueAll[] = "all";
// Allows user activation propagation to all frames having the same origin as
// the activation notifier frame. This is an intermediate measure before we
// have an iframe attribute to declaratively allow user activation propagation
// to subframes.
const base::Feature kUserActivationSameOriginVisibility{
"UserActivationSameOriginVisibility", 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",
// An experimental replacement for the `User-Agent` header, defined in
const base::Feature kUserAgentClientHint{"UserAgentClientHint",
// Enables V8's low memory mode for subframes. This is used only
// in conjunction with the --site-per-process feature.
const base::Feature kV8LowMemoryModeForSubframes{
"V8LowMemoryModeForSubframes", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables to use the V8 Orinoco garbage collector.
const base::Feature kV8Orinoco{"V8Orinoco", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables future V8 VM features
const base::Feature kV8VmFuture{"V8VmFuture",
// Enable WebAssembly structured cloning.
const base::Feature kWebAssembly{"WebAssembly",
// Enable WebAssembly baseline compilation and tier up.
const base::Feature kWebAssemblyBaseline{"WebAssemblyBaseline",
// Enable WebAssembly threads.
const base::Feature kWebAssemblyThreads{"WebAssemblyThreads",
// Enable WebAssembly trap handler.
#if (defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MACOSX)) && \
const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler",
const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler",
// Controls whether the visibility of a WebContents can be OCCLUDED. When
// disabled, an occluded WebContents behaves exactly like a VISIBLE WebContents.
const base::Feature kWebContentsOcclusion {
#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
// Controls whether the WebAuthentication API is enabled:
const base::Feature kWebAuth{"WebAuthentication",
// Controls whether BLE authenticators can be used via the WebAuthentication
// API.
const base::Feature kWebAuthBle{"WebAuthenticationBle",
// Controls whether CTAP2 devices can communicate via the WebAuthentication API
// using pairingless BLE protocol.
const base::Feature kWebAuthCable {
#if defined(OS_LINUX)
// Controls whether AuthenticatorAttestationResponse contains a getTransports
// member to return the set of transports supported by an authenticator.
const base::Feature kWebAuthGetTransports{"WebAuthenticationGetTransports",
// If WebGL Image Chromium is allowed, this feature controls whether it is
// enabled.
const base::Feature kWebGLImageChromium{"WebGLImageChromium",
// Enable experimental policy-controlled features and LAPIs
const base::Feature kExperimentalProductivityFeatures{
"ExperimentalProductivityFeatures", base::FEATURE_DISABLED_BY_DEFAULT};
// 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",
// Enables HW H264 encoding on Android.
const base::Feature kWebRtcHWH264Encoding{"WebRtcHWH264Encoding",
// Enables HW VP8 encoding on Android.
const base::Feature kWebRtcHWVP8Encoding {
#if defined(OS_ANDROID)
// Enables HW VP9 encoding on Android.
const base::Feature kWebRtcHWVP9Encoding {
#if defined(OS_ANDROID)
// Enables negotiation of experimental multiplex codec in SDP.
const base::Feature kWebRtcMultiplexCodec{"WebRTC-MultiplexCodec",
// 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",
// Use GpuMemoryBuffer backed VideoFrames in media streams.
const base::Feature kWebRtcUseGpuMemoryBufferVideoFrames{
"WebRTC-UseGpuMemoryBufferVideoFrames", base::FEATURE_ENABLED_BY_DEFAULT};
// Causes WebRTC to replace host ICE candidate IP addresses with generated
// names ending in ".local" and resolve them using mDNS.
const base::Feature kWebRtcHideLocalIpsWithMdns{
"WebRtcHideLocalIpsWithMdns", base::FEATURE_DISABLED_BY_DEFAULT};
// Controls whether the WebUSB API is enabled:
const base::Feature kWebUsb{"WebUSB", 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};
// Enables access to raycasting against estimated XR scene geometry.
const base::Feature kWebXrHitTest{"WebXRHitTest",
// Controls whether the orientation sensor based device is enabled.
const base::Feature kWebXrOrientationSensorDevice {
#if defined(OS_ANDROID)
// Wipe corrupt v2 IndexedDB databases.
const base::Feature kWipeCorruptV2IDBDatabases{
"WipeCorruptV2IDBDatabases", base::FEATURE_ENABLED_BY_DEFAULT};
// Enabled scheduler use for script streaming.
const base::Feature kScheduledScriptStreaming{"ScheduledScriptStreaming",
// Start streaming scripts on script preload.
const base::Feature kScriptStreamingOnPreload{
"ScriptStreamingOnPreload", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_ANDROID)
// Autofill Accessibility in Android.
const base::Feature kAndroidAutofillAccessibility{
"AndroidAutofillAccessibility", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables developers to use the CSS safe-area-* and viewport-fit APIs which
// allow them to support devices with a display cutout.
const base::Feature kDisplayCutoutAPI{"DisplayCutoutAPI",
// Enables hiding incorrectly-sized frames while in fullscreen.
const base::Feature kHideIncorrectlySizedFullscreenFrames{
"HideIncorrectlySizedFullscreenFrames", base::FEATURE_ENABLED_BY_DEFAULT};
// Sets moderate binding to background renderers playing media, when enabled.
// Else the renderer will have strong binding.
const base::Feature kBackgroundMediaRendererHasModerateBinding{
// Controls whether the WebNFC API is enabled:
const base::Feature kWebNfc{"WebNFC", base::FEATURE_DISABLED_BY_DEFAULT};
// 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";
const char kWebXrRenderPathParamValueSharedBuffer[] = "SharedBuffer";
#endif // defined(OS_ANDROID)
#if !defined(OS_ANDROID)
// Makes all WebUI that uses Polymer use 2.x version.
// TODO(dpapad): Remove this once Polymer 2 migration is done,
const base::Feature kWebUIPolymer2{"WebUIPolymer2",
#endif // !defined(OS_ANDROID)
#if defined(OS_CHROMEOS)
// If this flag is enabled, Web UI pages can call DisablePolymer2() on the
// shared resource during setup in order to use Polymer 1, regardless of the
// state of the WebUIPolymer2 flag. Note: Currently, this only supports one Web
// UI page disabling Polymer 2.
// TODO(dpapad): Remove this once Polymer 2 migration is done,
const base::Feature kWebUIPolymer2Exceptions{"WebUIPolymer2Exceptions",
#endif // defined(OS_CHROMEOS)
#if defined(OS_MACOSX)
// Enables caching of media devices for the purpose of enumerating them.
const base::Feature kDeviceMonitorMac{"DeviceMonitorMac",
// Enable IOSurface based screen capturer.
const base::Feature kIOSurfaceCapturer{"IOSurfaceCapturer",
const base::Feature kMacV2GPUSandbox{"MacV2GPUSandbox",
#endif // defined(OS_MACOSX)
// Controls whether the PipeWire support for screen capturing is enabled on the
// Wayland display server.
const base::Feature kWebRtcPipeWireCapturer{"WebRTCPipeWireCapturer",
#endif // defined(WEBRTC_USE_PIPEWIRE)
enum class VideoCaptureServiceConfiguration {
bool ShouldEnableVideoCaptureService() {
return base::FeatureList::IsEnabled(features::kMojoVideoCapture) &&
VideoCaptureServiceConfiguration GetVideoCaptureServiceConfiguration() {
if (!ShouldEnableVideoCaptureService())
return VideoCaptureServiceConfiguration::kDisabled;
#if defined(OS_ANDROID)
return VideoCaptureServiceConfiguration::kEnabledForBrowserProcess;
#elif defined(OS_CHROMEOS)
return media::ShouldUseCrosCameraService()
? VideoCaptureServiceConfiguration::kEnabledForBrowserProcess
: VideoCaptureServiceConfiguration::kEnabledForOutOfProcess;
return base::FeatureList::IsEnabled(
? VideoCaptureServiceConfiguration::kEnabledForBrowserProcess
: VideoCaptureServiceConfiguration::kEnabledForOutOfProcess;
bool IsVideoCaptureServiceEnabledForOutOfProcess() {
return GetVideoCaptureServiceConfiguration() ==
bool IsVideoCaptureServiceEnabledForBrowserProcess() {
return GetVideoCaptureServiceConfiguration() ==
} // namespace features