blob: 5c5fd96c1da9ef113c2bc27135969935383de865 [file] [log] [blame]
Lily Chenab36a112019-09-19 20:17:281// 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 Chen0db055b2019-11-15 20:29:0211#include "url/gurl.h"
Lily Chenab36a112019-09-19 20:17:2812
13namespace net {
14
15class 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 Chen0db055b2019-11-15 20:29:0225 // 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 Chenab36a112019-09-19 20:17:2831 private:
32 DISALLOW_COPY_AND_ASSIGN(CookieAccessDelegate);
33};
34
35} // namespace net
36
37#endif // NET_COOKIES_COOKIE_ACCESS_DELEGATE_H_