#include "services/preferences/tracked/pref_hash_store_impl.h"
#include <stddef.h>
#include <string_view>
#include <utility>
#include "base/check.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "services/preferences/tracked/device_id.h"
#include "services/preferences/tracked/hash_store_contents.h"
namespace {
ValueState;
std::string GenerateDeviceId() { … }
}
class PrefHashStoreImpl::PrefHashStoreTransactionImpl
: public PrefHashStoreTransaction { … };
PrefHashStoreImpl::PrefHashStoreImpl(const std::string& seed,
const std::string& legacy_device_id,
bool use_super_mac)
: … { … }
PrefHashStoreImpl::~PrefHashStoreImpl() { … }
std::unique_ptr<PrefHashStoreTransaction> PrefHashStoreImpl::BeginTransaction(
HashStoreContents* storage) { … }
std::string PrefHashStoreImpl::ComputeMac(const std::string& path,
const base::Value* value) { … }
std::string PrefHashStoreImpl::ComputeMac(const std::string& path,
const base::Value::Dict* dict) { … }
base::Value::Dict PrefHashStoreImpl::ComputeSplitMacs(
const std::string& path,
const base::Value::Dict* split_values) { … }
PrefHashStoreImpl::PrefHashStoreTransactionImpl::PrefHashStoreTransactionImpl(
PrefHashStoreImpl* outer,
HashStoreContents* storage)
: … { … }
PrefHashStoreImpl::PrefHashStoreTransactionImpl::
~PrefHashStoreTransactionImpl() { … }
std::string_view
PrefHashStoreImpl::PrefHashStoreTransactionImpl::GetStoreUMASuffix() const { … }
ValueState PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckValue(
const std::string& path,
const base::Value* initial_value) const { … }
void PrefHashStoreImpl::PrefHashStoreTransactionImpl::StoreHash(
const std::string& path,
const base::Value* new_value) { … }
ValueState PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckSplitValue(
const std::string& path,
const base::Value::Dict* initial_split_value,
std::vector<std::string>* invalid_keys) const { … }
void PrefHashStoreImpl::PrefHashStoreTransactionImpl::StoreSplitHash(
const std::string& path,
const base::Value::Dict* split_value) { … }
bool PrefHashStoreImpl::PrefHashStoreTransactionImpl::HasHash(
const std::string& path) const { … }
void PrefHashStoreImpl::PrefHashStoreTransactionImpl::ImportHash(
const std::string& path,
const base::Value* hash) { … }
void PrefHashStoreImpl::PrefHashStoreTransactionImpl::ClearHash(
const std::string& path) { … }
bool PrefHashStoreImpl::PrefHashStoreTransactionImpl::IsSuperMACValid() const { … }
bool PrefHashStoreImpl::PrefHashStoreTransactionImpl::StampSuperMac() { … }