#include "content/browser/attribution_reporting/create_report_result.h"
#include <optional>
#include <utility>
#include "base/check.h"
#include "base/check_op.h"
#include "base/functional/overloaded.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "base/types/optional_util.h"
#include "content/browser/attribution_reporting/attribution_report.h"
#include "content/browser/attribution_reporting/attribution_trigger.h"
#include "content/browser/attribution_reporting/stored_source.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
namespace content {
namespace {
EventLevelResult;
AggregatableResult;
EventLevelSuccess;
}
EventLevelSuccess::EventLevelSuccess(
AttributionReport new_report,
std::optional<AttributionReport> replaced_report)
: … { … }
EventLevelSuccess::~EventLevelSuccess() = default;
EventLevelSuccess::EventLevelSuccess(const EventLevelSuccess&) = default;
EventLevelSuccess& EventLevelSuccess::operator=(const EventLevelSuccess&) =
default;
EventLevelSuccess::EventLevelSuccess(EventLevelSuccess&&) = default;
EventLevelSuccess& EventLevelSuccess::operator=(EventLevelSuccess&&) = default;
namespace {
CreateReportResult::EventLevel CreateEventLevelResult(
EventLevelResult event_level_status,
const CreateReportResult::Limits& limits,
std::optional<AttributionReport> replaced_event_level_report,
std::optional<AttributionReport> new_event_level_report,
std::optional<AttributionReport> dropped_event_level_report) { … }
CreateReportResult::Aggregatable CreateAggregatableResult(
AggregatableResult aggregatable_status,
const CreateReportResult::Limits& limits,
std::optional<AttributionReport> new_aggregatable_report) { … }
}
CreateReportResult::CreateReportResult(
base::Time trigger_time,
AttributionTrigger trigger,
EventLevelResult event_level_status,
AggregatableResult aggregatable_status,
std::optional<AttributionReport> replaced_event_level_report,
std::optional<AttributionReport> new_event_level_report,
std::optional<AttributionReport> new_aggregatable_report,
std::optional<StoredSource> source,
const Limits limits,
std::optional<AttributionReport> dropped_event_level_report,
std::optional<base::Time> min_null_aggregatable_report_time)
: … { … }
CreateReportResult::CreateReportResult(
base::Time trigger_time,
AttributionTrigger trigger,
EventLevel event_level_result,
Aggregatable aggregatable_result,
std::optional<StoredSource> source,
std::optional<base::Time> min_null_aggregatable_report_time)
: … { … }
CreateReportResult::~CreateReportResult() = default;
CreateReportResult::CreateReportResult(const CreateReportResult&) = default;
CreateReportResult::CreateReportResult(CreateReportResult&&) = default;
CreateReportResult& CreateReportResult::operator=(const CreateReportResult&) =
default;
CreateReportResult& CreateReportResult::operator=(CreateReportResult&&) =
default;
EventLevelResult CreateReportResult::event_level_status() const { … }
AggregatableResult CreateReportResult::aggregatable_status() const { … }
const AttributionReport* CreateReportResult::replaced_event_level_report()
const { … }
const AttributionReport* CreateReportResult::new_event_level_report() const { … }
AttributionReport* CreateReportResult::new_event_level_report() { … }
const AttributionReport* CreateReportResult::new_aggregatable_report() const { … }
AttributionReport* CreateReportResult::new_aggregatable_report() { … }
const AttributionReport* CreateReportResult::dropped_event_level_report()
const { … }
}