#include "components/variations/field_trial_internals_utils.h"
#include <algorithm>
#include <string>
#include <string_view>
#include "base/containers/contains.h"
#include "base/logging.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_functions.h"
#include "base/version.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/variations/client_filterable_state.h"
#include "components/variations/hashing.h"
#include "components/variations/pref_names.h"
#include "components/variations/proto/variations_seed.pb.h"
#include "components/variations/study_filtering.h"
#include "components/variations/variations_layers.h"
#include "components/version_info/version_info.h"
namespace variations {
namespace {
TrialGroup;
HashNameAsHexString;
bool ContainsExperiment(const std::vector<variations::StudyGroupNames>& studies,
std::string_view study_name,
std::string_view experiment_name) { … }
struct ExpirationInfo { … };
ExpirationInfo GetExpirationInfo(PrefService& local_state) { … }
}
StudyGroupNames::StudyGroupNames(const Study& study) { … }
StudyGroupNames::StudyGroupNames() = default;
StudyGroupNames::~StudyGroupNames() = default;
StudyGroupNames::StudyGroupNames(const StudyGroupNames& src) = default;
StudyGroupNames& StudyGroupNames::operator=(const StudyGroupNames& src) =
default;
std::vector<StudyGroupNames> GetStudiesAvailableToForce(
VariationsSeed seed,
const EntropyProviders& entropy_providers,
const ClientFilterableState& client_filterable_state) { … }
void RegisterFieldTrialInternalsPrefs(PrefRegistrySimple& registry) { … }
void ForceTrialsAtStartup(PrefService& local_state) { … }
bool SetTemporaryTrialOverrides(
PrefService& local_state,
base::span<std::pair<std::string, std::string>> override_groups) { … }
base::flat_map<std::string, std::string> RefreshAndGetFieldTrialOverrides(
const std::vector<variations::StudyGroupNames>& available_studies,
PrefService& local_state,
bool& requires_restart) { … }
}