// Copyright 2018 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "net/base/features.h" #include #include "base/feature_list.h" #include "build/build_config.h" #include "net/base/cronet_buildflags.h" #include "net/net_buildflags.h" namespace net::features { BASE_FEATURE(kAlpsForHttp2, "AlpsForHttp2", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kAvoidH2Reprioritization, "AvoidH2Reprioritization", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kCapReferrerToOriginOnCrossOrigin, "CapReferrerToOriginOnCrossOrigin", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kAsyncDns, "AsyncDns", #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) || \ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT #endif ); BASE_FEATURE(kDnsTransactionDynamicTimeouts, "DnsTransactionDynamicTimeouts", base::FEATURE_DISABLED_BY_DEFAULT); const base::FeatureParam kDnsTransactionTimeoutMultiplier{ &kDnsTransactionDynamicTimeouts, "DnsTransactionTimeoutMultiplier", 7.5}; const base::FeatureParam kDnsMinTransactionTimeout{ &kDnsTransactionDynamicTimeouts, "DnsMinTransactionTimeout", base::Seconds(12)}; BASE_FEATURE(kUseDnsHttpsSvcb, "UseDnsHttpsSvcb", base::FEATURE_ENABLED_BY_DEFAULT); const base::FeatureParam kUseDnsHttpsSvcbEnforceSecureResponse{ &kUseDnsHttpsSvcb, "UseDnsHttpsSvcbEnforceSecureResponse", false}; const base::FeatureParam kUseDnsHttpsSvcbInsecureExtraTimeMax{ &kUseDnsHttpsSvcb, "UseDnsHttpsSvcbInsecureExtraTimeMax", base::Milliseconds(50)}; const base::FeatureParam kUseDnsHttpsSvcbInsecureExtraTimePercent{ &kUseDnsHttpsSvcb, "UseDnsHttpsSvcbInsecureExtraTimePercent", 20}; const base::FeatureParam kUseDnsHttpsSvcbInsecureExtraTimeMin{ &kUseDnsHttpsSvcb, "UseDnsHttpsSvcbInsecureExtraTimeMin", base::Milliseconds(5)}; const base::FeatureParam kUseDnsHttpsSvcbSecureExtraTimeMax{ &kUseDnsHttpsSvcb, "UseDnsHttpsSvcbSecureExtraTimeMax", base::Milliseconds(50)}; const base::FeatureParam kUseDnsHttpsSvcbSecureExtraTimePercent{ &kUseDnsHttpsSvcb, "UseDnsHttpsSvcbSecureExtraTimePercent", 20}; const base::FeatureParam kUseDnsHttpsSvcbSecureExtraTimeMin{ &kUseDnsHttpsSvcb, "UseDnsHttpsSvcbSecureExtraTimeMin", base::Milliseconds(5)}; BASE_FEATURE(kUseDnsHttpsSvcbAlpn, "UseDnsHttpsSvcbAlpn", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kUseHostResolverCache, "UseHostResolverCache", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kUseServiceEndpointRequest, "UseServiceEndpointRequest", base::FEATURE_DISABLED_BY_DEFAULT); const base::FeatureParam kAlternativePortForGloballyReachableCheck{ &kUseAlternativePortForGloballyReachableCheck, "AlternativePortForGloballyReachableCheck", 443}; BASE_FEATURE(kUseAlternativePortForGloballyReachableCheck, "UseAlternativePortForGloballyReachableCheck", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kEnableIPv6ReachabilityOverride, "EnableIPv6ReachabilityOverride", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kEnableTLS13EarlyData, "EnableTLS13EarlyData", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kNetworkQualityEstimator, "NetworkQualityEstimator", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kSplitCacheByIncludeCredentials, "SplitCacheByIncludeCredentials", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kSplitCacheByNetworkIsolationKey, "SplitCacheByNetworkIsolationKey", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kSplitCodeCacheByNetworkIsolationKey, "SplitCodeCacheByNetworkIsolationKey", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kPartitionConnectionsByNetworkIsolationKey, "PartitionConnectionsByNetworkIsolationKey", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kEnableCrossSiteFlagNetworkIsolationKey, "EnableCrossSiteFlagNetworkIsolationKey", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kEnableFrameSiteSharedOpaqueNetworkIsolationKey, "EnableFrameSiteSharedOpaqueNetworkIsolationKey", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kHttpCacheKeyingExperimentControlGroup, "HttpCacheKeyingExperimentControlGroup", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kTLS13KeyUpdate, "TLS13KeyUpdate", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kPostQuantumKyber, "PostQuantumKyber", #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) base::FEATURE_DISABLED_BY_DEFAULT); #else base::FEATURE_ENABLED_BY_DEFAULT); #endif BASE_FEATURE(kNetUnusedIdleSocketTimeout, "NetUnusedIdleSocketTimeout", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kShortLaxAllowUnsafeThreshold, "ShortLaxAllowUnsafeThreshold", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kSameSiteDefaultChecksMethodRigorously, "SameSiteDefaultChecksMethodRigorously", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kTurnOffStreamingMediaCachingOnBattery, "TurnOffStreamingMediaCachingOnBattery", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kTurnOffStreamingMediaCachingAlways, "TurnOffStreamingMediaCachingAlways", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kSchemefulSameSite, "SchemefulSameSite", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kLimitOpenUDPSockets, "LimitOpenUDPSockets", base::FEATURE_ENABLED_BY_DEFAULT); extern const base::FeatureParam kLimitOpenUDPSocketsMax( &kLimitOpenUDPSockets, "LimitOpenUDPSocketsMax", 6000); BASE_FEATURE(kTimeoutTcpConnectAttempt, "TimeoutTcpConnectAttempt", base::FEATURE_DISABLED_BY_DEFAULT); extern const base::FeatureParam kTimeoutTcpConnectAttemptRTTMultiplier( &kTimeoutTcpConnectAttempt, "TimeoutTcpConnectAttemptRTTMultiplier", 5.0); extern const base::FeatureParam kTimeoutTcpConnectAttemptMin( &kTimeoutTcpConnectAttempt, "TimeoutTcpConnectAttemptMin", base::Seconds(8)); extern const base::FeatureParam kTimeoutTcpConnectAttemptMax( &kTimeoutTcpConnectAttempt, "TimeoutTcpConnectAttemptMax", base::Seconds(30)); #if BUILDFLAG(ENABLE_REPORTING) BASE_FEATURE(kDocumentReporting, "DocumentReporting", base::FEATURE_ENABLED_BY_DEFAULT); #endif // BUILDFLAG(ENABLE_REPORTING) BASE_FEATURE(kCookieSameSiteConsidersRedirectChain, "CookieSameSiteConsidersRedirectChain", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kWaitForFirstPartySetsInit, "WaitForFirstPartySetsInit", base::FEATURE_DISABLED_BY_DEFAULT); // Controls the maximum time duration an outermost frame navigation should be // deferred by RWS initialization. extern const base::FeatureParam kWaitForFirstPartySetsInitNavigationThrottleTimeout{ &kWaitForFirstPartySetsInit, "kWaitForFirstPartySetsInitNavigationThrottleTimeout", base::Seconds(0)}; BASE_FEATURE(kAncestorChainBitEnabledInPartitionedCookies, "AncestorChainBitEnabledInPartitionedCookies", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kStaticKeyPinningEnforcement, "StaticKeyPinningEnforcement", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kCookieDomainRejectNonASCII, "CookieDomainRejectNonASCII", base::FEATURE_DISABLED_BY_DEFAULT); // Enables partitioning of third party storage (IndexedDB, CacheStorage, etc.) // by the top level site to reduce fingerprinting. BASE_FEATURE(kThirdPartyStoragePartitioning, "ThirdPartyStoragePartitioning", base::FEATURE_ENABLED_BY_DEFAULT); // Whether to use the new code paths needed to support partitioning Blob URLs. // This exists as a kill-switch in case an issue is identified with the Blob // URL implementation that causes breakage. BASE_FEATURE(kSupportPartitionedBlobUrl, "SupportPartitionedBlobUrl", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kTopLevelTpcdOriginTrial, "TopLevelTpcdOriginTrial", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kTpcdTrialSettings, "TpcdSupportSettings", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kTopLevelTpcdTrialSettings, "TopLevelTpcdSupportSettings", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kTpcdMetadataGrants, "TpcdMetadataGrants", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kTpcdMetadataStageControl, "TpcdMetadataStageControl", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kAlpsParsing, "AlpsParsing", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kAlpsClientHintParsing, "AlpsClientHintParsing", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kShouldKillSessionOnAcceptChMalformed, "ShouldKillSessionOnAcceptChMalformed", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kCaseInsensitiveCookiePrefix, "CaseInsensitiveCookiePrefix", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kEnableWebsocketsOverHttp3, "EnableWebsocketsOverHttp3", base::FEATURE_DISABLED_BY_DEFAULT); #if BUILDFLAG(IS_WIN) // Disabled because of https://crbug.com/1489696. BASE_FEATURE(kEnableGetNetworkConnectivityHintAPI, "EnableGetNetworkConnectivityHintAPI", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kEnableTcpPortRandomization, "EnableTcpPortRandomization", base::FEATURE_DISABLED_BY_DEFAULT); #endif BASE_FEATURE(kAvoidEntryCreationForNoStore, "AvoidEntryCreationForNoStore", base::FEATURE_DISABLED_BY_DEFAULT); const base::FeatureParam kAvoidEntryCreationForNoStoreCacheSize{ &kAvoidEntryCreationForNoStore, "AvoidEntryCreationForNoStoreCacheSize", 1000}; // Prefetch to follow normal semantics instead of 5-minute rule // https://crbug.com/1345207 BASE_FEATURE(kPrefetchFollowsNormalCacheSemantics, "PrefetchFollowsNormalCacheSemantics", base::FEATURE_DISABLED_BY_DEFAULT); // A flag for new Kerberos feature, that suggests new UI // when Kerberos authentication in browser fails on ChromeOS. // b/260522530 #if BUILDFLAG(IS_CHROMEOS) BASE_FEATURE(kKerberosInBrowserRedirect, "KerberosInBrowserRedirect", base::FEATURE_ENABLED_BY_DEFAULT); #endif // A flag to use asynchronous session creation for new QUIC sessions. BASE_FEATURE(kAsyncQuicSession, "AsyncQuicSession", #if BUILDFLAG(IS_WIN) base::FEATURE_ENABLED_BY_DEFAULT); #else base::FEATURE_DISABLED_BY_DEFAULT); #endif // A flag to make multiport context creation asynchronous. BASE_FEATURE(kAsyncMultiPortPath, "AsyncMultiPortPath", #if !BUILDFLAG(CRONET_BUILD) && (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)) base::FEATURE_ENABLED_BY_DEFAULT); #else base::FEATURE_DISABLED_BY_DEFAULT); #endif // IP protection experiment configuration settings BASE_FEATURE(kEnableIpProtectionProxy, "EnableIpPrivacyProxy", base::FEATURE_DISABLED_BY_DEFAULT); const base::FeatureParam kIpPrivacyTokenServer{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyTokenServer", /*default_value=*/"https://phosphor-pa.googleapis.com"}; const base::FeatureParam kIpPrivacyTokenServerGetInitialDataPath{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyTokenServerGetInitialDataPath", /*default_value=*/"/v1/ipblinding/getInitialData"}; const base::FeatureParam kIpPrivacyTokenServerGetTokensPath{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyTokenServerGetTokensPath", /*default_value=*/"/v1/ipblinding/auth"}; const base::FeatureParam kIpPrivacyTokenServerGetProxyConfigPath{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyTokenServerGetProxyConfigPath", /*default_value=*/"/v1/ipblinding/getProxyConfig"}; const base::FeatureParam kIpPrivacyAuthTokenCacheBatchSize{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyAuthTokenCacheBatchSize", /*default_value=*/64}; const base::FeatureParam kIpPrivacyAuthTokenCacheLowWaterMark{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyAuthTokenCacheLowWaterMark", /*default_value=*/16}; const base::FeatureParam kIpPrivacyProxyListFetchInterval{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyProxyListFetchInterval", /*default_value=*/base::Hours(1)}; const base::FeatureParam kIpPrivacyProxyListMinFetchInterval{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyProxyMinListFetchInterval", /*default_value=*/base::Minutes(1)}; const base::FeatureParam kIpPrivacyDirectOnly{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyDirectOnly", /*default_value=*/false}; const base::FeatureParam kIpPrivacyIncludeOAuthTokenInGetProxyConfig{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyIncludeOAuthTokenInGetProxyConfig", /*default_value=*/false}; const base::FeatureParam kIpPrivacyProxyAHostnameOverride{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyProxyAHostnameOverride", /*default_value=*/""}; const base::FeatureParam kIpPrivacyProxyBHostnameOverride{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyProxyBHostnameOverride", /*default_value=*/""}; const base::FeatureParam kIpPrivacyAddHeaderToProxiedRequests{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyAddHeaderToProxiedRequests", /*default_value=*/false}; const base::FeatureParam kIpPrivacyExpirationFuzz{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyExpirationFuzz", /*default_value=*/base::Minutes(15)}; const base::FeatureParam kIpPrivacyRestrictTopLevelSiteSchemes{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyRestrictTopLevelSiteSchemes", /*default_value=*/true}; const base::FeatureParam kIpPrivacyUseQuicProxies{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyUseQuicProxies", /*default_value=*/false}; const base::FeatureParam kIpPrivacyUseQuicProxiesOnly{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyUseQuicProxiesOnly", /*default_value=*/false}; const base::FeatureParam kIpPrivacyUseSingleProxy{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyUseSingleProxy", /*default_value=*/false}; const base::FeatureParam kIpPrivacyAlwaysProxy{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyAlwaysProxy", /*default_value=*/""}; const base::FeatureParam kIpPrivacyFallbackToDirect{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyFallbackToDirect", /*default_value=*/true}; const base::FeatureParam kIpPrivacyDebugExperimentArm{ &kEnableIpProtectionProxy, /*name=*/"IpPrivacyDebugExperimentArm", /*default_value=*/0}; // Network-change migration requires NetworkHandle support, which are currently // only supported on Android (see // NetworkChangeNotifier::AreNetworkHandlesSupported). #if BUILDFLAG(IS_ANDROID) inline constexpr auto kMigrateSessionsOnNetworkChangeV2Default = base::FEATURE_ENABLED_BY_DEFAULT; #else // !BUILDFLAG(IS_ANDROID) inline constexpr auto kMigrateSessionsOnNetworkChangeV2Default = base::FEATURE_DISABLED_BY_DEFAULT; #endif // BUILDFLAG(IS_ANDROID) BASE_FEATURE(kMigrateSessionsOnNetworkChangeV2, "MigrateSessionsOnNetworkChangeV2", kMigrateSessionsOnNetworkChangeV2Default); BASE_FEATURE(kDisableBlackholeOnNoNewNetwork, "DisableBlackHoleOnNoNewNetwork", base::FEATURE_DISABLED_BY_DEFAULT); #if BUILDFLAG(IS_LINUX) BASE_FEATURE(kAddressTrackerLinuxIsProxied, "AddressTrackerLinuxIsProxied", base::FEATURE_ENABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_LINUX) // Enables binding of cookies to the port that originally set them by default. BASE_FEATURE(kEnablePortBoundCookies, "EnablePortBoundCookies", base::FEATURE_DISABLED_BY_DEFAULT); // Enables binding of cookies to the scheme that originally set them. NET_EXPORT BASE_DECLARE_FEATURE(kEnableSchemeBoundCookies); BASE_FEATURE(kEnableSchemeBoundCookies, "EnableSchemeBoundCookies", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kTimeLimitedInsecureCookies, "TimeLimitedInsecureCookies", base::FEATURE_DISABLED_BY_DEFAULT); // Enable third-party cookie blocking from the command line. BASE_FEATURE(kForceThirdPartyCookieBlocking, "ForceThirdPartyCookieBlockingEnabled", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kThirdPartyCookieTopLevelSiteCorsException, "ThirdPartyCookieTopLevelSiteCorsException", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kEnableEarlyHintsOnHttp11, "EnableEarlyHintsOnHttp11", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kEnableWebTransportDraft07, "EnableWebTransportDraft07", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kZstdContentEncoding, "ZstdContentEncoding", base::FEATURE_ENABLED_BY_DEFAULT); // When enabled, partitioned storage will be allowed even if third-party cookies // are disabled by default. Partitioned storage will not be allowed if // third-party cookies are disabled due to a specific rule. BASE_FEATURE(kThirdPartyPartitionedStorageAllowedByDefault, "ThirdPartyPartitionedStorageAllowedByDefault", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kPriorityHeader, "PriorityHeader", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kSpdyHeadersToHttpResponseUseBuilder, "SpdyHeadersToHttpResponseUseBuilder", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kReportEcn, "ReportEcn", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kUseNewAlpsCodepointHttp2, "UseNewAlpsCodepointHttp2", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kUseNewAlpsCodepointQUIC, "UseNewAlpsCodepointQUIC", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpired, "TreatHTTPExpiresHeaderValueZeroAsExpired", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kTruncateBodyToContentLength, "TruncateBodyToContentLength", base::FEATURE_ENABLED_BY_DEFAULT); #if BUILDFLAG(IS_MAC) BASE_FEATURE(kReduceIPAddressChangeNotification, "ReduceIPAddressChangeNotification", base::FEATURE_ENABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_MAC) BASE_FEATURE(kDeviceBoundSessions, "DeviceBoundSessions", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kStoreConnectionSubtype, "StoreConnectionSubtype", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kPartitionProxyChains, "PartitionProxyChains", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kStorageAccessHeaders, "StorageAccessHeaders", base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kSpdySessionForProxyAdditionalChecks, "SpdySessionForProxyAdditionalChecks", base::FEATURE_ENABLED_BY_DEFAULT); } // namespace net::features