#include "services/network/first_party_sets/first_party_sets_access_delegate.h"
#include <utility>
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "base/types/optional_util.h"
#include "net/base/features.h"
#include "net/base/schemeful_site.h"
#include "net/first_party_sets/first_party_set_metadata.h"
#include "net/first_party_sets/first_party_sets_cache_filter.h"
#include "net/first_party_sets/first_party_sets_context_config.h"
#include "services/network/public/mojom/first_party_sets_access_delegate.mojom-forward.h"
namespace network {
namespace {
bool IsEnabled(const mojom::FirstPartySetsAccessDelegateParamsPtr& params) { … }
}
FirstPartySetsAccessDelegate::FirstPartySetsAccessDelegate(
mojo::PendingReceiver<mojom::FirstPartySetsAccessDelegate> receiver,
mojom::FirstPartySetsAccessDelegateParamsPtr params,
FirstPartySetsManager* const manager)
: … { … }
FirstPartySetsAccessDelegate::~FirstPartySetsAccessDelegate() = default;
void FirstPartySetsAccessDelegate::NotifyReady(
mojom::FirstPartySetsReadyEventPtr ready_event) { … }
void FirstPartySetsAccessDelegate::SetEnabled(bool enabled) { … }
std::optional<std::pair<net::FirstPartySetMetadata,
net::FirstPartySetsCacheFilter::MatchInfo>>
FirstPartySetsAccessDelegate::ComputeMetadata(
const net::SchemefulSite& site,
const net::SchemefulSite* top_frame_site,
base::OnceCallback<void(net::FirstPartySetMetadata,
net::FirstPartySetsCacheFilter::MatchInfo)>
callback) { … }
std::optional<FirstPartySetsAccessDelegate::EntriesResult>
FirstPartySetsAccessDelegate::FindEntries(
const base::flat_set<net::SchemefulSite>& sites,
base::OnceCallback<void(FirstPartySetsAccessDelegate::EntriesResult)>
callback) { … }
void FirstPartySetsAccessDelegate::ComputeMetadataAndInvoke(
const net::SchemefulSite& site,
const std::optional<net::SchemefulSite> top_frame_site,
base::OnceCallback<void(net::FirstPartySetMetadata,
net::FirstPartySetsCacheFilter::MatchInfo)>
callback) const { … }
void FirstPartySetsAccessDelegate::FindEntriesAndInvoke(
const base::flat_set<net::SchemefulSite>& sites,
base::OnceCallback<void(FirstPartySetsAccessDelegate::EntriesResult)>
callback) const { … }
void FirstPartySetsAccessDelegate::InvokePendingQueries() { … }
void FirstPartySetsAccessDelegate::EnqueuePendingQuery(
base::OnceClosure run_query) { … }
}