#include "content/browser/attribution_reporting/attribution_debug_report.h"
#include <stdint.h>
#include <optional>
#include <string_view>
#include <utility>
#include "base/check.h"
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/functional/function_ref.h"
#include "base/functional/overloaded.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "components/attribution_reporting/constants.h"
#include "components/attribution_reporting/debug_types.h"
#include "components/attribution_reporting/debug_types.mojom.h"
#include "components/attribution_reporting/destination_set.h"
#include "components/attribution_reporting/os_registration.h"
#include "components/attribution_reporting/registration_header_error.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/attribution_reporting/attribution_constants.h"
#include "content/browser/attribution_reporting/attribution_features.h"
#include "content/browser/attribution_reporting/attribution_reporting.mojom.h"
#include "content/browser/attribution_reporting/attribution_trigger.h"
#include "content/browser/attribution_reporting/common_source_info.h"
#include "content/browser/attribution_reporting/create_report_result.h"
#include "content/browser/attribution_reporting/os_registration.h"
#include "content/browser/attribution_reporting/storable_source.h"
#include "content/browser/attribution_reporting/store_source_result.h"
#include "net/base/schemeful_site.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
#include "url/gurl.h"
namespace content {
namespace {
DebugDataType;
constexpr char kAttributionDestination[] = …;
struct DebugDataTypeAndBody { … };
template <typename T>
base::Value GetLimit(T limit) { … }
std::optional<DebugDataTypeAndBody> GetReportDataBody(
const StoreSourceResult& result) { … }
std::optional<DebugDataTypeAndBody> GetReportDataTypeAndLimit(
const CreateReportResult::EventLevel& result) { … }
std::optional<DebugDataTypeAndBody> GetReportDataTypeAndLimit(
const CreateReportResult::Aggregatable& result) { … }
void SetSourceData(base::Value::Dict& data_body,
uint64_t source_event_id,
const net::SchemefulSite& source_site,
std::optional<uint64_t> source_debug_key) { … }
void SetLimit(base::Value::Dict& data_body, base::Value limit) { … }
base::Value::Dict GetReportDataBody(DebugDataTypeAndBody data,
const CreateReportResult& result) { … }
base::Value::Dict GetReportData(DebugDataType type, base::Value::Dict body) { … }
void RecordVerboseDebugReportType(DebugDataType type) { … }
}
GURL AttributionDebugReport::ReportUrl() const { … }
std::optional<AttributionDebugReport> AttributionDebugReport::Create(
base::FunctionRef<bool()> is_operation_allowed,
const StoreSourceResult& result) { … }
std::optional<AttributionDebugReport> AttributionDebugReport::Create(
base::FunctionRef<bool()> is_operation_allowed,
bool is_debug_cookie_set,
const CreateReportResult& result) { … }
std::optional<AttributionDebugReport> AttributionDebugReport::Create(
const OsRegistration& registration,
size_t item_index,
base::FunctionRef<bool(const url::Origin&)> is_operation_allowed) { … }
std::optional<AttributionDebugReport> AttributionDebugReport::Create(
attribution_reporting::SuitableOrigin reporting_origin,
const attribution_reporting::RegistrationHeaderError& error,
const attribution_reporting::SuitableOrigin& context_origin,
bool is_within_fenced_frame,
base::FunctionRef<bool(const url::Origin&)> is_operation_allowed) { … }
AttributionDebugReport::AttributionDebugReport(
base::Value::List report_body,
attribution_reporting::SuitableOrigin reporting_origin)
: … { … }
AttributionDebugReport::~AttributionDebugReport() = default;
AttributionDebugReport::AttributionDebugReport(AttributionDebugReport&&) =
default;
AttributionDebugReport& AttributionDebugReport::operator=(
AttributionDebugReport&&) = default;
}