#include "content/browser/attribution_reporting/stored_source.h"
#include <stdint.h>
#include <limits>
#include <optional>
#include <utility>
#include "base/check.h"
#include "base/check_op.h"
#include "base/time/time.h"
#include "components/attribution_reporting/aggregatable_utils.h"
#include "components/attribution_reporting/aggregation_keys.h"
#include "components/attribution_reporting/attribution_scopes_data.h"
#include "components/attribution_reporting/constants.h"
#include "components/attribution_reporting/destination_set.h"
#include "components/attribution_reporting/event_level_epsilon.h"
#include "components/attribution_reporting/filters.h"
#include "components/attribution_reporting/trigger_config.h"
#include "components/attribution_reporting/trigger_data_matching.mojom-forward.h"
#include "content/browser/attribution_reporting/common_source_info.h"
namespace content {
namespace {
bool IsExpiryOrReportWindowTimeValid(base::Time expiry_or_report_window_time,
base::Time source_time) { … }
bool AreFieldsValid(int remaining_aggregatable_attribution_budget,
int remaining_aggregatable_debug_budget,
double randomized_response_rate,
base::Time source_time,
base::Time expiry_time,
base::Time aggregatable_report_window_time,
std::optional<uint64_t> debug_key,
bool debug_cookie_set) { … }
}
std::optional<StoredSource> StoredSource::Create(
CommonSourceInfo common_info,
uint64_t source_event_id,
attribution_reporting::DestinationSet destination_sites,
base::Time source_time,
base::Time expiry_time,
attribution_reporting::TriggerSpecs trigger_specs,
base::Time aggregatable_report_window_time,
int64_t priority,
attribution_reporting::FilterData filter_data,
std::optional<uint64_t> debug_key,
attribution_reporting::AggregationKeys aggregation_keys,
AttributionLogic attribution_logic,
ActiveState active_state,
Id source_id,
int remaining_aggregatable_attribution_budget,
double randomized_response_rate,
attribution_reporting::mojom::TriggerDataMatching trigger_data_matching,
attribution_reporting::EventLevelEpsilon event_level_epsilon,
absl::uint128 aggregatable_debug_key_piece,
int remaining_aggregatable_debug_budget,
std::optional<attribution_reporting::AttributionScopesData>
attribution_scopes_data) { … }
StoredSource::StoredSource(
CommonSourceInfo common_info,
uint64_t source_event_id,
attribution_reporting::DestinationSet destination_sites,
base::Time source_time,
base::Time expiry_time,
attribution_reporting::TriggerSpecs trigger_specs,
base::Time aggregatable_report_window_time,
int64_t priority,
attribution_reporting::FilterData filter_data,
std::optional<uint64_t> debug_key,
attribution_reporting::AggregationKeys aggregation_keys,
AttributionLogic attribution_logic,
ActiveState active_state,
Id source_id,
int remaining_aggregatable_attribution_budget,
double randomized_response_rate,
attribution_reporting::mojom::TriggerDataMatching trigger_data_matching,
attribution_reporting::EventLevelEpsilon event_level_epsilon,
absl::uint128 aggregatable_debug_key_piece,
int remaining_aggregatable_debug_budget,
std::optional<attribution_reporting::AttributionScopesData>
attribution_scopes_data)
: … { … }
StoredSource::~StoredSource() = default;
StoredSource::StoredSource(const StoredSource&) = default;
StoredSource::StoredSource(StoredSource&&) = default;
StoredSource& StoredSource::operator=(const StoredSource&) = default;
StoredSource& StoredSource::operator=(StoredSource&&) = default;
}