#include "content/browser/aggregation_service/aggregation_service_network_fetcher_impl.h"
#include <memory>
#include <optional>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/clock.h"
#include "base/time/time.h"
#include "content/browser/aggregation_service/public_key_parsing_utils.h"
#include "content/public/browser/storage_partition.h"
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/data_decoder/public/cpp/data_decoder.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "url/gurl.h"
namespace content {
AggregationServiceNetworkFetcherImpl::AggregationServiceNetworkFetcherImpl(
const base::Clock* clock,
StoragePartition* storage_partition)
: … { … }
AggregationServiceNetworkFetcherImpl::AggregationServiceNetworkFetcherImpl(
const base::Clock* clock,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
bool enable_debug_logging)
: … { … }
AggregationServiceNetworkFetcherImpl::~AggregationServiceNetworkFetcherImpl() =
default;
std::unique_ptr<AggregationServiceNetworkFetcherImpl>
AggregationServiceNetworkFetcherImpl::CreateForTesting(
const base::Clock* clock,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
bool enable_debug_logging) { … }
void AggregationServiceNetworkFetcherImpl::FetchPublicKeys(
const GURL& url,
NetworkFetchCallback callback) { … }
void AggregationServiceNetworkFetcherImpl::OnSimpleLoaderComplete(
UrlLoaderList::iterator it,
const GURL& url,
NetworkFetchCallback callback,
std::unique_ptr<std::string> response_body) { … }
void AggregationServiceNetworkFetcherImpl::OnJsonParse(
const GURL& url,
NetworkFetchCallback callback,
base::Time fetch_time,
base::Time expiry_time,
data_decoder::DataDecoder::ValueOrError result) { … }
void AggregationServiceNetworkFetcherImpl::OnError(
const GURL& url,
NetworkFetchCallback callback,
FetchStatus error,
std::string_view error_msg) { … }
void AggregationServiceNetworkFetcherImpl::RecordFetchStatus(
FetchStatus status) const { … }
}