#include "net/cookies/cookie_base.h"
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/strings/strcat.h"
#include "net/base/features.h"
#include "net/cookies/cookie_inclusion_status.h"
#include "net/cookies/cookie_util.h"
namespace net {
namespace {
bool IsBreakingStrictToLaxDowngrade(
CookieOptions::SameSiteCookieContext::ContextType context,
CookieOptions::SameSiteCookieContext::ContextType schemeful_context,
CookieEffectiveSameSite effective_same_site,
bool is_cookie_being_set) { … }
bool IsBreakingStrictToCrossDowngrade(
CookieOptions::SameSiteCookieContext::ContextType context,
CookieOptions::SameSiteCookieContext::ContextType schemeful_context,
CookieEffectiveSameSite effective_same_site) { … }
bool IsBreakingLaxToCrossDowngrade(
CookieOptions::SameSiteCookieContext::ContextType context,
CookieOptions::SameSiteCookieContext::ContextType schemeful_context,
CookieEffectiveSameSite effective_same_site,
bool is_cookie_being_set) { … }
void ApplySameSiteCookieWarningToStatus(
CookieSameSite samesite,
CookieEffectiveSameSite effective_samesite,
bool is_secure,
const CookieOptions::SameSiteCookieContext& same_site_context,
CookieInclusionStatus* status,
bool is_cookie_being_set) { … }
}
CookieAccessResult CookieBase::IncludeForRequestURL(
const GURL& url,
const CookieOptions& options,
const CookieAccessParams& params) const { … }
CookieAccessResult CookieBase::IsSetPermittedInContext(
const GURL& source_url,
const CookieOptions& options,
const CookieAccessParams& params,
const std::vector<std::string>& cookieable_schemes,
const std::optional<CookieAccessResult>& cookie_access_result) const { … }
bool CookieBase::IsOnPath(const std::string& url_path) const { … }
bool CookieBase::IsDomainMatch(const std::string& host) const { … }
bool CookieBase::IsSecure() const { … }
bool CookieBase::IsFirstPartyPartitioned() const { … }
bool CookieBase::IsThirdPartyPartitioned() const { … }
std::string CookieBase::DomainWithoutDot() const { … }
CookieBase::UniqueCookieKey CookieBase::UniqueKey() const { … }
CookieBase::UniqueDomainCookieKey CookieBase::UniqueDomainKey() const { … }
void CookieBase::SetSourcePort(int port) { … }
CookieBase::CookieBase() = default;
CookieBase::CookieBase(const CookieBase& other) = default;
CookieBase::CookieBase(CookieBase&& other) = default;
CookieBase& CookieBase::operator=(const CookieBase& other) = default;
CookieBase& CookieBase::operator=(CookieBase&& other) = default;
CookieBase::~CookieBase() = default;
CookieBase::CookieBase(std::string name,
std::string domain,
std::string path,
base::Time creation,
bool secure,
bool httponly,
CookieSameSite same_site,
std::optional<CookiePartitionKey> partition_key,
CookieSourceScheme source_scheme,
int source_port)
: … { … }
CookieEffectiveSameSite CookieBase::GetEffectiveSameSite(
CookieAccessSemantics access_semantics) const { … }
base::TimeDelta CookieBase::GetLaxAllowUnsafeThresholdAge() const { … }
bool CookieBase::IsRecentlyCreated(base::TimeDelta age_threshold) const { … }
int CookieBase::ValidateAndAdjustSourcePort(int port) { … }
}