#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/variations/field_trial_config/field_trial_util.h"
#include <stddef.h>
#include <map>
#include <set>
#include <string>
#include <utility>
#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/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/system/sys_info.h"
#include "components/variations/client_filterable_state.h"
#include "components/variations/field_trial_config/fieldtrial_testing_config.h"
#include "components/variations/study_filtering.h"
#include "components/variations/variations_seed_processor.h"
namespace variations {
namespace {
bool HasPlatform(const FieldTrialTestingExperiment& experiment,
Study::Platform platform) { … }
bool HasDeviceLevelMismatch(const FieldTrialTestingExperiment& experiment) { … }
bool HasFormFactor(const FieldTrialTestingExperiment& experiment,
Study::FormFactor current_form_factor) { … }
bool HasMinOSVersion(const FieldTrialTestingExperiment& experiment) { … }
void ApplyUIStringOverrides(
const FieldTrialTestingExperiment& experiment,
const VariationsSeedProcessor::UIStringOverrideCallback& callback) { … }
bool ShouldSkipExperiment(const FieldTrialTestingExperiment& experiment,
base::FeatureList* feature_list) { … }
void AssociateParamsFromExperiment(
const std::string& study_name,
const FieldTrialTestingExperiment& experiment,
const VariationsSeedProcessor::UIStringOverrideCallback& callback,
base::FeatureList* feature_list) { … }
Study::Filter CreateFilter(const FieldTrialTestingExperiment& experiment) { … }
void ChooseExperiment(
const FieldTrialTestingStudy& study,
const VariationsSeedProcessor::UIStringOverrideCallback& callback,
Study::Platform platform,
Study::FormFactor current_form_factor,
base::FeatureList* feature_list) { … }
}
std::string EscapeValue(const std::string& value) { … }
bool AssociateParamsFromString(const std::string& varations_string) { … }
void AssociateParamsFromFieldTrialConfig(
const FieldTrialTestingConfig& config,
const VariationsSeedProcessor::UIStringOverrideCallback& callback,
Study::Platform platform,
Study::FormFactor current_form_factor,
base::FeatureList* feature_list) { … }
void AssociateDefaultFieldTrialConfig(
const VariationsSeedProcessor::UIStringOverrideCallback& callback,
Study::Platform platform,
Study::FormFactor current_form_factor,
base::FeatureList* feature_list) { … }
}