blob: 5c5fd96c1da9ef113c2bc27135969935383de865 [file] [log] [blame]
// 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 "net/base/net_export.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_constants.h"
#include "url/gurl.h"
namespace net {
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 GURL& site_for_cookies) const = 0;
private:
DISALLOW_COPY_AND_ASSIGN(CookieAccessDelegate);
};
} // namespace net
#endif // NET_COOKIES_COOKIE_ACCESS_DELEGATE_H_