#include "content/browser/attribution_reporting/aggregatable_debug_report.h"
#include <stddef.h>
#include <stdint.h>
#include <optional>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/check_op.h"
#include "base/containers/enum_set.h"
#include "base/feature_list.h"
#include "base/functional/function_ref.h"
#include "base/numerics/checked_math.h"
#include "base/numerics/safe_conversions.h"
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/attribution_reporting/aggregatable_debug_reporting_config.h"
#include "components/attribution_reporting/aggregatable_filtering_id_max_bytes.h"
#include "components/attribution_reporting/aggregatable_utils.h"
#include "components/attribution_reporting/debug_types.h"
#include "components/attribution_reporting/debug_types.mojom.h"
#include "components/attribution_reporting/features.h"
#include "components/attribution_reporting/source_registration.h"
#include "components/attribution_reporting/suitable_origin.h"
#include "components/attribution_reporting/trigger_registration.h"
#include "content/browser/aggregation_service/aggregatable_report.h"
#include "content/browser/aggregation_service/aggregation_service_features.h"
#include "content/browser/attribution_reporting/aggregatable_attribution_utils.h"
#include "content/browser/attribution_reporting/aggregatable_result.mojom.h"
#include "content/browser/attribution_reporting/attribution_trigger.h"
#include "content/browser/attribution_reporting/create_report_result.h"
#include "content/browser/attribution_reporting/event_level_result.mojom.h"
#include "content/browser/attribution_reporting/storable_source.h"
#include "content/browser/attribution_reporting/store_source_result.h"
#include "content/browser/attribution_reporting/store_source_result.mojom.h"
#include "content/browser/attribution_reporting/stored_source.h"
#include "net/base/schemeful_site.h"
#include "third_party/abseil-cpp/absl/numeric/int128.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
#include "third_party/blink/public/mojom/aggregation_service/aggregatable_report.mojom.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace content {
namespace {
DebugDataTypes;
AggregatableResult;
DebugDataType;
EventLevelResult;
AggregatableReportHistogramContribution;
StoreSourceStatus;
constexpr size_t kMaxContributions = …;
constexpr char kApiIdentifier[] = …;
constexpr char kVersion[] = …;
constexpr char kVersionWithFlexibleContributionFiltering[] = …;
std::optional<DebugDataType> GetDebugType(const StoreSourceResult& result) { … }
std::optional<DebugDataType> GetDebugType(EventLevelResult result) { … }
std::optional<DebugDataType> GetDebugType(AggregatableResult result) { … }
std::vector<AggregatableReportHistogramContribution>
GetAggregatableContributions(
absl::uint128 context_key_piece,
const attribution_reporting::AggregatableDebugReportingConfig::DebugData&
debug_data,
const DebugDataTypes& debug_types) { … }
bool IsAggregatableFilteringIdsEnabled() { … }
}
std::optional<AggregatableDebugReport> AggregatableDebugReport::Create(
base::FunctionRef<bool()> is_operation_allowed,
const StoreSourceResult& result) { … }
std::optional<AggregatableDebugReport> AggregatableDebugReport::Create(
base::FunctionRef<bool()> is_operation_allowed,
const CreateReportResult& result) { … }
AggregatableDebugReport AggregatableDebugReport::CreateForTesting(
std::vector<AggregatableReportHistogramContribution> contributions,
net::SchemefulSite context_site,
attribution_reporting::SuitableOrigin reporting_origin,
net::SchemefulSite effective_destination,
std::optional<attribution_reporting::SuitableOrigin>
aggregation_coordinator_origin,
base::Time scheduled_report_time) { … }
AggregatableDebugReport::AggregatableDebugReport(
std::vector<AggregatableReportHistogramContribution> contributions,
net::SchemefulSite context_site,
attribution_reporting::SuitableOrigin reporting_origin,
net::SchemefulSite effective_destination,
std::optional<attribution_reporting::SuitableOrigin>
aggregation_coordinator_origin,
base::Time scheduled_report_time)
: … { … }
AggregatableDebugReport::AggregatableDebugReport(AggregatableDebugReport&&) =
default;
AggregatableDebugReport& AggregatableDebugReport::operator=(
AggregatableDebugReport&&) = default;
AggregatableDebugReport::~AggregatableDebugReport() = default;
int AggregatableDebugReport::BudgetRequired() const { … }
net::SchemefulSite AggregatableDebugReport::ReportingSite() const { … }
void AggregatableDebugReport::ToNull() { … }
GURL AggregatableDebugReport::ReportUrl() const { … }
std::optional<AggregatableReportRequest>
AggregatableDebugReport::CreateAggregatableReportRequest() const { … }
}