#include "net/cookies/cookie_monster_change_dispatcher.h"
#include <string_view>
#include <utility>
#include "base/functional/bind.h"
#include "base/not_fatal_until.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/task_runner.h"
#include "net/base/features.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_access_delegate.h"
#include "net/cookies/cookie_change_dispatcher.h"
#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_monster.h"
#include "net/cookies/cookie_util.h"
namespace net {
namespace {
constexpr std::string_view kGlobalDomainKey = …;
constexpr std::string_view kGlobalNameKey = …;
}
CookieMonsterChangeDispatcher::Subscription::Subscription(
base::WeakPtr<CookieMonsterChangeDispatcher> change_dispatcher,
std::string domain_key,
std::string name_key,
GURL url,
CookiePartitionKeyCollection cookie_partition_key_collection,
net::CookieChangeCallback callback)
: … { … }
CookieMonsterChangeDispatcher::Subscription::~Subscription() { … }
void CookieMonsterChangeDispatcher::Subscription::DispatchChange(
const CookieChangeInfo& change,
const CookieAccessDelegate* cookie_access_delegate) { … }
void CookieMonsterChangeDispatcher::Subscription::DoDispatchChange(
const CookieChangeInfo& change) const { … }
CookieMonsterChangeDispatcher::CookieMonsterChangeDispatcher(
const CookieMonster* cookie_monster)
: … { … }
CookieMonsterChangeDispatcher::~CookieMonsterChangeDispatcher() { … }
std::string CookieMonsterChangeDispatcher::DomainKey(
const std::string& domain) { … }
std::string CookieMonsterChangeDispatcher::DomainKey(const GURL& url) { … }
std::string CookieMonsterChangeDispatcher::NameKey(std::string name) { … }
std::unique_ptr<CookieChangeSubscription>
CookieMonsterChangeDispatcher::AddCallbackForCookie(
const GURL& url,
const std::string& name,
const std::optional<CookiePartitionKey>& cookie_partition_key,
CookieChangeCallback callback) { … }
std::unique_ptr<CookieChangeSubscription>
CookieMonsterChangeDispatcher::AddCallbackForUrl(
const GURL& url,
const std::optional<CookiePartitionKey>& cookie_partition_key,
CookieChangeCallback callback) { … }
std::unique_ptr<CookieChangeSubscription>
CookieMonsterChangeDispatcher::AddCallbackForAllChanges(
CookieChangeCallback callback) { … }
void CookieMonsterChangeDispatcher::DispatchChange(
const CookieChangeInfo& change,
bool notify_global_hooks) { … }
void CookieMonsterChangeDispatcher::DispatchChangeToDomainKey(
const CookieChangeInfo& change,
const std::string& domain_key) { … }
void CookieMonsterChangeDispatcher::DispatchChangeToNameKey(
const CookieChangeInfo& change,
CookieNameMap& cookie_name_map,
const std::string& name_key) { … }
void CookieMonsterChangeDispatcher::LinkSubscription(
Subscription* subscription) { … }
void CookieMonsterChangeDispatcher::UnlinkSubscription(
Subscription* subscription) { … }
}