// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_COOKIES_COOKIE_ACCESS_DELEGATE_H_ #define NET_COOKIES_COOKIE_ACCESS_DELEGATE_H_ #include "base/callback_forward.h" #include "net/base/net_export.h" #include "net/cookies/canonical_cookie.h" #include "net/cookies/cookie_constants.h" #include "url/gurl.h" namespace net { class SiteForCookies; class NET_EXPORT CookieAccessDelegate { public: CookieAccessDelegate(); virtual ~CookieAccessDelegate(); // Gets the access semantics to apply to |cookie|, based on its domain (i.e., // whether a policy specifies that legacy access semantics should apply). virtual CookieAccessSemantics GetAccessSemantics( const CanonicalCookie& cookie) const = 0; // Returns whether a cookie should be attached regardless of its SameSite // value vs the request context. virtual bool ShouldIgnoreSameSiteRestrictions( const GURL& url, const SiteForCookies& site_for_cookies) const = 0; virtual void AllowedByFilter( const GURL& url, const SiteForCookies& site_for_cookies, base::OnceCallback callback) const = 0; private: DISALLOW_COPY_AND_ASSIGN(CookieAccessDelegate); }; } // namespace net #endif // NET_COOKIES_COOKIE_ACCESS_DELEGATE_H_