• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 The Chromium Authors
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_SETTING_OVERRIDE_H_
6 #define NET_COOKIES_COOKIE_SETTING_OVERRIDE_H_
7 
8 #include "base/containers/enum_set.h"
9 
10 namespace net {
11 
12 // An enum of possible overrides for cookie setting checks.
13 // Use CookieSettingOverrides below for specifying any number of overrides
14 // together. The notion of no overrides is conveyable via an empty set.
15 enum class CookieSettingOverride {
16   kMinValue = 0,
17   // When specified, third-party cookies may be allowed based on existence of
18   // TopLevelStorageAccess grants.
19   kTopLevelStorageAccessGrantEligible = kMinValue,
20   // When present, the caller may use an existing Storage Access API grant (if
21   // a matching grant exists) to access third-party cookies. Otherwise, Storage
22   // Access API grants do not apply.
23   kStorageAccessGrantEligible = 1,
24   // Allows TPCD mitigations to be skipped when checking if third party cookies
25   // are allowed, meaning cookies will be blocked despite the presence of any of
26   // these grants/heuristics.
27   kSkipTPCDHeuristicsGrant = 2,
28   // Corresponds to skipping checks on the TPCD_SUPPORT content setting, which
29   // backs 3PC accesses granted via 3PC deprecation trial.
30   kSkipTPCDSupport = 3,
31   kSkipTPCDMetadataGrant = 4,
32 
33   kMaxValue = kSkipTPCDMetadataGrant,
34 };
35 
36 using CookieSettingOverrides = base::EnumSet<CookieSettingOverride,
37                                              CookieSettingOverride::kMinValue,
38                                              CookieSettingOverride::kMaxValue>;
39 
40 }  // namespace net
41 
42 #endif  // NET_COOKIES_COOKIE_SETTING_OVERRIDE_H_
43