Introduce FirstPartySetEntry class to hold site metadata.
This CL does not change any behavior; it just introduces a new class
which will hold metadata associated with a given site in a First-Party
Set. This metadata used to just be the set's owner domain; but in the
future, this may contain things like the site's role in the set,
whether it is in a set that was defined by an enterprise policy, etc.
Bug: 1349781
Change-Id: I89e399692b574b03dea3af8bfc98ac795d28adae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3791957
Reviewed-by: Maks Orlovich <[email protected]>
Reviewed-by: Will Harris <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Chris Fredrickson <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1031576}
diff --git a/net/cookies/cookie_access_delegate.h b/net/cookies/cookie_access_delegate.h
index 76b4d59..1de6b03 100644
--- a/net/cookies/cookie_access_delegate.h
+++ b/net/cookies/cookie_access_delegate.h
@@ -15,6 +15,7 @@
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_partition_key.h"
+#include "net/cookies/first_party_set_entry.h"
#include "net/cookies/first_party_set_metadata.h"
#include "net/cookies/same_party_context.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@@ -74,11 +75,11 @@
// with the result. The callback will be invoked iff the return value is
// nullopt; i.e. a result will be provided via return value or callback, but
// not both, and not neither.
- [[nodiscard]] virtual absl::optional<absl::optional<net::SchemefulSite>>
+ [[nodiscard]] virtual absl::optional<absl::optional<net::FirstPartySetEntry>>
FindFirstPartySetOwner(
const net::SchemefulSite& site,
- base::OnceCallback<void(absl::optional<net::SchemefulSite>)> callback)
- const = 0;
+ base::OnceCallback<void(absl::optional<net::FirstPartySetEntry>)>
+ callback) const = 0;
// Computes the owners of a set of sites' First-Party Sets if the site are in
// non-trivial sets. If a given site is not in a non-trivial set, the output
@@ -89,12 +90,12 @@
// nullopt; i.e. a result will be provided via return value or callback, but
// not both, and not neither.
[[nodiscard]] virtual absl::optional<
- base::flat_map<net::SchemefulSite, net::SchemefulSite>>
+ base::flat_map<net::SchemefulSite, net::FirstPartySetEntry>>
FindFirstPartySetOwners(
const base::flat_set<net::SchemefulSite>& sites,
- base::OnceCallback<void(
- base::flat_map<net::SchemefulSite, net::SchemefulSite>)> callback)
- const = 0;
+ base::OnceCallback<
+ void(base::flat_map<net::SchemefulSite, net::FirstPartySetEntry>)>
+ callback) const = 0;
// Converts the CookiePartitionKey's site to its First-Party Set owner if
// the site is in a nontrivial set.