xref: /aosp_15_r20/external/cronet/net/cookies/cookie_monster_netlog_params.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2018 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_MONSTER_NETLOG_PARAMS_H_
6 #define NET_COOKIES_COOKIE_MONSTER_NETLOG_PARAMS_H_
7 
8 #include "base/values.h"
9 #include "net/cookies/canonical_cookie.h"
10 #include "net/cookies/cookie_change_dispatcher.h"
11 #include "net/cookies/cookie_monster.h"
12 #include "net/cookies/cookie_store.h"
13 #include "net/log/net_log_capture_mode.h"
14 
15 namespace net {
16 
17 // Returns a Value containing NetLog parameters for constructing
18 // a CookieMonster.
19 base::Value::Dict NetLogCookieMonsterConstructorParams(bool persistent_store);
20 
21 // Returns a Value containing NetLog parameters for adding a cookie.
22 base::Value::Dict NetLogCookieMonsterCookieAdded(
23     const CanonicalCookie* cookie,
24     bool sync_requested,
25     NetLogCaptureMode capture_mode);
26 
27 // Returns a Value containing NetLog parameters for deleting a cookie.
28 base::Value::Dict NetLogCookieMonsterCookieDeleted(
29     const CanonicalCookie* cookie,
30     CookieChangeCause cause,
31     bool sync_requested,
32     NetLogCaptureMode capture_mode);
33 
34 // Returns a Value containing NetLog parameters for when a cookie addition
35 // is rejected because of a conflict with a secure cookie.
36 base::Value::Dict NetLogCookieMonsterCookieRejectedSecure(
37     const CanonicalCookie* old_cookie,
38     const CanonicalCookie* new_cookie,
39     NetLogCaptureMode capture_mode);
40 
41 // Returns a Value containing NetLog parameters for when a cookie addition
42 // is rejected because of a conflict with an httponly cookie.
43 base::Value::Dict NetLogCookieMonsterCookieRejectedHttponly(
44     const CanonicalCookie* old_cookie,
45     const CanonicalCookie* new_cookie,
46     NetLogCaptureMode capture_mode);
47 
48 // Returns a Value containing NetLog parameters for when, upon an attempted
49 // cookie addition which is rejected due to a conflict with a secure cookie, a
50 // pre-existing cookie would have been deleted but is instead preserved because
51 // the addition failed.
52 base::Value::Dict NetLogCookieMonsterCookiePreservedSkippedSecure(
53     const CanonicalCookie* skipped_secure,
54     const CanonicalCookie* preserved,
55     const CanonicalCookie* new_cookie,
56     NetLogCaptureMode capture_mode);
57 
58 }  // namespace net
59 
60 #endif  // NET_COOKIES_COOKIE_MONSTER_NETLOG_PARAMS_H_
61