#include "content/browser/interest_group/bidding_and_auction_response.h"
#include <optional>
#include <string>
#include <vector>
#include "base/containers/adapters.h"
#include "base/containers/flat_map.h"
#include "base/feature_list.h"
#include "base/values.h"
#include "content/browser/interest_group/interest_group_pa_report_util.h"
#include "content/services/auction_worklet/public/cpp/private_aggregation_reporting.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "third_party/blink/public/common/features.h"
#include "url/origin.h"
namespace content {
namespace {
const size_t kFramingHeaderSize = …;
const uint8_t kExpectedHeaderVersionInfo = …;
absl::uint128 U128FromBigEndian(std::vector<uint8_t> bytes) { … }
}
std::optional<base::span<const uint8_t>>
ExtractCompressedBiddingAndAuctionResponse(
base::span<const uint8_t> decrypted_data) { … }
BiddingAndAuctionResponse::BiddingAndAuctionResponse(
BiddingAndAuctionResponse&&) = default;
BiddingAndAuctionResponse& BiddingAndAuctionResponse::operator=(
BiddingAndAuctionResponse&&) = default;
BiddingAndAuctionResponse::BiddingAndAuctionResponse() = default;
BiddingAndAuctionResponse::~BiddingAndAuctionResponse() = default;
std::optional<BiddingAndAuctionResponse> BiddingAndAuctionResponse::TryParse(
base::Value input,
const base::flat_map<url::Origin, std::vector<std::string>>& group_names,
const base::flat_map<blink::InterestGroupKey, url::Origin>&
group_pagg_coordinators) { … }
void BiddingAndAuctionResponse::TryParsePAggResponse(
const base::Value::List& pagg_response,
const base::flat_map<url::Origin, std::vector<std::string>>& group_names,
const base::flat_map<blink::InterestGroupKey, url::Origin>&
group_pagg_coordinators,
BiddingAndAuctionResponse& output) { … }
void BiddingAndAuctionResponse::TryParsePAggIgContributions(
const base::Value::List& ig_contributions,
const url::Origin& reporting_origin,
const base::flat_map<blink::InterestGroupKey, url::Origin>&
group_pagg_coordinators,
const base::flat_map<url::Origin, std::vector<std::string>>& group_names,
BiddingAndAuctionResponse& output) { … }
void BiddingAndAuctionResponse::TryParsePAggEventContributions(
const base::Value::List& event_contributions,
const url::Origin& reporting_origin,
const std::optional<url::Origin>& aggregation_coordinator_origin,
bool component_win,
BiddingAndAuctionResponse& output) { … }
void BiddingAndAuctionResponse::TryParsePAggContributions(
const base::Value::List& contributions,
bool component_win,
const std::string& event_type_str,
const PrivateAggregationPhaseKey& agg_phase_key,
const PrivateAggregationKey& agg_key,
BiddingAndAuctionResponse& output) { … }
void BiddingAndAuctionResponse::TryParseForDebuggingOnlyReports(
const base::Value::List& for_debugging_only_reports,
BiddingAndAuctionResponse& output) { … }
void BiddingAndAuctionResponse::TryParseSingleDebugReport(
const url::Origin& ad_tech_origin,
const base::Value::Dict& report_dict,
BiddingAndAuctionResponse& output) { … }
BiddingAndAuctionResponse::ReportingURLs::ReportingURLs() = default;
BiddingAndAuctionResponse::ReportingURLs::~ReportingURLs() = default;
BiddingAndAuctionResponse::ReportingURLs::ReportingURLs(ReportingURLs&&) =
default;
BiddingAndAuctionResponse::ReportingURLs&
BiddingAndAuctionResponse::ReportingURLs::operator=(ReportingURLs&&) = default;
std::optional<BiddingAndAuctionResponse::ReportingURLs>
BiddingAndAuctionResponse::ReportingURLs::TryParse(
base::Value::Dict* input_dict) { … }
}