#include "components/attribution_reporting/aggregatable_trigger_data.h"
#include <stddef.h>
#include <limits>
#include <optional>
#include <string>
#include <utility>
#include "base/check.h"
#include "base/containers/flat_set.h"
#include "base/ranges/algorithm.h"
#include "base/types/expected.h"
#include "base/types/expected_macros.h"
#include "base/values.h"
#include "components/attribution_reporting/constants.h"
#include "components/attribution_reporting/filters.h"
#include "components/attribution_reporting/parsing_utils.h"
#include "components/attribution_reporting/trigger_registration_error.mojom.h"
#include "third_party/abseil-cpp/absl/numeric/int128.h"
namespace attribution_reporting {
namespace {
TriggerRegistrationError;
bool AreSourceKeysValid(const AggregatableTriggerData::Keys& source_keys) { … }
base::expected<absl::uint128, TriggerRegistrationError> ParseKeyPiece(
const base::Value::Dict& registration) { … }
base::expected<AggregatableTriggerData::Keys, TriggerRegistrationError>
ParseSourceKeys(base::Value::Dict& registration) { … }
void SerializeSourceKeysIfNotEmpty(base::Value::Dict& dict,
const AggregatableTriggerData::Keys& keys) { … }
}
std::optional<AggregatableTriggerData> AggregatableTriggerData::Create(
absl::uint128 key_piece,
Keys source_keys,
FilterPair filters) { … }
base::expected<AggregatableTriggerData, TriggerRegistrationError>
AggregatableTriggerData::FromJSON(base::Value& value) { … }
AggregatableTriggerData::AggregatableTriggerData() = default;
AggregatableTriggerData::AggregatableTriggerData(absl::uint128 key_piece,
Keys source_keys,
FilterPair filters)
: … { … }
AggregatableTriggerData::~AggregatableTriggerData() = default;
AggregatableTriggerData::AggregatableTriggerData(
const AggregatableTriggerData&) = default;
AggregatableTriggerData& AggregatableTriggerData::operator=(
const AggregatableTriggerData&) = default;
AggregatableTriggerData::AggregatableTriggerData(AggregatableTriggerData&&) =
default;
AggregatableTriggerData& AggregatableTriggerData::operator=(
AggregatableTriggerData&&) = default;
base::Value::Dict AggregatableTriggerData::ToJson() const { … }
}