#include "net/cookies/cookie_partition_key.h"
#include <ostream>
#include <tuple>
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/types/optional_util.h"
#include "net/base/cronet_buildflags.h"
#include "net/base/features.h"
#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_util.h"
#include "net/cookies/site_for_cookies.h"
#if !BUILDFLAG(CRONET_BUILD)
#include "mojo/public/cpp/bindings/default_construct_tag.h"
#endif
namespace net {
namespace {
base::unexpected<std::string> WarnAndCreateUnexpected(
const std::string& message) { … }
std::string SerializeSchemefulSite(const SchemefulSite& site) { … }
}
CookiePartitionKey::SerializedCookiePartitionKey::SerializedCookiePartitionKey(
base::PassKey<CookiePartitionKey> key,
const std::string& site,
bool has_cross_site_ancestor)
: … { … }
const std::string&
CookiePartitionKey::SerializedCookiePartitionKey::TopLevelSite() const { … }
std::string CookiePartitionKey::SerializedCookiePartitionKey::GetDebugString()
const { … }
#if !BUILDFLAG(CRONET_BUILD)
CookiePartitionKey::CookiePartitionKey(mojo::DefaultConstruct::Tag) { … }
#endif
bool CookiePartitionKey::SerializedCookiePartitionKey::has_cross_site_ancestor()
const { … }
CookiePartitionKey::AncestorChainBit CookiePartitionKey::BoolToAncestorChainBit(
bool cross_site) { … }
CookiePartitionKey::CookiePartitionKey(
const SchemefulSite& site,
std::optional<base::UnguessableToken> nonce,
AncestorChainBit ancestor_chain_bit)
: … { … }
CookiePartitionKey::CookiePartitionKey(bool from_script)
: … { … }
CookiePartitionKey::CookiePartitionKey(const CookiePartitionKey& other) =
default;
CookiePartitionKey::CookiePartitionKey(CookiePartitionKey&& other) = default;
CookiePartitionKey& CookiePartitionKey::operator=(
const CookiePartitionKey& other) = default;
CookiePartitionKey& CookiePartitionKey::operator=(CookiePartitionKey&& other) =
default;
CookiePartitionKey::~CookiePartitionKey() = default;
bool CookiePartitionKey::operator==(const CookiePartitionKey& other) const { … }
bool CookiePartitionKey::operator!=(const CookiePartitionKey& other) const { … }
bool CookiePartitionKey::operator<(const CookiePartitionKey& other) const { … }
base::expected<CookiePartitionKey::SerializedCookiePartitionKey, std::string>
CookiePartitionKey::Serialize(const std::optional<CookiePartitionKey>& in) { … }
std::optional<CookiePartitionKey> CookiePartitionKey::FromNetworkIsolationKey(
const NetworkIsolationKey& network_isolation_key,
const SiteForCookies& site_for_cookies,
const SchemefulSite& request_site,
bool main_frame_navigation) { … }
std::optional<CookiePartitionKey> CookiePartitionKey::FromStorageKeyComponents(
const SchemefulSite& site,
AncestorChainBit ancestor_chain_bit,
const std::optional<base::UnguessableToken>& nonce) { … }
base::expected<std::optional<CookiePartitionKey>, std::string>
CookiePartitionKey::FromStorage(const std::string& top_level_site,
bool has_cross_site_ancestor) { … }
base::expected<CookiePartitionKey, std::string>
CookiePartitionKey::FromUntrustedInput(const std::string& top_level_site,
bool has_cross_site_ancestor) { … }
base::expected<CookiePartitionKey, std::string>
CookiePartitionKey::DeserializeInternal(
const std::string& top_level_site,
CookiePartitionKey::AncestorChainBit has_cross_site_ancestor,
CookiePartitionKey::ParsingMode parsing_mode) { … }
bool CookiePartitionKey::IsSerializeable() const { … }
CookiePartitionKey::AncestorChainBit CookiePartitionKey::MaybeAncestorChainBit()
const { … }
std::ostream& operator<<(std::ostream& os, const CookiePartitionKey& cpk) { … }
}