#include "components/variations/variations_seed_processor.h"
#include <stddef.h>
#include <map>
#include <optional>
#include <vector>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/types/optional_ref.h"
#include "components/variations/client_filterable_state.h"
#include "components/variations/entropy_provider.h"
#include "components/variations/processed_study.h"
#include "components/variations/study_filtering.h"
#include "components/variations/variations_associated_data.h"
#include "components/variations/variations_layers.h"
namespace variations {
namespace internal {
const char kFeatureConflictGroupName[] = …;
const char kGoogleGroupFeatureParamName[] = …;
const char kGoogleGroupFeatureParamSeparator[] = …;
}
namespace {
std::string SerializeGoogleGroupsFilter(const Study::Filter& filter) { … }
void RegisterExperimentParams(const Study& study,
const Study::Experiment& experiment) { … }
std::optional<IDCollectionKey> GetKeyForWebExperiment(
const Study::Experiment& experiment) { … }
void RegisterVariationIds(const Study::Experiment& experiment,
const std::string& trial_name,
bool is_trial_overridden) { … }
void ApplyUIStringOverrides(
const Study::Experiment& experiment,
const VariationsSeedProcessor::UIStringOverrideCallback& callback) { … }
void ForceExperimentState(
const Study& study,
const Study::Experiment& experiment,
const VariationsSeedProcessor::UIStringOverrideCallback& override_callback,
base::FieldTrial* trial) { … }
void AssociateDefaultFeatures(const Study& study,
base::FieldTrial* trial,
base::FeatureList* feature_list) { … }
void RegisterFeatureOverrides(const Study& study,
const Study::Experiment& experiment,
base::FieldTrial* trial,
base::FeatureList* feature_list) { … }
bool ShouldForceExperiment(const Study::Experiment& experiment,
const base::CommandLine& command_line,
const base::FeatureList& feature_list) { … }
bool StudyIsLowAnonymity(const Study& study) { … }
void CreateTrialWithFeatureConflictGroup(const Study& study) { … }
}
bool VariationsSeedProcessor::HasGoogleWebExperimentId(
const Study::Experiment& experiment) { … }
VariationsSeedProcessor::VariationsSeedProcessor() = default;
VariationsSeedProcessor::~VariationsSeedProcessor() = default;
void VariationsSeedProcessor::CreateTrialsFromSeed(
const VariationsSeed& seed,
const ClientFilterableState& client_state,
const UIStringOverrideCallback& override_callback,
const EntropyProviders& entropy_providers,
const VariationsLayers& layers,
base::FeatureList* feature_list) { … }
void VariationsSeedProcessor::CreateTrialFromStudy(
const ProcessedStudy& processed_study,
const UIStringOverrideCallback& override_callback,
const EntropyProviders& entropy_providers,
const VariationsLayers& layers,
base::FeatureList* feature_list) { … }
}