#pragma once
#include "WebCookieCache.h"
#include <WebCore/CookieJar.h>
namespace WebCore {
struct Cookie;
}
namespace WebKit {
class WebFrame;
class WebCookieJar final : public WebCore::CookieJar {
public:
static Ref<WebCookieJar> create() { return adoptRef(*new WebCookieJar); }
String cookies(WebCore::Document&, const URL&) const final;
void setCookies(WebCore::Document&, const URL&, const String& cookieString) final;
bool cookiesEnabled(const WebCore::Document&) const final;
std::pair<String, WebCore::SecureCookiesAccessed> cookieRequestHeaderFieldValue(const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<WebCore::FrameIdentifier>, Optional<WebCore::PageIdentifier>, WebCore::IncludeSecureCookies) const final;
bool getRawCookies(const WebCore::Document&, const URL&, Vector<WebCore::Cookie>&) const final;
void setRawCookie(const WebCore::Document&, const WebCore::Cookie&) final;
void deleteCookie(const WebCore::Document&, const URL&, const String& cookieName) final;
void cookiesAdded(const String& host, const Vector<WebCore::Cookie>&);
void cookiesDeleted(const String& host, const Vector<WebCore::Cookie>&);
void allCookiesDeleted();
private:
WebCookieJar();
void clearCache() final;
void clearCacheForHost(const String&) final;
bool isEligibleForCache(WebFrame&, const URL& firstPartyForCookies, const URL& resourceURL) const;
mutable WebCookieCache m_cache;
};
}