chromium/components/variations/field_trial_internals_utils.cc

// Copyright 2024 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/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;

// Returns whether (`study_name`, `experiment_name`) is found in `studies`.
bool ContainsExperiment(const std::vector<variations::StudyGroupNames>& studies,
                        std::string_view study_name,
                        std::string_view experiment_name) {}

// Expiration state for field trial overrides. Note that all overrides share the
// same expiration.
struct ExpirationInfo {};

ExpirationInfo GetExpirationInfo(PrefService& local_state) {}

}  // namespace

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

}  // namespace variations