chromium/components/variations/variations_seed_processor.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 internal

namespace {

// Serializes the `google_groups` attribute of `filter`.
std::string SerializeGoogleGroupsFilter(const Study::Filter& filter) {}

// Associates the variations params of `experiment`, if present.
void RegisterExperimentParams(const Study& study,
                              const Study::Experiment& experiment) {}

// Returns the IDCollectionKey with which |experiment| should be associated.
// Returns nullopt when |experiment| doesn't have a Google web or Google web
// trigger experiment ID.
std::optional<IDCollectionKey> GetKeyForWebExperiment(
    const Study::Experiment& experiment) {}

// If there are VariationIDs associated with |experiment|, register the
// VariationIDs. When `is_trial_overridden` is true, this does not register
// `google_web_experiment_id` as it would have no effect, and would impact
// collected metrics.
void RegisterVariationIds(const Study::Experiment& experiment,
                          const std::string& trial_name,
                          bool is_trial_overridden) {}

// Executes |callback| on every override defined by |experiment|.
void ApplyUIStringOverrides(
    const Study::Experiment& experiment,
    const VariationsSeedProcessor::UIStringOverrideCallback& callback) {}

// Forces the specified |experiment| to be enabled in |study|.
void ForceExperimentState(
    const Study& study,
    const Study::Experiment& experiment,
    const VariationsSeedProcessor::UIStringOverrideCallback& override_callback,
    base::FieldTrial* trial) {}

// Associates features for groups that do not specify them manually.
void AssociateDefaultFeatures(const Study& study,
                              base::FieldTrial* trial,
                              base::FeatureList* feature_list) {}

// Registers feature overrides `experiment` in the `study`.
void RegisterFeatureOverrides(const Study& study,
                              const Study::Experiment& experiment,
                              base::FieldTrial* trial,
                              base::FeatureList* feature_list) {}

// Checks if |experiment| is associated with a forcing flag or feature and if
// it is, returns whether it should be forced enabled based on the
// |command_line| or |feature_list| state.
bool ShouldForceExperiment(const Study::Experiment& experiment,
                           const base::CommandLine& command_line,
                           const base::FeatureList& feature_list) {}

bool StudyIsLowAnonymity(const Study& study) {}

// Creates a placeholder trial that indicates the feature conflict.
//
// This forcibly associates |trial_name| with the |kFeatureConflictGroupName|
// group, which indicates the trial was not applied due to a feature conflict.
// This group has no features, params, or variation IDs associated with it.
//
// Trials may be associated with this group due to toggling flags in
// chrome://flags that are associated with the trial's features, or if there
// are different trials associated with the same feature.
void CreateTrialWithFeatureConflictGroup(const Study& study) {}

}  // namespace

// static
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) {}

}  // namespace variations