#include "third_party/blink/public/common/interest_group/devtools_serialization.h"
#include <cmath>
#include <string_view>
#include <tuple>
#include "base/base64.h"
#include "base/strings/to_string.h"
#include "base/values.h"
#include "third_party/blink/public/common/interest_group/ad_display_size_utils.h"
#include "third_party/blink/public/common/interest_group/auction_config.h"
#include "third_party/blink/public/common/interest_group/interest_group.h"
#include "third_party/blink/public/mojom/interest_group/ad_auction_service.mojom.h"
namespace blink {
namespace {
std::string SerializeIntoKey(const url::Origin& in) { … }
std::string SerializeIntoKey(const std::string& in) { … }
BuyerReportType;
std::string SerializeIntoKey(BuyerReportType report_type) { … }
RealTimeReportingType;
std::string SerializeIntoValue(RealTimeReportingType report_type) { … }
template <typename T>
base::Value SerializeIntoValue(const T& in) { … }
template <typename K, typename V>
base::Value SerializeIntoValue(const base::flat_map<K, V>&);
template <typename T>
void SerializeIntoDict(std::string_view field,
const T& value,
base::Value::Dict& out);
template <typename T>
void SerializeIntoDict(std::string_view field,
const std::optional<T>& value,
base::Value::Dict& out);
template <typename T>
base::Value SerializeIntoValue(const std::optional<T>& value) { … }
template <>
base::Value SerializeIntoValue(const url::Origin& value) { … }
template <>
base::Value SerializeIntoValue(const GURL& value) { … }
template <>
base::Value SerializeIntoValue(const base::TimeDelta& value) { … }
template <>
base::Value SerializeIntoValue(const absl::uint128& value) { … }
template <>
base::Value SerializeIntoValue(
const blink::AuctionConfig::AdKeywordReplacement& value) { … }
template <>
base::Value SerializeIntoValue(const double& value) { … }
template <>
base::Value SerializeIntoValue(
const AuctionConfig::NonSharedParams::AuctionReportBuyersConfig& value) { … }
template <>
base::Value SerializeIntoValue(const SellerCapabilitiesType& value) { … }
template <>
base::Value SerializeIntoValue(const base::Uuid& uuid) { … }
template <>
base::Value SerializeIntoValue(
const blink::AuctionConfig::ServerResponseConfig& server_config) { … }
template <typename T>
base::Value SerializeIntoValue(const std::vector<T>& values) { … }
template <typename T>
base::Value SerializeIntoValue(const AuctionConfig::MaybePromise<T>& promise) { … }
template <>
base::Value SerializeIntoValue(
const AuctionConfig::NonSharedParams::AuctionReportBuyerDebugModeConfig&
value) { … }
template <typename K, typename V>
base::Value SerializeIntoValue(const base::flat_map<K, V>& value) { … }
template <typename T>
base::Value::Dict SerializeSplitMapHelper(
const std::optional<T>& all_value,
const std::optional<base::flat_map<url::Origin, T>>& per_values) { … }
template <typename T>
base::Value::Dict SerializeSplitMapHelper(
const std::optional<T>& all_value,
const base::flat_map<url::Origin, T>& per_values) { … }
template <>
base::Value SerializeIntoValue(const AuctionConfig::BuyerTimeouts& in) { … }
template <>
base::Value SerializeIntoValue(const AuctionConfig::BuyerCurrencies& in) { … }
template <>
base::Value SerializeIntoValue(const AdCurrency& in) { … }
template <>
base::Value SerializeIntoValue(const AdSize& ad_size) { … }
template <>
base::Value SerializeIntoValue(
const blink::mojom::InterestGroup::ExecutionMode& in) { … }
template <>
base::Value SerializeIntoValue(const InterestGroup::AdditionalBidKey& in) { … }
template <>
base::Value SerializeIntoValue(const InterestGroup::Ad& ad) { … }
template <>
base::Value SerializeIntoValue(const AuctionServerRequestFlags& flags) { … }
template <typename T>
void SerializeIntoDict(std::string_view field,
const T& value,
base::Value::Dict& out) { … }
template <typename T>
void SerializeIntoDict(std::string_view field,
const std::optional<T>& value,
base::Value::Dict& out) { … }
void SerializeIntoDict(std::string_view field,
base::Value::Dict value,
base::Value::Dict& out) { … }
}
base::Value::Dict SerializeAuctionConfigForDevtools(const AuctionConfig& conf) { … }
base::Value::Dict SerializeInterestGroupForDevtools(const InterestGroup& ig) { … }
}