#include "components/sync/service/trusted_vault_synthetic_field_trial.h"
#include <memory>
#include <ostream>
#include <string>
#include <string_view>
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/rand_util.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "components/sync/protocol/nigori_specifics.pb.h"
#include "crypto/secure_hash.h"
namespace syncer {
namespace {
constexpr int kMaxCohortId = …;
constexpr int kMaxGroupTypeIndex = …;
const char* GetGroupTypeName(
sync_pb::TrustedVaultAutoUpgradeExperimentGroup::Type type) { … }
std::string GetGroupName(
int cohort,
sync_pb::TrustedVaultAutoUpgradeExperimentGroup::Type type,
int type_index) { … }
float DeterministicFloatBetweenZeroAndOneFromGaiaId(std::string_view gaia_id,
std::string_view salt) { … }
bool ShouldSampleGaiaIdWithTenPercentProbability(std::string_view gaia_id) { … }
}
std::string TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
GetMultiProfileConflictGroupName() { … }
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
const sync_pb::TrustedVaultAutoUpgradeExperimentGroup& proto) { … }
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup() = default;
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup(
const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&) = default;
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup(
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&&) = default;
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
~TrustedVaultAutoUpgradeSyntheticFieldTrialGroup() = default;
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::operator=(
const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&) = default;
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::operator=(
TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&&) = default;
void TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
LogValidationMetricsUponOnProfileLoad(std::string_view gaia_id) const { … }
void TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::LogValidationMetrics(
std::string_view gaia_id,
std::string_view short_metric_name) const { … }
float TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
DeterministicFloatBetweenZeroAndOneFromGaiaIdForTest(
std::string_view gaia_id,
std::string_view salt) { … }
bool TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
ShouldSampleGaiaIdWithTenPercentProbabilityForTest(
std::string_view gaia_id) { … }
void PrintTo(const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group,
std::ostream* os) { … }
}