#include "content/browser/interest_group/header_direct_from_seller_signals.h"
#include <functional>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/json/json_string_value_serializer.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "base/values.h"
#include "services/data_decoder/public/cpp/data_decoder.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "url/url_constants.h"
namespace content {
namespace {
size_t GetResultSizeBytes(const HeaderDirectFromSellerSignals::Result& result) { … }
}
HeaderDirectFromSellerSignals::Result::Result() = default;
HeaderDirectFromSellerSignals::Result::Result(
std::optional<std::string> seller_signals,
std::optional<std::string> auction_signals,
base::flat_map<url::Origin, std::string> per_buyer_signals)
: … { … }
HeaderDirectFromSellerSignals::Result::~Result() = default;
HeaderDirectFromSellerSignals::HeaderDirectFromSellerSignals() = default;
HeaderDirectFromSellerSignals::~HeaderDirectFromSellerSignals() { … }
void HeaderDirectFromSellerSignals::ParseAndFind(
const url::Origin& origin,
const std::string& ad_slot,
ParseAndFindCompletedCallback callback) { … }
void HeaderDirectFromSellerSignals::AddWitnessForOrigin(
data_decoder::DataDecoder& decoder,
const url::Origin& origin,
const std::string& response,
AddWitnessForOriginCompletedCallback callback) { … }
HeaderDirectFromSellerSignals::ParseAndFindCompletedInfo::
ParseAndFindCompletedInfo(base::TimeTicks start_time,
url::Origin origin,
std::string ad_slot,
ParseAndFindCompletedCallback callback)
: … { … }
HeaderDirectFromSellerSignals::ParseAndFindCompletedInfo::
~ParseAndFindCompletedInfo() = default;
HeaderDirectFromSellerSignals::ParseAndFindCompletedInfo::
ParseAndFindCompletedInfo(ParseAndFindCompletedInfo&&) = default;
HeaderDirectFromSellerSignals::ParseAndFindCompletedInfo&
HeaderDirectFromSellerSignals::ParseAndFindCompletedInfo::operator=(
HeaderDirectFromSellerSignals::ParseAndFindCompletedInfo&&) = default;
void HeaderDirectFromSellerSignals::ParseAndFindCompleted(
ParseAndFindCompletedInfo info) const { … }
void HeaderDirectFromSellerSignals::ProcessOneResponse(
const data_decoder::DataDecoder::ValueOrError& result,
const UnprocessedResponse& unprocessed_response,
std::vector<std::string>& errors) { … }
void HeaderDirectFromSellerSignals::OnJsonDecoded(
data_decoder::DataDecoder& decoder,
UnprocessedResponse current_unprocessed_response,
std::vector<std::string> errors,
base::TimeTicks parse_start_time,
data_decoder::DataDecoder::ValueOrError result) { … }
void HeaderDirectFromSellerSignals::DecodeNextResponse(
data_decoder::DataDecoder& decoder,
std::vector<std::string> errors) { … }
}