chromium/net/base/features.cc

// 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 <vector>

#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();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

const base::FeatureParam<double> kDnsTransactionTimeoutMultiplier{};

const base::FeatureParam<base::TimeDelta> kDnsMinTransactionTimeout{};

BASE_FEATURE();

const base::FeatureParam<bool> kUseDnsHttpsSvcbEnforceSecureResponse{};

const base::FeatureParam<base::TimeDelta> kUseDnsHttpsSvcbInsecureExtraTimeMax{};

const base::FeatureParam<int> kUseDnsHttpsSvcbInsecureExtraTimePercent{};

const base::FeatureParam<base::TimeDelta> kUseDnsHttpsSvcbInsecureExtraTimeMin{};

const base::FeatureParam<base::TimeDelta> kUseDnsHttpsSvcbSecureExtraTimeMax{};

const base::FeatureParam<int> kUseDnsHttpsSvcbSecureExtraTimePercent{};

const base::FeatureParam<base::TimeDelta> kUseDnsHttpsSvcbSecureExtraTimeMin{};

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

const base::FeatureParam<int> kAlternativePortForGloballyReachableCheck{};

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

const base::FeatureParam<int> kRecentHTTPThresholdInSeconds{};
const base::FeatureParam<int> kRecentTransportThresholdInSeconds{};
const base::FeatureParam<int> kRecentEndToEndThresholdInSeconds{};
const base::FeatureParam<int> kCountNewObservationsReceivedComputeEct{};
const base::FeatureParam<int> kObservationBufferSize{};
const base::FeatureParam<base::TimeDelta>
    kEffectiveConnectionTypeRecomputationInterval{};

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();
#endif

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

extern const base::FeatureParam<int> kLimitOpenUDPSocketsMax(
    &kLimitOpenUDPSockets,
    "LimitOpenUDPSocketsMax",
    6000);

BASE_FEATURE();

extern const base::FeatureParam<double> kTimeoutTcpConnectAttemptRTTMultiplier(
    &kTimeoutTcpConnectAttempt,
    "TimeoutTcpConnectAttemptRTTMultiplier",
    5.0);

extern const base::FeatureParam<base::TimeDelta> kTimeoutTcpConnectAttemptMin(
    &kTimeoutTcpConnectAttempt,
    "TimeoutTcpConnectAttemptMin",
    base::Seconds(8));

extern const base::FeatureParam<base::TimeDelta> kTimeoutTcpConnectAttemptMax(
    &kTimeoutTcpConnectAttempt,
    "TimeoutTcpConnectAttemptMax",
    base::Seconds(30));

#if BUILDFLAG(ENABLE_REPORTING)
BASE_FEATURE();
#endif  // BUILDFLAG(ENABLE_REPORTING)

BASE_FEATURE();

BASE_FEATURE();

// Controls the maximum time duration an outermost frame navigation should be
// deferred by RWS initialization.
extern const base::FeatureParam<base::TimeDelta>
    kWaitForFirstPartySetsInitNavigationThrottleTimeout{};

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

// Enables partitioning of third party storage (IndexedDB, CacheStorage, etc.)
// by the top level site to reduce fingerprinting.
BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

#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();
const base::FeatureParam<int> kAvoidEntryCreationForNoStoreCacheSize{};

// Prefetch to follow normal semantics instead of 5-minute rule
// https://crbug.com/1345207
BASE_FEATURE();

// 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();
#endif

// A flag to make multiport context creation asynchronous.
BASE_FEATURE();
#endif

// IP protection experiment configuration settings
BASE_FEATURE();

const base::FeatureParam<std::string> kIpPrivacyTokenServer{};

const base::FeatureParam<std::string> kIpPrivacyTokenServerGetInitialDataPath{};

const base::FeatureParam<std::string> kIpPrivacyTokenServerGetTokensPath{};

const base::FeatureParam<std::string> kIpPrivacyTokenServerGetProxyConfigPath{};

const base::FeatureParam<int> kIpPrivacyAuthTokenCacheBatchSize{};

const base::FeatureParam<int> kIpPrivacyAuthTokenCacheLowWaterMark{};

const base::FeatureParam<base::TimeDelta> kIpPrivacyProxyListFetchInterval{};

const base::FeatureParam<base::TimeDelta> kIpPrivacyProxyListMinFetchInterval{};

const base::FeatureParam<bool> kIpPrivacyDirectOnly{};

const base::FeatureParam<bool> kIpPrivacyIncludeOAuthTokenInGetProxyConfig{};

const base::FeatureParam<std::string> kIpPrivacyProxyAHostnameOverride{};

const base::FeatureParam<std::string> kIpPrivacyProxyBHostnameOverride{};

const base::FeatureParam<bool> kIpPrivacyAddHeaderToProxiedRequests{};

const base::FeatureParam<base::TimeDelta> kIpPrivacyExpirationFuzz{};

const base::FeatureParam<bool> kIpPrivacyRestrictTopLevelSiteSchemes{};

const base::FeatureParam<bool> kIpPrivacyUseQuicProxies{};

const base::FeatureParam<bool> kIpPrivacyUseQuicProxiesOnly{};

const base::FeatureParam<bool> kIpPrivacyUseSingleProxy{};

const base::FeatureParam<std::string> kIpPrivacyAlwaysProxy{};

const base::FeatureParam<bool> kIpPrivacyFallbackToDirect{};

const base::FeatureParam<int> kIpPrivacyDebugExperimentArm{};

const base::FeatureParam<bool> kIpPrivacyCacheTokensByGeo{};

// 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 =;
#endif  // BUILDFLAG(IS_ANDROID)
BASE_FEATURE();

BASE_FEATURE();

#if BUILDFLAG(IS_LINUX)
BASE_FEATURE();
#endif  // BUILDFLAG(IS_LINUX)

// Enables binding of cookies to the port that originally set them by default.
BASE_FEATURE();

// Enables binding of cookies to the scheme that originally set them.
NET_EXPORT BASE_DECLARE_FEATURE(kEnableSchemeBoundCookies);
BASE_FEATURE();

BASE_FEATURE();

// Enable third-party cookie blocking from the command line.
BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

// 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();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

#if BUILDFLAG(IS_MAC)
BASE_FEATURE(kReduceIPAddressChangeNotification,
             "ReduceIPAddressChangeNotification",
             base::FEATURE_ENABLED_BY_DEFAULT);
#endif  // BUILDFLAG(IS_MAC)

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

BASE_FEATURE();

// TODO(crbug.com/347047841): Remove this flag when we branch for M131 or later,
// if we haven't had to turn this off.
BASE_FEATURE();

}  // namespace net::features