#include "components/attribution_reporting/trigger_registration.h"
#include <optional>
#include <utility>
#include <vector>
#include "base/feature_list.h"
#include "base/functional/function_ref.h"
#include "base/json/json_reader.h"
#include "base/metrics/histogram_functions.h"
#include "base/types/expected.h"
#include "base/types/expected_macros.h"
#include "base/values.h"
#include "components/attribution_reporting/aggregatable_debug_reporting_config.h"
#include "components/attribution_reporting/aggregatable_dedup_key.h"
#include "components/attribution_reporting/aggregatable_filtering_id_max_bytes.h"
#include "components/attribution_reporting/aggregatable_trigger_config.h"
#include "components/attribution_reporting/aggregatable_trigger_data.h"
#include "components/attribution_reporting/aggregatable_values.h"
#include "components/attribution_reporting/attribution_scopes_set.h"
#include "components/attribution_reporting/constants.h"
#include "components/attribution_reporting/event_trigger_data.h"
#include "components/attribution_reporting/features.h"
#include "components/attribution_reporting/filters.h"
#include "components/attribution_reporting/parsing_utils.h"
#include "components/attribution_reporting/suitable_origin.h"
#include "components/attribution_reporting/trigger_registration_error.mojom.h"
namespace attribution_reporting {
namespace {
TriggerRegistrationError;
template <typename T>
void SerializeListIfNotEmpty(base::Value::Dict& dict,
std::string_view key,
const std::vector<T>& vec) { … }
template <typename T>
base::expected<std::vector<T>, TriggerRegistrationError> ParseList(
base::Value* input_value,
TriggerRegistrationError wrong_type,
base::FunctionRef<base::expected<T, TriggerRegistrationError>(base::Value&)>
build_element) { … }
bool ContributionsFilteringIdsFitWithinMaxBytes(
const std::vector<AggregatableValues>& aggregatable_values,
AggregatableFilteringIdsMaxBytes max_bytes) { … }
}
void RecordTriggerRegistrationError(TriggerRegistrationError error) { … }
namespace {
base::expected<TriggerRegistration, TriggerRegistrationError> ParseDict(
base::Value::Dict dict) { … }
}
base::expected<TriggerRegistration, TriggerRegistrationError>
TriggerRegistration::Parse(base::Value value) { … }
base::expected<TriggerRegistration, TriggerRegistrationError>
TriggerRegistration::Parse(std::string_view json) { … }
TriggerRegistration::TriggerRegistration() = default;
TriggerRegistration::~TriggerRegistration() = default;
TriggerRegistration::TriggerRegistration(const TriggerRegistration&) = default;
TriggerRegistration& TriggerRegistration::operator=(
const TriggerRegistration&) = default;
TriggerRegistration::TriggerRegistration(TriggerRegistration&&) = default;
TriggerRegistration& TriggerRegistration::operator=(TriggerRegistration&&) =
default;
base::Value::Dict TriggerRegistration::ToJson() const { … }
bool TriggerRegistration::IsValid() const { … }
}