#include "components/attribution_reporting/aggregatable_trigger_config.h"
#include <stddef.h>
#include <optional>
#include <string>
#include <utility>
#include "base/check.h"
#include "base/feature_list.h"
#include "base/notreached.h"
#include "base/types/expected.h"
#include "base/types/expected_macros.h"
#include "base/values.h"
#include "components/attribution_reporting/aggregatable_filtering_id_max_bytes.h"
#include "components/attribution_reporting/constants.h"
#include "components/attribution_reporting/features.h"
#include "components/attribution_reporting/source_registration_time_config.mojom.h"
#include "components/attribution_reporting/trigger_registration_error.mojom.h"
namespace attribution_reporting {
namespace {
SourceRegistrationTimeConfig;
TriggerRegistrationError;
bool FilteringIdEnabled() { … }
base::expected<SourceRegistrationTimeConfig, TriggerRegistrationError>
ParseAggregatableSourceRegistrationTime(const base::Value* value) { … }
std::string SerializeAggregatableSourceRegistrationTime(
SourceRegistrationTimeConfig config) { … }
bool IsTriggerContextIdValid(const std::string& s) { … }
bool IsTriggerContextIdAllowed(
SourceRegistrationTimeConfig source_registration_time_config) { … }
bool IsMaxBytesAllowed(
AggregatableFilteringIdsMaxBytes max_bytes,
SourceRegistrationTimeConfig source_registration_time_config) { … }
bool IsValid(SourceRegistrationTimeConfig source_registration_time_config,
const std::optional<std::string>& trigger_context_id,
AggregatableFilteringIdsMaxBytes max_bytes) { … }
base::expected<std::optional<std::string>, TriggerRegistrationError>
ParseTriggerContextId(base::Value* value) { … }
}
base::expected<AggregatableTriggerConfig, TriggerRegistrationError>
AggregatableTriggerConfig::Parse(base::Value::Dict& dict) { … }
std::optional<AggregatableTriggerConfig> AggregatableTriggerConfig::Create(
SourceRegistrationTimeConfig source_registration_time_config,
std::optional<std::string> trigger_context_id,
AggregatableFilteringIdsMaxBytes max_bytes) { … }
AggregatableTriggerConfig::AggregatableTriggerConfig() = default;
AggregatableTriggerConfig::AggregatableTriggerConfig(
SourceRegistrationTimeConfig source_registration_time_config,
std::optional<std::string> trigger_context_id,
AggregatableFilteringIdsMaxBytes max_bytes)
: … { … }
AggregatableTriggerConfig::AggregatableTriggerConfig(
const AggregatableTriggerConfig&) = default;
AggregatableTriggerConfig& AggregatableTriggerConfig::operator=(
const AggregatableTriggerConfig&) = default;
AggregatableTriggerConfig::AggregatableTriggerConfig(
AggregatableTriggerConfig&&) = default;
AggregatableTriggerConfig& AggregatableTriggerConfig::operator=(
AggregatableTriggerConfig&&) = default;
AggregatableTriggerConfig::~AggregatableTriggerConfig() = default;
void AggregatableTriggerConfig::Serialize(base::Value::Dict& dict) const { … }
bool AggregatableTriggerConfig::ShouldCauseAReportToBeSentUnconditionally()
const { … }
}