chromium/content/browser/interest_group/bidding_and_auction_response.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 =;  // bytes
const uint8_t kExpectedHeaderVersionInfo =;

// TODO(crbug.com/40215445): Replace with `base/numerics/byte_conversions.h` if
// available.
absl::uint128 U128FromBigEndian(std::vector<uint8_t> bytes) {}

}  // namespace

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;

// static
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) {}

// static
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) {}

// static
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) {}

// static
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) {}

// static
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) {}

// static
void BiddingAndAuctionResponse::TryParseForDebuggingOnlyReports(
    const base::Value::List& for_debugging_only_reports,
    BiddingAndAuctionResponse& output) {}

// static
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;

// static
std::optional<BiddingAndAuctionResponse::ReportingURLs>
BiddingAndAuctionResponse::ReportingURLs::TryParse(
    base::Value::Dict* input_dict) {}

}  // namespace content