From 0cd4451c956320556d67f4b35e89557d4cf8b390 Mon Sep 17 00:00:00 2001 From: Alexander Frick Date: Fri, 28 Apr 2023 08:44:54 -0500 Subject: [PATCH] M112 fixes --- args.gn | 2 +- infra/win_args.gn | 2 +- other/AVX2/win_AVX2_args.gn | 2 +- other/Mac/mac_ARM_args.gn | 2 +- other/Mac/mac_args.gn | 2 +- other/SSE2/win32_args.gn | 2 +- other/SSE3/args_SSE3.gn | 2 +- other/SSE3/win_SSE3_args.gn | 2 +- portable/THORIUM_SHELL.BAT | 2 +- src/chrome/BUILD.gn | 2 - .../blink/public/common/features.h | 1049 +++++++++++++++++ trunk.sh | 14 - 12 files changed, 1058 insertions(+), 25 deletions(-) create mode 100644 src/third_party/blink/public/common/features.h diff --git a/args.gn b/args.gn index 5c9864e5..b091db33 100644 --- a/args.gn +++ b/args.gn @@ -83,4 +83,4 @@ use_text_section_splitting = true use_thin_lto = true thin_lto_enable_optimizations = true chrome_pgo_phase = 2 -pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-linux-5563-1678034145-e17d94772da16841795631d49601fa0ba147f5bd.profdata" +pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-linux-5615-1680716428-db660f555b9c2dcd6bf2bfd641997c4064597b8e.profdata" diff --git a/infra/win_args.gn b/infra/win_args.gn index 9b91ded7..ad6a2f66 100644 --- a/infra/win_args.gn +++ b/infra/win_args.gn @@ -79,4 +79,4 @@ use_text_section_splitting = true use_thin_lto = true thin_lto_enable_optimizations = true chrome_pgo_phase = 2 -pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-win64-5414-1673458358-5348276ff887eb95bb837c1dd06e9efed673b8e4.profdata" +pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-win64-5615-1680716428-8e5dbcb72fb3956bfc18e684258d4a2c2c6a5be2.profdata" diff --git a/other/AVX2/win_AVX2_args.gn b/other/AVX2/win_AVX2_args.gn index 80948bd4..2275394f 100644 --- a/other/AVX2/win_AVX2_args.gn +++ b/other/AVX2/win_AVX2_args.gn @@ -79,4 +79,4 @@ use_text_section_splitting = true use_thin_lto = true thin_lto_enable_optimizations = true chrome_pgo_phase = 2 -pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-win64-5414-1673458358-5348276ff887eb95bb837c1dd06e9efed673b8e4.profdata" +pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-win64-5615-1680716428-8e5dbcb72fb3956bfc18e684258d4a2c2c6a5be2.profdata" diff --git a/other/Mac/mac_ARM_args.gn b/other/Mac/mac_ARM_args.gn index c42ea2b8..7cf0783c 100644 --- a/other/Mac/mac_ARM_args.gn +++ b/other/Mac/mac_ARM_args.gn @@ -84,4 +84,4 @@ use_text_section_splitting = true use_thin_lto = true thin_lto_enable_optimizations = true chrome_pgo_phase = 2 -pgo_data_path = "/Users/midzer/chromium/src/chrome/build/pgo_profiles/chrome-mac-main-1655466571-7d65938c5b97e550699896fed8a00e761848f383.profdata" +pgo_data_path = "/Users/midzer/chromium/src/chrome/build/pgo_profiles/chrome-mac-5615-1680716428-8877adc03a5d0bb84e4013376f29a0478b3097e2.profdata" diff --git a/other/Mac/mac_args.gn b/other/Mac/mac_args.gn index 6cbe19bd..8467c3d8 100644 --- a/other/Mac/mac_args.gn +++ b/other/Mac/mac_args.gn @@ -77,4 +77,4 @@ use_text_section_splitting = true use_thin_lto = true thin_lto_enable_optimizations = true chrome_pgo_phase = 2 -pgo_data_path = "/Users/midzer/chromium/src/chrome/build/pgo_profiles/chrome-mac-main-1655466571-7d65938c5b97e550699896fed8a00e761848f383.profdata" +pgo_data_path = "/Users/midzer/chromium/src/chrome/build/pgo_profiles/chrome-mac-5615-1680716428-8877adc03a5d0bb84e4013376f29a0478b3097e2.profdata" diff --git a/other/SSE2/win32_args.gn b/other/SSE2/win32_args.gn index 75183e04..6e5150a8 100644 --- a/other/SSE2/win32_args.gn +++ b/other/SSE2/win32_args.gn @@ -79,4 +79,4 @@ use_text_section_splitting = true use_thin_lto = true thin_lto_enable_optimizations = true chrome_pgo_phase = 2 -pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-win32-5414-1673458358-b2af8628736bc13fc9f5a65c47233e2eeaac20e9.profdata" +pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-win32-5615-1680716428-0b02c88261b2226e831a6aca86a6a14cce11afaa.profdata" diff --git a/other/SSE3/args_SSE3.gn b/other/SSE3/args_SSE3.gn index 437a914a..d0df00f5 100644 --- a/other/SSE3/args_SSE3.gn +++ b/other/SSE3/args_SSE3.gn @@ -83,4 +83,4 @@ use_text_section_splitting = true use_thin_lto = true thin_lto_enable_optimizations = true chrome_pgo_phase = 2 -pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-linux-5481-1675874756-8f0cc1ffc14aaa364c4901d505c8293825229435.profdata" +pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-linux-5615-1680716428-db660f555b9c2dcd6bf2bfd641997c4064597b8e.profdata" diff --git a/other/SSE3/win_SSE3_args.gn b/other/SSE3/win_SSE3_args.gn index 3c00dfbd..a58775de 100644 --- a/other/SSE3/win_SSE3_args.gn +++ b/other/SSE3/win_SSE3_args.gn @@ -79,4 +79,4 @@ use_text_section_splitting = true use_thin_lto = true thin_lto_enable_optimizations = true chrome_pgo_phase = 2 -pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-win64-5414-1673458358-5348276ff887eb95bb837c1dd06e9efed673b8e4.profdata" +pgo_data_path = "/home/alex/chromium/src/chrome/build/pgo_profiles/chrome-win64-5615-1680716428-8e5dbcb72fb3956bfc18e684258d4a2c2c6a5be2.profdata" diff --git a/portable/THORIUM_SHELL.BAT b/portable/THORIUM_SHELL.BAT index 7be4e898..78a4caf4 100644 --- a/portable/THORIUM_SHELL.BAT +++ b/portable/THORIUM_SHELL.BAT @@ -1 +1 @@ -START "" "%cd%\BIN\112.0.5615.165\thorium_shell.exe" --data-path="%~dp0%\USER_DATA\thorium_shell" --allow-outdated-plugins --disable-logging --disable-breakpad --enable-experimental-web-platform-features --new-canvas-2d-api +START "" "%cd%\BIN\112.0.5615.166\thorium_shell.exe" --data-path="%~dp0%\USER_DATA\thorium_shell" --allow-outdated-plugins --disable-logging --disable-breakpad --enable-experimental-web-platform-features --new-canvas-2d-api diff --git a/src/chrome/BUILD.gn b/src/chrome/BUILD.gn index 37d7ff18..e44f5689 100644 --- a/src/chrome/BUILD.gn +++ b/src/chrome/BUILD.gn @@ -344,8 +344,6 @@ if (!is_android && !is_mac) { "//ui/base", ] } - - configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] } if (is_chromeos_ash || is_win) { diff --git a/src/third_party/blink/public/common/features.h b/src/third_party/blink/public/common/features.h new file mode 100644 index 00000000..56182021 --- /dev/null +++ b/src/third_party/blink/public/common/features.h @@ -0,0 +1,1049 @@ +// Copyright 2023 The Chromium Authors and Alex313031 +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_FEATURES_H_ +#define THIRD_PARTY_BLINK_PUBLIC_COMMON_FEATURES_H_ + +#include "base/feature_list.h" +#include "base/metrics/field_trial_params.h" +#include "base/time/time.h" +#include "build/build_config.h" +#include "media/media_buildflags.h" +#include "third_party/blink/public/common/buildflags.h" +#include "third_party/blink/public/common/common_export.h" +#include "third_party/blink/public/common/features_generated.h" +#include "third_party/blink/public/common/forcedark/forcedark_switches.h" + +namespace blink { +namespace features { + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAnonymousIframeOriginTrial); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAttributionReportingCrossAppWeb); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAutomaticLazyFrameLoadingToAds); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kTimeoutMillisForLazyAds; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSkipFrameCountForLazyAds; +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAutomaticLazyFrameLoadingToEmbeds); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kTimeoutMillisForLazyEmbeds; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSkipFrameCountForLazyEmbeds; +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAutomaticLazyFrameLoadingToEmbedUrls); +enum class AutomaticLazyFrameLoadingToEmbedLoadingStrategy { + kAllowList, + kNonAds, +}; +BLINK_COMMON_EXPORT extern const base::FeatureParam< + AutomaticLazyFrameLoadingToEmbedLoadingStrategy> + kAutomaticLazyFrameLoadingToEmbedLoadingStrategyParam; +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBackForwardCacheDedicatedWorker); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kBackForwardCacheNotReachedOnJavaScriptExecution); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBackForwardCacheWithKeepaliveRequest); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBackgroundResourceFetch); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kBlockingDownloadsInAdFrameWithoutUserActivation); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kConversionMeasurement); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kExcludeLowEntropyImagesFromLCP); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kMinimumEntropyForLCP; +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kGMSCoreEmoji); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPaintHolding); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPaintHoldingCrossOrigin); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kEagerCacheStorageSetupForServiceWorkers); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kScriptStreaming); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSmallScriptStreaming); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kConsumeCodeCacheOffThread); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kUserLevelMemoryPressureSignal); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kFreezePurgeMemoryAllPagesFrozen); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kFrequencyCappingForOverlayPopupDetection); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kFrequencyCappingForLargeStickyAdDetection); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDisplayLocking); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kEditingNG); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kMixedContentAutoupgrade); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kNavigationPredictor); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAnchorElementInteraction); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kOSKResizesVisualViewportByDefault); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPlzDedicatedWorker); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPortalsCrossOrigin); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kFencedFrames); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kFullUserAgent); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPath2DPaintCache); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrivacySandboxAdsAPIs); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSharedStorageAPI); +// Maximum number of URLs allowed to be included in the input parameter for +// runURLSelectionOperation(). +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSharedStorageURLSelectionOperationInputURLSizeLimit; +// Maximum length of Shared Storage script key and script value. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kMaxSharedStorageStringLength; +// Maximum number of database entries at a time that any single origin is +// permitted. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kMaxSharedStorageEntriesPerOrigin; +// Maximum database page size in bytes. Must be a power of two between +// 512 and 65536, inclusive. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kMaxSharedStoragePageSize; +// Maximum database in-memory cache size, in pages. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kMaxSharedStorageCacheSize; +// Maximum number of tries to initialize the database. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kMaxSharedStorageInitTries; +// Maximum number of keys or key-value pairs returned in each batch by +// the async `keys()` and `entries()` iterators, respectively. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kMaxSharedStorageIteratorBatchSize; +// Maximum number of bits of entropy allowed per origin to output via the Shared +// Storage API. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSharedStorageBitBudget; +// Interval over which `kSharedStorageBitBudget` is defined. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSharedStorageBudgetInterval; +// Initial interval from service startup after which +// SharedStorageManager first checks for any stale entries, purging any that it +// finds. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSharedStorageStalePurgeInitialInterval; +// Second and subsequent intervals from service startup after +// which SharedStorageManager checks for any stale entries, purging any that it +// finds. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSharedStorageStalePurgeRecurringInterval; +// Length of time between last key write access and key expiration. When an +// entry's data is older than this threshold, it will be auto-purged. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSharedStorageStalenessThreshold; +// Maximum depth of fenced frame where sharedStorage.selectURL() is allowed to +// be invoked. The depth of a fenced frame is the number of the fenced frame +// boundaries above that frame (i.e. the outermost main frame's frame tree has +// fenced frame depth 0, a topmost fenced frame tree embedded in the outermost +// main frame has fenced frame depth 1, etc). +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSharedStorageMaxAllowedFencedFrameDepthForSelectURL; + +// If enabled, limits the number of times per origin per pageload that +// `sharedStorage.selectURL()` is allowed to be invoked. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSharedStorageSelectURLLimit); +// Maximum number of times per origin per pageload that +// `sharedStorage.selectURL()` is allowed to be invoked, if +// `kSharedStorageSelectURLLimit` is enabled. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSharedStorageMaxAllowedSelectURLCallsPerOriginPerPageLoad; + +// If enabled, limits the maximum bits of entropy per pageload that +// `fence.reportEvent()` is allowed to leak when called with +// `FencedFrame::ReportingDestination::kSharedStorageSelectUrl`. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSharedStorageReportEventLimit); +// Maximum number of bits of entropy per pageload that are allowed to leak via +// calls to `fence.reportEvent()` with +// `FencedFrame::ReportingDestination::kSharedStorageSelectUrl`, if +// `kSharedStorageReportEventLimit` is enabled. +BLINK_COMMON_EXPORT extern const base::FeatureParam + kSharedStorageReportEventBitBudgetPerPageLoad; + +// Enables the multiple prerendering in a sequential way: +// https://crbug.com/1355151 +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrerender2SequentialPrerendering); +// Enables the same-origin main frame navigation in a prerendered page. +// See https://crbug.com/1239281. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrerender2MainFrameNavigation); +// The number of prerenderings that can run concurrently. This only applies for +// prerenderings triggered by speculation rules. +BLINK_COMMON_EXPORT extern const char + kPrerender2MaxNumOfRunningSpeculationRules[]; +// Enables restrictions on how much memory is required on a device to use +// Prerender2. This is a separate feature from kPrerender2 so that the +// restrictions can be disabled entirely to allow bots to run the tests without +// needing to explicitly enable Prerender2, which some tests do not want to do +// because they want to test the default behavior. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrerender2MemoryControls); +// A field trial param that controls how much physical memory is required on a +// device to use Prerender2. If the device's physical memory does not exceed +// this value, pages will not be prerendered even when kPrerender2 is enabled. +BLINK_COMMON_EXPORT extern const char kPrerender2MemoryThresholdParamName[]; +// A field trial param that controls how much physical memory is allowed to be +// used by Chrome. If the current memory usage in Chrome exceeds this percent, +// pages will not be prerendered even when kPrerender2 is enabled. +BLINK_COMMON_EXPORT extern const char + kPrerender2MemoryAcceptablePercentOfSystemMemoryParamName[]; +// Enables to keep prerenderings alive in the background when their visibility +// state changes to HIDDEN. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrerender2InBackground); +// Enables to run prerendering for new tabs (e.g., target="_blank"). +// See https://crbug.com/1350676. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrerender2InNewTab); + +// Returns true if the Android On-Screen-Keyboard is in "resize visual +// viewport" mode. +BLINK_COMMON_EXPORT bool OSKResizesVisualViewportByDefault(); + +// Fenced Frames: +BLINK_COMMON_EXPORT bool IsFencedFramesEnabled(); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kPreviewsResourceLoadingHintsSpecificResourceTypes); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPurgeRendererMemoryWhenBackgrounded); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kRTCOfferExtmapAllowMixed); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kRTCGpuCodecSupportWaiter); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kRTCGpuCodecSupportWaiterTimeoutParam; +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kV8OptimizeWorkersForPerformance); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kWebMeasureMemoryViaPerformanceManager); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebRtcMultiplexCodec); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebRtcHideLocalIpsWithMdns); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebRtcIgnoreUnspecifiedColorSpace); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kIntensiveWakeUpThrottling); +BLINK_COMMON_EXPORT extern const char + kIntensiveWakeUpThrottling_GracePeriodSeconds_Name[]; +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kThrottleForegroundTimers); + +#if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebRtcH264WithOpenH264FFmpeg); +#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kResourceLoadViaDataPipe); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kServiceWorkerUpdateDelay); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kStopInBackground); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDropInputEventsBeforeFirstPaint); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDroppedTouchSequenceIncludesTouchEnd); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kFileHandlingIcons); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAllowSyncXHRInPageDismissal); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrefetchPrivacyChanges); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDecodeJpeg420ImagesToYUV); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDecodeLossyWebPImagesToYUV); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebFontsCacheAwareTimeoutAdaption); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAudioWorkletThreadRealtimePriority); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAudioSinkSelection); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kLightweightNoStatePrefetch); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSaveDataImgSrcset); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kForceWebContentsDarkMode); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kForceDarkInversionMethodParam; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kForceDarkImageBehaviorParam; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kForceDarkForegroundLightnessThresholdParam; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kForceDarkBackgroundLightnessThresholdParam; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kForceDarkImageClassifierParam; + +// Returns true when PlzDedicatedWorker is enabled. +BLINK_COMMON_EXPORT bool IsPlzDedicatedWorkerEnabled(); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebRtcUseMinMaxVEADimensions); + +// Blink garbage collection. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBlinkHeapCompaction); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBlinkHeapConcurrentMarking); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBlinkHeapConcurrentSweeping); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBlinkHeapIncrementalMarking); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBlinkHeapIncrementalMarkingStress); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSetLowPriorityForBeacon); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kCacheStorageCodeCacheHintHeader); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kCacheStorageCodeCacheHintHeaderName; + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDispatchBeforeUnloadOnFreeze); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kLowLatencyCanvas2dImageChromium); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebviewAccelerateSmallCanvases); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kCanvas2DHibernation); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kCanvasCompressHibernatedImage); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kCanvasFreeMemoryWhenHidden); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kCreateImageBitmapOrientationNone); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDiscardCodeCacheAfterFirstUse); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kCacheCodeOnIdle); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kCacheCodeOnIdleDelayParam; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kCacheCodeOnIdleDelayServiceWorkerOnlyParam; + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kProduceCompileHints); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kProduceCompileHintsOnIdleDelayParam; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kProduceCompileHintsNoiseLevel; + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kAlignFontDisplayAutoTimeoutWithLCPGoal); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kAlignFontDisplayAutoTimeoutWithLCPGoalTimeoutParam; +enum class AlignFontDisplayAutoTimeoutWithLCPGoalMode { + kToFailurePeriod, + kToSwapPeriod +}; +BLINK_COMMON_EXPORT extern const base::FeatureParam< + AlignFontDisplayAutoTimeoutWithLCPGoalMode> + kAlignFontDisplayAutoTimeoutWithLCPGoalModeParam; + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kThrottleInstallingServiceWorker); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kInstallingServiceWorkerOutstandingThrottledLimit; + +// 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. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kInputPredictorTypeChoice); + +// Enables resampling input events on main thread. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kResamplingInputEvents); + +// Elevates the InputTargetClient mojo interface to input, since its input +// blocking. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kInputTargetClientHighPriority); + +// Enables resampling GestureScroll events on compositor thread. +// Uses the kPredictorName* values in ui_base_features.h as the 'predictor' +// feature param. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kResamplingScrollEvents); + +// Enables filtering of predicted scroll events on compositor thread. +// Uses the kFilterName* values in ui_base_features.h as the 'filter' feature +// param. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kFilteringScrollPrediction); + +// Enables changing the influence of acceleration based on change of direction. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kKalmanHeuristics); + +// Enables discarding the prediction if the predicted direction is opposite from +// the current direction. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kKalmanDirectionCutOff); + +// Parameters for blink::features::kSkipTouchEventFilter. +// Which event types will be always forwarded is controlled by the "type" +// FeatureParam, which can be either "discrete" (default) or "all". +BLINK_COMMON_EXPORT +extern const char kSkipTouchEventFilterTypeParamName[]; +BLINK_COMMON_EXPORT +extern const char kSkipTouchEventFilterTypeParamValueDiscrete[]; +BLINK_COMMON_EXPORT +extern const char kSkipTouchEventFilterTypeParamValueAll[]; +BLINK_COMMON_EXPORT +extern const char kSkipTouchEventFilterFilteringProcessParamName[]; +BLINK_COMMON_EXPORT +extern const char kSkipTouchEventFilterFilteringProcessParamValueBrowser[]; +BLINK_COMMON_EXPORT +extern const char + kSkipTouchEventFilterFilteringProcessParamValueBrowserAndRenderer[]; + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kCompressParkableStrings); +BLINK_COMMON_EXPORT bool ParkableStringsUseSnappy(); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kUseSnappyForParkableStrings); +BLINK_COMMON_EXPORT bool IsParkableStringsToDiskEnabled(); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDelayFirstParkingOfStrings); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kReducedReferrerGranularity); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kContentCaptureConstantStreaming); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kCheckOfflineCapability); +enum class CheckOfflineCapabilityMode { + kWarnOnly, + kEnforce, +}; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kCheckOfflineCapabilityParam; + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPreferCompositingToLCDText); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kLogUnexpectedIPCPostedToBackForwardCachedDocuments); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAppEnableUrlHandlers); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAppEnableScopeExtensions); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAppManifestLockScreen); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAppBorderless); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kLoadingTasksUnfreezable); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kTargetBlankImpliesNoOpener); + +// Performs additional SubresourceFilter checks when CNAME aliases are found +// for the host of a requested URL. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kSendCnameAliasesToSubresourceFilterFromRenderer); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kScopeMemoryCachePerContext); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kEnablePenetratingImageSelection); + +// Used to configure a per-origin allowlist of performance.mark events that are +// permitted to be included in slow reports traces. See crbug.com/1181774. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBackgroundTracingPerformanceMark); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBackgroundTracingPerformanceMark_AllowList; + +// Main controls for ad serving API features. +// +// Backend storage + kill switch for Interest Group API origin trials. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kInterestGroupStorage); +// +BLINK_COMMON_EXPORT extern const base::FeatureParam + kInterestGroupStorageMaxOwners; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kInterestGroupStorageMaxGroupsPerOwner; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kInterestGroupStorageMaxOpsBeforeMaintenance; +// FLEDGE ad serving runtime flag/JS API. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kFledge); + +// Configures FLEDGE to consider k-anononymity. If both +// kFledgeConsiderKAnonymity and kFledgeEnforceKAnonymity are on it will be +// enforced; if only kFledgeConsiderKAnonymity is on it will be simulated. +// +// Turning on kFledgeEnforceKAnonymity alone does nothing. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kFledgeConsiderKAnonymity); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kFledgeEnforceKAnonymity); + +// Runtime flag that changes default Permissions Policy for features +// join-ad-interest-group and run-ad-auction to a more restricted EnableForSelf. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kAdInterestGroupAPIRestrictedPolicyByDefault); +// Debug reporting runtime flag/JS API. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBiddingAndScoringDebugReportingAPI); +// Enables URN URLs like those produced by FLEDGE auctions to be displayed by +// iframes (instead of requiring fenced frames). This is only intended to be +// enabled as part of the FLEDGE origin trial. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAllowURNsInIframes); + +// Returns true when Prerender2 feature is enabled. +BLINK_COMMON_EXPORT bool IsAllowURNsInIframeEnabled(); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBrowsingTopics); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsTimePeriodPerEpoch; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsNumberOfEpochsToExpose; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsNumberOfTopTopicsPerEpoch; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsUseRandomTopicProbabilityPercent; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsMaxEpochIntroductionDelay; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsNumberOfEpochsOfObservationDataToUseForFiltering; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsMaxNumberOfApiUsageContextDomainsToKeepPerTopic; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsMaxNumberOfApiUsageContextEntriesToLoadPerEpoch; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsMaxNumberOfApiUsageContextDomainsToStorePerPageLoad; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsConfigVersion; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kBrowsingTopicsTaxonomyVersion; +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kBrowsingTopicsBypassIPIsPubliclyRoutableCheck); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBrowsingTopicsXHR); + +// Uses page viewport instead of frame viewport in the Largest Contentful Paint +// heuristic where images occupying the full viewport are ignored. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kUsePageViewportInLCP); + +// When enabled, allow dropping alpha on media streams for rendering sinks if +// other sinks connected do not use alpha. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAllowDropAlphaForMediaStream); + +// Suppresses console errors for CORS problems which report an associated +// inspector issue anyway. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kCORSErrorsIssueOnly); + +// If enabled, the ResourceLoadScheculer will take the current network state +// into consideration, when it plans to delay a low-priority throttleable +// requests in the tight mode. The factors include: +// - The total number of the in-flight multiplexed connections (e.g., +// H2/SPDY/QUIC). +// - HTTP RTT estimate. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kDelayLowPriorityRequestsAccordingToNetworkState); + +// Number of the requests that can be handled in the tight mode. +BLINK_COMMON_EXPORT +extern const base::FeatureParam kMaxNumOfThrottleableRequestsInTightMode; + +// The HTTP RTT threshold: decide whether the +// `kDelayLowPriorityRequestsAccordingToNetworkState` feature can take effect +// practically according to the network connection state. +BLINK_COMMON_EXPORT +extern const base::FeatureParam kHttpRttThreshold; + +// The cost reduction for the multiplexed requests when +// `kDelayLowPriorityRequestsAccordingToNetworkState` is enabled. +BLINK_COMMON_EXPORT +extern const base::FeatureParam kCostReductionOfMultiplexedRequests; + +// If enabled, the major version number returned by Chrome will be locked at +// 99. The minor version number returned by Chrome will be forced to the +// value of the major version number. The purpose of this +// feature is a back up plan for if the major version moving from +// two to three digits breaks unexpected things. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + kForceMajorVersionInMinorPositionInUserAgent); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kClientHintsDeviceMemory); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kClientHintsDPR); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kClientHintsResourceWidth); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kClientHintsViewportWidth); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kClientHintsDeviceMemory_DEPRECATED); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kClientHintsDPR_DEPRECATED); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kClientHintsResourceWidth_DEPRECATED); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kClientHintsViewportWidth_DEPRECATED); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSetTimeoutWithoutClamp); +BLINK_COMMON_EXPORT bool IsSetTimeoutWithoutClampEnabled(); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kMaxUnthrottledTimeoutNestingLevel); +BLINK_COMMON_EXPORT extern const base::FeatureParam + kMaxUnthrottledTimeoutNestingLevelParam; +BLINK_COMMON_EXPORT void ClearUnthrottledNestedTimeoutOverrideCacheForTesting(); +BLINK_COMMON_EXPORT bool IsMaxUnthrottledTimeoutNestingLevelEnabled(); +BLINK_COMMON_EXPORT int GetMaxUnthrottledTimeoutNestingLevel(); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kLCPAnimatedImagesReporting); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kLCPVideoFirstFrame); + +// If enabled, an absent Origin-Agent-Cluster: header is interpreted as +// requesting an origin agent cluster, but in the same process. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kOriginAgentClusterDefaultEnabled); + +// This flag enables a console warning in cases where document.domain is set +// without origin agent clustering being explicitly disabled. +// (This is a transitory behaviour on the road to perma-enabling +// kOriginAgentClusterDefaultEnabled above.) +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kOriginAgentClusterDefaultWarning); + +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSystemColorChooser); + +// Disables forced frame updates for web tests. Used by web test runner only. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kNoForcedFrameUpdatesForWebTests); + +// If enabled, the client hints cache will be loaded on browser restarts. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDurableClientHintsCache); + +// A parameter for kReduceUserAgentMinorVersion; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kUserAgentFrozenBuildVersion; + +// Parameters for kReduceUserAgentPlatformOsCpu; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kAllExceptLegacyWindowsPlatform; +BLINK_COMMON_EXPORT extern const base::FeatureParam + kLegacyWindowsPlatform; + +// If enabled, we only report FCP if there’s a successful commit to the +// compositor. Otherwise, FCP may be reported if first BeginMainFrame results in +// a commit failure (see crbug.com/1257607). +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kReportFCPOnlyOnSuccessfulCommit); + +// If enabled, the `CropTarget.fromElement()` method will allow for the use +// of additional element tag tyeps, instead of just
and