Lily Chen | ab36a11 | 2019-09-19 20:17:28 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef NET_COOKIES_COOKIE_ACCESS_DELEGATE_H_ |
| 6 | #define NET_COOKIES_COOKIE_ACCESS_DELEGATE_H_ |
| 7 | |
| 8 | #include "net/base/net_export.h" |
| 9 | #include "net/cookies/canonical_cookie.h" |
| 10 | #include "net/cookies/cookie_constants.h" |
Lily Chen | 0db055b | 2019-11-15 20:29:02 | [diff] [blame^] | 11 | #include "url/gurl.h" |
Lily Chen | ab36a11 | 2019-09-19 20:17:28 | [diff] [blame] | 12 | |
| 13 | namespace net { |
| 14 | |
| 15 | class NET_EXPORT CookieAccessDelegate { |
| 16 | public: |
| 17 | CookieAccessDelegate(); |
| 18 | virtual ~CookieAccessDelegate(); |
| 19 | |
| 20 | // Gets the access semantics to apply to |cookie|, based on its domain (i.e., |
| 21 | // whether a policy specifies that legacy access semantics should apply). |
| 22 | virtual CookieAccessSemantics GetAccessSemantics( |
| 23 | const CanonicalCookie& cookie) const = 0; |
| 24 | |
Lily Chen | 0db055b | 2019-11-15 20:29:02 | [diff] [blame^] | 25 | // Returns whether a cookie should be attached regardless of its SameSite |
| 26 | // value vs the request context. |
| 27 | virtual bool ShouldIgnoreSameSiteRestrictions( |
| 28 | const GURL& url, |
| 29 | const GURL& site_for_cookies) const = 0; |
| 30 | |
Lily Chen | ab36a11 | 2019-09-19 20:17:28 | [diff] [blame] | 31 | private: |
| 32 | DISALLOW_COPY_AND_ASSIGN(CookieAccessDelegate); |
| 33 | }; |
| 34 | |
| 35 | } // namespace net |
| 36 | |
| 37 | #endif // NET_COOKIES_COOKIE_ACCESS_DELEGATE_H_ |