From 21cecb02d1d1bd4eeb12755279dd0a762a145953 Mon Sep 17 00:00:00 2001 From: Alexander David Frick Date: Wed, 25 Jan 2023 02:39:15 -0600 Subject: [PATCH] Update features.cc --- src/third_party/blink/common/features.cc | 171 +++++++++++++++++++---- 1 file changed, 143 insertions(+), 28 deletions(-) diff --git a/src/third_party/blink/common/features.cc b/src/third_party/blink/common/features.cc index 5999852f..2d111fd5 100644 --- a/src/third_party/blink/common/features.cc +++ b/src/third_party/blink/common/features.cc @@ -25,6 +25,12 @@ BASE_FEATURE(kAnonymousIframeOriginTrial, "AnonymousIframeOriginTrial", base::FEATURE_ENABLED_BY_DEFAULT); +// Gate access to Attribution Reporting cross app and web APIs that allow +// registering with a native attribution API. +BASE_FEATURE(kAttributionReportingCrossAppWeb, + "AttributionReportingCrossAppWeb", + base::FEATURE_DISABLED_BY_DEFAULT); + // Apply lazy-loading to ad frames which have embeds likely impacting Core Web // Vitals. BASE_FEATURE(kAutomaticLazyFrameLoadingToAds, @@ -97,6 +103,16 @@ BASE_FEATURE(kBackForwardCacheDedicatedWorker, "BackForwardCacheDedicatedWorker", base::FEATURE_ENABLED_BY_DEFAULT); +BASE_FEATURE(kBackForwardCacheNotReachedOnJavaScriptExecution, + "BackForwardCacheNotReachedOnJavaScriptExecution", + base::FEATURE_DISABLED_BY_DEFAULT); + +// Allows pages with keepalive requests to stay eligible for the back/forward +// cache. See https://crbug.com/1347101 for more details. +BASE_FEATURE(kBackForwardCacheWithKeepaliveRequest, + "BackForwardCacheWithKeepaliveRequest", + base::FEATURE_ENABLED_BY_DEFAULT); + // Enable intervention for download that was initiated from or occurred in an ad // frame without user activation. BASE_FEATURE(kBlockingDownloadsInAdFrameWithoutUserActivation, @@ -310,6 +326,10 @@ BASE_FEATURE(kSameSiteCrossOriginForSpeculationRulesPrerender, "SameSiteCrossOriginForSpeculationRulesPrerender", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kSameSiteRedirectionForEmbedderTriggeredPrerender, + "SameSiteRedirectionForEmbedderTriggeredPrerender", + base::FEATURE_ENABLED_BY_DEFAULT); + BASE_FEATURE(kPrerender2SequentialPrerendering, "Prerender2SequentialPrerendering", base::FEATURE_DISABLED_BY_DEFAULT); @@ -544,6 +564,12 @@ BASE_FEATURE(kAudioWorkletThreadRealtimePriority, "AudioWorkletThreadRealtimePriority", base::FEATURE_ENABLED_BY_DEFAULT); +// A server-side switch for the output device (sink) selection in Web Audio API. +// This enables the selection via the AudioContext constructor and also via +// AudioContext.setSinkId() method. +BASE_FEATURE(kWebAudioSinkSelection, "kWebAudioSinkSelection", + base::FEATURE_ENABLED_BY_DEFAULT); + // A feature to reduce the set of resources fetched by No-State Prefetch. BASE_FEATURE(kLightweightNoStatePrefetch, "LightweightNoStatePrefetch", @@ -605,11 +631,27 @@ const base::FeatureParam kForceDarkForegroundLightnessThresholdParam{ const base::FeatureParam kForceDarkBackgroundLightnessThresholdParam{ &kForceWebContentsDarkMode, "background_lightness_threshold", -1}; +const base::FeatureParam::Option + forcedark_image_classifier_policy_options[] = { + {ForceDarkImageClassifier::kUseBlinkSettings, + "use_blink_settings_for_image_policy"}, + {ForceDarkImageClassifier::kNumColorsWithMlFallback, + "num_colors_with_ml_fallback"}, + {ForceDarkImageClassifier::kTransparencyAndNumColors, + "transparency_and_num_colors"}, +}; + +const base::FeatureParam + kForceDarkImageClassifierParam{&kForceWebContentsDarkMode, + "classifier_policy", + ForceDarkImageClassifier::kUseBlinkSettings, + &forcedark_image_classifier_policy_options}; + // Instructs WebRTC to honor the Min/Max Video Encode Accelerator dimensions. BASE_FEATURE(kWebRtcUseMinMaxVEADimensions, "WebRtcUseMinMaxVEADimensions", // TODO(crbug.com/1008491): enable other platforms. -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT @@ -681,12 +723,6 @@ BASE_FEATURE(kWebviewAccelerateSmallCanvases, "WebviewAccelerateSmallCanvases", base::FEATURE_DISABLED_BY_DEFAULT); -// Let accelerated canvases remain accelerated after readback -// (crbug.com/1288118) -BASE_FEATURE(kCanvas2dStaysGPUOnReadback, - "Canvas2dStaysGPUOnReadback", - base::FEATURE_DISABLED_BY_DEFAULT); - // When enabled, frees up CachedMetadata after consumption by script resources // and modules. Needed for the experiment in http://crbug.com/1045052. BASE_FEATURE(kDiscardCodeCacheAfterFirstUse, @@ -983,6 +1019,13 @@ const base::FeatureParam kBrowsingTopicsNumberOfTopTopicsPerEpoch{ // topic instead of one of the top topics. const base::FeatureParam kBrowsingTopicsUseRandomTopicProbabilityPercent{ &kBrowsingTopics, "use_random_topic_probability_percent", 5}; +// Maximum duration between when a epoch is calculated and when a site starts +// using that new epoch's topics. The time chosen is a per-site random point in +// time between [calculation time, calculation time + max duration). +const base::FeatureParam + kBrowsingTopicsMaxEpochIntroductionDelay{ + &kBrowsingTopics, "browsing_topics_max_epoch_introduction_delay", + base::Days(2)}; // How many epochs (weeks) of API usage data (i.e. topics observations) will be // based off for the filtering of topics for a calling context. const base::FeatureParam @@ -1009,9 +1052,10 @@ const base::FeatureParam kBrowsingTopicsMaxNumberOfApiUsageContextDomainsToStorePerPageLoad{ &kBrowsingTopics, "max_number_of_api_usage_context_domains_to_store_per_page_load", 30}; -// Encodes the configuration parameters above. Each version number should only -// be mapped to one configuration set. In practice, this can be guaranteed by -// always bumping up the version number whenever parameters are updated. +// Encodes the configuration parameters above. A version number can be used for +// multiple configurations as long as they are compatible (from both Chrome's +// and users/websites' perspective). For a configuration that's incompatible +// with previous ones, a new dedicated version number should be used. const base::FeatureParam kBrowsingTopicsConfigVersion{&kBrowsingTopics, "config_version", 1}; // The taxonomy version. This only affects the topics classification that occurs @@ -1292,11 +1336,6 @@ BASE_FEATURE(kDurableClientHintsCache, "DurableClientHintsCache", base::FEATURE_ENABLED_BY_DEFAULT); -// Allows sites to request fullscreen and open a popup from a single gesture. -BASE_FEATURE(kWindowPlacementFullscreenCompanionWindow, - "WindowPlacementFullscreenCompanionWindow", - base::FEATURE_ENABLED_BY_DEFAULT); - const base::FeatureParam kUserAgentFrozenBuildVersion{ &kReduceUserAgentMinorVersion, "build_version", "0"}; @@ -1309,9 +1348,10 @@ BASE_FEATURE(kReportFCPOnlyOnSuccessfulCommit, "ReportFCPOnlyOnSuccessfulCommit", base::FEATURE_DISABLED_BY_DEFAULT); +// TODO(crbug.com/1382005): Deprecate this flag. BASE_FEATURE(kRegionCaptureExperimentalSubtypes, "RegionCaptureExperimentalSubtypes", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kUserAgentOverrideExperiment, "UserAgentOverrideExperiment", @@ -1474,6 +1514,10 @@ BASE_FEATURE(kSelectiveInOrderScriptTarget, const base::FeatureParam kSelectiveInOrderScriptAllowList{ &kSelectiveInOrderScriptTarget, "allow_list", ""}; +BASE_FEATURE(kImageLoadingPrioritizationFix, + "ImageLoadingPrioritizationFix", + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kAllowSourceSwitchOnPausedVideoMediaStream, "AllowSourceSwitchOnPausedVideoMediaStream", base::FEATURE_ENABLED_BY_DEFAULT); @@ -1483,10 +1527,6 @@ BASE_FEATURE(kWebRtcExposeNonStandardStats, "WebRtc-ExposeNonStandardStats", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kSubstringSetTreeForAttributeBuckets, - "SubstringSetTreeForAttributeBuckets", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kInvalidationSetClassBloomFilter, "InvalidationSetClassBloomFilter", base::FEATURE_DISABLED_BY_DEFAULT); @@ -1575,17 +1615,13 @@ BASE_FEATURE(kWebRtcThreadsUseResourceEfficientType, "WebRtcThreadsUseResourceEfficientType", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kThrottleIntersectionObserverUMA, - "ThrottleIntersectionObserverUMA", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kWebRtcMetronome, "WebRtcMetronome", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kSyncAccessHandleAllSyncSurface, "SyncAccessHandleAllSyncSurface", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kNoCentralWebCacheLimitControl, "NoCentralWebCacheLimitControl", @@ -1599,9 +1635,15 @@ BASE_FEATURE(kProcessHtmlDataImmediately, "ProcessHtmlDataImmediately", base::FEATURE_DISABLED_BY_DEFAULT); +const base::FeatureParam kProcessHtmlDataImmediatelyChildFrame{ + &kProcessHtmlDataImmediately, "child", false}; + const base::FeatureParam kProcessHtmlDataImmediatelyFirstChunk{ &kProcessHtmlDataImmediately, "first", false}; +const base::FeatureParam kProcessHtmlDataImmediatelyMainFrame{ + &kProcessHtmlDataImmediately, "main", false}; + const base::FeatureParam kProcessHtmlDataImmediatelySubsequentChunks{ &kProcessHtmlDataImmediately, "rest", false}; @@ -1617,12 +1659,57 @@ BASE_FEATURE(kDocumentEventNodePathCaching, "DocumentEventNodePathCaching", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kNewBaseUrlInheritanceBehavior, + "NewBaseUrlInheritanceBehavior", + base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE(kNewGetDisplayMediaPickerOrder, + "NewGetDisplayMediaPickerOrder", + base::FEATURE_DISABLED_BY_DEFAULT); + +bool IsNewBaseUrlInheritanceBehaviorEnabled() { + // The kIsolateSandboxedIframes feature depends on the new base URL behavior, + // so it enables the new behavior even if kNewBaseUrlInheritanceBehavior + // isn't enabled. + return base::FeatureList::IsEnabled(kNewBaseUrlInheritanceBehavior) || + base::FeatureList::IsEnabled(kIsolateSandboxedIframes); +} + const base::FeatureParam kDocumentMaxEventNodePathCachedEntries{ &kDocumentEventNodePathCaching, "max-cache-entries", 10}; -BASE_FEATURE(kPostMessageDifferentPartitionSameOriginBlocked, - "PostMessageDifferentPartitionSameOriginBlocked", - base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE( + kPostMessageFirstPartyToThirdPartyDifferentBucketSameOriginBlocked, + "PostMessageFirstPartyToThirdPartyDifferentBucketSameOriginBlocked", + base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE( + kPostMessageFirstPartyToThirdPartyDifferentBucketSameOriginBlockedIfStorageIsPartitioned, + "PostMessageFirstPartyToThirdPartyDifferentBucketSameOriginBlockedIfStorage" + "IsPartitioned", + base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE( + kPostMessageThirdPartyToFirstPartyDifferentBucketSameOriginBlocked, + "PostMessageThirdPartyToFirstPartyDifferentBucketSameOriginBlocked", + base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE( + kPostMessageThirdPartyToFirstPartyDifferentBucketSameOriginBlockedIfStorageIsPartitioned, + "PostMessageThirdPartyToFirstPartyDifferentBucketSameOriginBlockedIfStorage" + "IsPartitioned", + base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE( + kPostMessageThirdPartyToThirdPartyDifferentBucketSameOriginBlocked, + "PostMessageThirdPartyToThirdPartyDifferentBucketSameOriginBlocked", + base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE( + kPostMessageThirdPartyToThirdPartyDifferentBucketSameOriginBlockedIfStorageIsPartitioned, + "PostMessageThirdPartyToThirdPartyDifferentBucketSameOriginBlockedIfStorage" + "IsPartitioned", + base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kWebRtcCombinedNetworkAndWorkerThread, "WebRtcCombinedNetworkAndWorkerThread", @@ -1646,5 +1733,33 @@ const base::FeatureParam IsolateSandboxedIframesGrouping::kPerSite, &isolated_sandboxed_iframes_grouping_types}; +BASE_FEATURE(kSSVTrailerWriteNewVersion, + "SSVTrailerWriteNewVersion", + base::FEATURE_ENABLED_BY_DEFAULT); + +BASE_FEATURE(kSSVTrailerWriteExposureAssertion, + "SSVTrailerWriteExposureAssertion", + base::FEATURE_ENABLED_BY_DEFAULT); + +BASE_FEATURE(kSSVTrailerEnforceExposureAssertion, + "SSVTrailerEnforceExposureAssertion", + base::FEATURE_ENABLED_BY_DEFAULT); + +BASE_FEATURE(kAbortSignalHandleBasedRemoval, + "AbortSignalHandleBasedRemoval", + base::FEATURE_ENABLED_BY_DEFAULT); + +BASE_FEATURE(kForceHighPerformanceGPUForWebGL, + "ForceHighPerformanceGPUForWebGL", + base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE(kSplitUserMediaQueues, + "SplitUserMediaQueues", + base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE(kTextCodecCJKEnabled, + "TextCodecCJKEnabled", + base::FEATURE_ENABLED_BY_DEFAULT); + } // namespace features } // namespace blink