forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcookie_access_observer.mojom
53 lines (44 loc) · 2.13 KB
/
cookie_access_observer.mojom
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2020 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.
module network.mojom;
import "url/mojom/url.mojom";
import "services/network/public/mojom/site_for_cookies.mojom";
import "services/network/public/mojom/cookie_manager.mojom";
struct CookieAccessDetails {
enum Type {
kRead,
kChange,
};
// Whether this request corresponds to a cookie read or a cookie write.
Type type;
// If the cookies are accessed by a network transfer, |url| is the URL being
// loaded; if they're read by a script, it's the URL of window or service
// worker script looking them up.
url.mojom.Url url;
SiteForCookies site_for_cookies;
// Each element of the `cookie_list` array includes a CookieInclusionStatus
// and a CanonicalCookie if one was successfully constructed; if we were
// unable to create the CanonicalCookie, then we use the cookie string
// instead. Note that this means we always get a CanonicalCookie for reads,
// but may get a cookie string on writes.
array<CookieOrLineWithAccessResult> cookie_list;
// |devtools_request_id| contains the DevTools request id of the request
// that triggered the cookie change, if the read was triggered by a request.
string? devtools_request_id;
};
// Cloneable interface to observe the cookie reads or writes.
// The user of the NetworkService should create a dedicated
// CookieAccessObserver for each context it is interested in.
interface CookieAccessObserver {
// Called when an attempt has been made to access (read or write) the cookies
// in |details.cookie_list|, with the status indicating cookies were actually
// used or blocked, and if so, gives the reason. Currently blocked cookies
// are included if they are blocked by user preference, or if they warrant
// a console deprecation warning.
OnCookiesAccessed(CookieAccessDetails details);
// Used by the NetworkService to create a copy of this observer.
// (e.g. when creating an observer for URLLoader from URLLoaderFactory's
// observer).
Clone(pending_receiver<CookieAccessObserver> listener);
};