#include "content/browser/attribution_reporting/interop/parser.h"
#include <stddef.h>
#include <stdint.h>
#include <optional>
#include <ostream>
#include <sstream>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/functional/function_ref.h"
#include "base/functional/overloaded.h"
#include "base/json/json_writer.h"
#include "base/memory/raw_ref.h"
#include "base/memory/scoped_refptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/abseil_string_number_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "base/types/expected.h"
#include "base/types/expected_macros.h"
#include "base/values.h"
#include "components/attribution_reporting/parsing_utils.h"
#include "components/attribution_reporting/privacy_math.h"
#include "components/attribution_reporting/suitable_origin.h"
#include "components/attribution_reporting/test_utils.h"
#include "content/browser/attribution_reporting/attribution_config.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_version.h"
#include "net/http/structured_headers.h"
#include "services/network/public/mojom/attribution.mojom.h"
#include "third_party/abseil-cpp/absl/numeric/int128.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
#include "url/gurl.h"
namespace content {
namespace {
SuitableOrigin;
AttributionReportingEligibility;
constexpr char kEligibleKey[] = …;
constexpr char kPayloadKey[] = …;
constexpr char kRegistrationRequestKey[] = …;
constexpr char kReportTimeKey[] = …;
constexpr char kReportUrlKey[] = …;
constexpr char kReportsKey[] = …;
constexpr char kResponseKey[] = …;
constexpr char kResponsesKey[] = …;
constexpr char kTimestampKey[] = …;
Context;
ContextPath;
std::string TimeAsUnixMillisecondString(base::Time time) { … }
class ScopedContext { … };
std::ostream& operator<<(std::ostream& out, const ContextPath& path) { … }
class ErrorWriter { … };
class AttributionInteropParser { … };
}
AttributionSimulationEvent::AttributionSimulationEvent(base::Time time,
Data data)
: … { … }
AttributionSimulationEvent::~AttributionSimulationEvent() = default;
AttributionSimulationEvent::AttributionSimulationEvent(
AttributionSimulationEvent&&) = default;
AttributionSimulationEvent& AttributionSimulationEvent::operator=(
AttributionSimulationEvent&&) = default;
AttributionSimulationEvent::Response::Response(
int64_t request_id,
GURL url,
scoped_refptr<net::HttpResponseHeaders> response_headers,
attribution_reporting::RandomizedResponse randomized_response,
base::flat_set<int> null_aggregatable_reports_days,
bool debug_permission)
: … { … }
AttributionSimulationEvent::Response::~Response() = default;
AttributionSimulationEvent::Response::Response(Response&&) = default;
AttributionSimulationEvent::Response&
AttributionSimulationEvent::Response::operator=(Response&&) = default;
base::expected<std::vector<AttributionSimulationEvent>, std::string>
ParseAttributionInteropInput(base::Value::Dict input) { … }
base::expected<AttributionInteropConfig, std::string>
ParseAttributionInteropConfig(base::Value::Dict dict) { … }
base::expected<void, std::string> MergeAttributionInteropConfig(
base::Value::Dict dict,
AttributionInteropConfig& config) { … }
base::expected<AttributionInteropOutput, std::string>
AttributionInteropOutput::Parse(base::Value::Dict dict) { … }
AttributionInteropOutput::AttributionInteropOutput() = default;
AttributionInteropOutput::~AttributionInteropOutput() = default;
AttributionInteropOutput::AttributionInteropOutput(AttributionInteropOutput&&) =
default;
AttributionInteropOutput& AttributionInteropOutput::operator=(
AttributionInteropOutput&&) = default;
AttributionInteropOutput::Report::Report() = default;
AttributionInteropOutput::Report::Report(base::Time time,
GURL url,
base::Value payload)
: … { … }
AttributionInteropOutput::Report::Report(const Report& other)
: … { … }
base::Value::Dict AttributionInteropOutput::Report::ToJson() const { … }
base::Value::Dict AttributionInteropOutput::ToJson() const { … }
AttributionInteropOutput::Report& AttributionInteropOutput::Report::operator=(
const Report& other) { … }
std::ostream& operator<<(std::ostream& out,
const AttributionInteropOutput::Report& report) { … }
std::ostream& operator<<(std::ostream& out,
const AttributionInteropOutput& output) { … }
base::expected<AttributionInteropRun, std::string> AttributionInteropRun::Parse(
base::Value::Dict dict,
const AttributionInteropConfig& default_config) { … }
AttributionInteropRun::AttributionInteropRun() = default;
AttributionInteropRun::~AttributionInteropRun() = default;
AttributionInteropRun::AttributionInteropRun(AttributionInteropRun&&) = default;
AttributionInteropRun& AttributionInteropRun::operator=(
AttributionInteropRun&&) = default;
AttributionInteropConfig::AttributionInteropConfig() = default;
AttributionInteropConfig::~AttributionInteropConfig() = default;
AttributionInteropConfig::AttributionInteropConfig(
const AttributionInteropConfig&) = default;
AttributionInteropConfig& AttributionInteropConfig::operator=(
const AttributionInteropConfig&) = default;
AttributionInteropConfig::AttributionInteropConfig(AttributionInteropConfig&&) =
default;
AttributionInteropConfig& AttributionInteropConfig::operator=(
AttributionInteropConfig&&) = default;
}