#include "components/variations/variations_ids_provider.h"
#include <algorithm>
#include "base/base64.h"
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/observer_list.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/synchronization/lock.h"
#include "components/variations/proto/client_variations.pb.h"
#include "components/variations/variations_associated_data.h"
#include "components/variations/variations_client.h"
#include "components/variations/variations_features.h"
BASE_FEATURE(…);
namespace variations {
namespace {
const int kLowEntropySourceVariationIdRangeMin = …;
const int kLowEntropySourceVariationIdRangeMax = …;
VariationsIdsProvider* g_instance = …;
base::Lock& GetInstanceLock() { … }
}
bool VariationsHeaderKey::operator<(const VariationsHeaderKey& other) const { … }
VariationsIdsProvider* VariationsIdsProvider::Create(Mode mode) { … }
VariationsIdsProvider* VariationsIdsProvider::GetInstance() { … }
variations::mojom::VariationsHeadersPtr
VariationsIdsProvider::GetClientDataHeaders(bool is_signed_in) { … }
std::string VariationsIdsProvider::GetVariationsString(
const std::set<IDCollectionKey>& keys) { … }
std::string VariationsIdsProvider::GetGoogleAppVariationsString() { … }
std::string VariationsIdsProvider::GetTriggerVariationsString() { … }
std::string VariationsIdsProvider::GetVariationsString() { … }
std::vector<VariationID> VariationsIdsProvider::GetVariationsVector(
const std::set<IDCollectionKey>& keys) { … }
std::vector<VariationID>
VariationsIdsProvider::GetVariationsVectorForWebPropertiesKeys() { … }
void VariationsIdsProvider::SetLowEntropySourceValue(
std::optional<int> low_entropy_source_value) { … }
VariationsIdsProvider::ForceIdsResult VariationsIdsProvider::ForceVariationIds(
const std::vector<std::string>& variation_ids,
const std::string& command_line_variation_ids) { … }
bool VariationsIdsProvider::ForceDisableVariationIds(
const std::string& command_line_variation_ids) { … }
void VariationsIdsProvider::AddObserver(Observer* observer) { … }
void VariationsIdsProvider::RemoveObserver(Observer* observer) { … }
void VariationsIdsProvider::ResetForTesting() { … }
VariationsIdsProvider::VariationsIdsProvider(Mode mode)
: … { … }
VariationsIdsProvider::~VariationsIdsProvider() { … }
void VariationsIdsProvider::CreateInstanceForTesting(Mode mode) { … }
void VariationsIdsProvider::DestroyInstanceForTesting() { … }
void VariationsIdsProvider::OnFieldTrialGroupFinalized(
const base::FieldTrial& trial,
const std::string& group_name) { … }
void VariationsIdsProvider::OnSyntheticTrialsChanged(
const std::vector<SyntheticTrialGroup>& trials_updated,
const std::vector<SyntheticTrialGroup>& trials_removed,
const std::vector<SyntheticTrialGroup>& groups) { … }
void VariationsIdsProvider::InitVariationIDsCacheIfNeeded() { … }
void VariationsIdsProvider::CacheVariationsId(const std::string& trial_name,
const std::string& group_name) { … }
void VariationsIdsProvider::UpdateVariationIDsHeaderValue() { … }
std::string VariationsIdsProvider::GenerateBase64EncodedProto(
bool is_signed_in,
bool is_first_party_context) { … }
bool VariationsIdsProvider::AddVariationIdsToSet(
const std::vector<std::string>& variation_ids,
bool should_dedupe,
std::set<VariationIDEntry>* target_set) { … }
bool VariationsIdsProvider::ParseVariationIdsParameter(
const std::string& command_line_variation_ids,
bool should_dedupe,
std::set<VariationIDEntry>* target_set) { … }
std::string VariationsIdsProvider::GetClientDataHeaderWhileLocked(
bool is_signed_in,
Study_GoogleWebVisibility web_visibility) { … }
std::set<VariationsIdsProvider::VariationIDEntry>
VariationsIdsProvider::GetAllVariationIds() { … }
std::vector<VariationID> VariationsIdsProvider::GetVariationsVectorImpl(
const std::set<IDCollectionKey>& keys) { … }
bool VariationsIdsProvider::IsDuplicateId(VariationID id) { … }
}