#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/nqe/network_quality_estimator_params.h"
#include <stdint.h>
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "net/base/features.h"
namespace net {
const char kForceEffectiveConnectionType[] = …;
const char kEffectiveConnectionTypeSlow2GOnCellular[] = …;
const base::TimeDelta
kHttpRttEffectiveConnectionTypeThresholds[EFFECTIVE_CONNECTION_TYPE_LAST] = …;
namespace {
static const int kMinimumRTTVariationParameterMsec = …;
static const int kMinimumThroughputVariationParameterKbps = …;
int64_t GetValueForVariationParam(
const std::map<std::string, std::string>& params,
const std::string& parameter_name,
int64_t default_value) { … }
double GetDoubleValueForVariationParamWithDefaultValue(
const std::map<std::string, std::string>& params,
const std::string& parameter_name,
double default_value) { … }
std::string GetStringValueForVariationParamWithDefaultValue(
const std::map<std::string, std::string>& params,
const std::string& parameter_name,
const std::string& default_value) { … }
double GetWeightMultiplierPerSecond(
const std::map<std::string, std::string>& params) { … }
bool GetPersistentCacheReadingEnabled(
const std::map<std::string, std::string>& params) { … }
base::TimeDelta GetMinSocketWatcherNotificationInterval(
const std::map<std::string, std::string>& params) { … }
const char* GetNameForConnectionTypeInternal(
NetworkChangeNotifier::ConnectionType connection_type) { … }
void ObtainDefaultObservations(
const std::map<std::string, std::string>& params,
nqe::internal::NetworkQuality default_observations[]) { … }
const base::TimeDelta kTypicalHttpRttEffectiveConnectionType
[net::EFFECTIVE_CONNECTION_TYPE_LAST] = …;
const int32_t kTypicalDownlinkKbpsEffectiveConnectionType
[net::EFFECTIVE_CONNECTION_TYPE_LAST] = …;
void ObtainTypicalNetworkQualities(
const std::map<std::string, std::string>& params,
nqe::internal::NetworkQuality typical_network_quality[]) { … }
void ObtainConnectionThresholds(
const std::map<std::string, std::string>& params,
nqe::internal::NetworkQuality connection_thresholds[]) { … }
std::string GetForcedEffectiveConnectionTypeString(
const std::map<std::string, std::string>& params) { … }
bool GetForcedEffectiveConnectionTypeOnCellularOnly(
const std::map<std::string, std::string>& params) { … }
std::optional<EffectiveConnectionType> GetInitForcedEffectiveConnectionType(
const std::map<std::string, std::string>& params) { … }
}
NetworkQualityEstimatorParams::NetworkQualityEstimatorParams(
const std::map<std::string, std::string>& params)
: … { … }
NetworkQualityEstimatorParams::~NetworkQualityEstimatorParams() = default;
void NetworkQualityEstimatorParams::SetUseSmallResponsesForTesting(
bool use_small_responses) { … }
bool NetworkQualityEstimatorParams::use_small_responses() const { … }
base::TimeDelta NetworkQualityEstimatorParams::GetDefaultTypicalHttpRtt(
EffectiveConnectionType effective_connection_type) { … }
int32_t NetworkQualityEstimatorParams::GetDefaultTypicalDownlinkKbps(
EffectiveConnectionType effective_connection_type) { … }
void NetworkQualityEstimatorParams::SetForcedEffectiveConnectionTypeForTesting(
EffectiveConnectionType type) { … }
std::optional<EffectiveConnectionType>
NetworkQualityEstimatorParams::GetForcedEffectiveConnectionType(
NetworkChangeNotifier::ConnectionType connection_type) { … }
size_t NetworkQualityEstimatorParams::throughput_min_requests_in_flight()
const { … }
int64_t NetworkQualityEstimatorParams::GetThroughputMinTransferSizeBits()
const { … }
const nqe::internal::NetworkQuality&
NetworkQualityEstimatorParams::DefaultObservation(
NetworkChangeNotifier::ConnectionType type) const { … }
const nqe::internal::NetworkQuality&
NetworkQualityEstimatorParams::TypicalNetworkQuality(
EffectiveConnectionType type) const { … }
const nqe::internal::NetworkQuality&
NetworkQualityEstimatorParams::ConnectionThreshold(
EffectiveConnectionType type) const { … }
}