nsICookieNotification.idl (2743B)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 * 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #include "nsISupports.idl" 8 9 interface nsICookie; 10 interface nsIArray; 11 webidl BrowsingContext; 12 13 /** 14 * Meta object dispatched by cookie change notifications. 15 */ 16 [builtinclass, scriptable, uuid(5b3490f2-75f0-4e36-9f3d-47c857ecdfbb)] 17 interface nsICookieNotification : nsISupports { 18 19 cenum Action : 8 { 20 // A cookie was deleted. cookie contains the deleted cookie. 21 COOKIE_DELETED, 22 // A cookie was added. cookie contains the added cookie. 23 COOKIE_ADDED, 24 // A cookie was altered. cookie contains the updated version of the 25 // cookie. Note that host, path, and name are invariant for a given 26 // cookie; other parameters may change. 27 COOKIE_CHANGED, 28 // the entire cookie list was cleared. cookie is null. 29 ALL_COOKIES_CLEARED, 30 // A set of cookies was purged. batchDeletedCookies contains the list of 31 // deleted cookies. cookie is null. 32 // Purging typically affects expired cookies or cases where the cookie 33 // list grows too large. 34 COOKIES_BATCH_DELETED, 35 }; 36 37 /** 38 * Describes the cookie operation this notification is for. Cookies may be 39 * deleted, added or changed. See Action enum above for possible values. 40 */ 41 [infallible] readonly attribute nsICookieNotification_Action action; 42 43 44 /** 45 * The cookie the notification is for, may be null depending on the action. 46 */ 47 [infallible] readonly attribute nsICookie cookie; 48 49 /** 50 * Base domain of the cookie. May be empty if cookie is null. 51 */ 52 readonly attribute ACString baseDomain; 53 54 /** 55 * True if the cookie set (added or changed) is considered third-party. 56 */ 57 [infallible] readonly attribute boolean isThirdParty; 58 59 /** 60 * List of cookies purged. 61 * Only set when action == COOKIES_BATCH_DELETED. 62 */ 63 readonly attribute nsIArray batchDeletedCookies; 64 65 /** 66 * The id of the BrowsingContext the cookie change was triggered from. Set 67 * to 0 if there is not applicable BrowsingContext. 68 */ 69 [infallible] readonly attribute unsigned long long browsingContextId; 70 71 /** 72 * BrowsingContext associated with browsingContextId. May be nullptr. 73 */ 74 [infallible] readonly attribute BrowsingContext browsingContext; 75 76 /** 77 * Operation ID to track which nsICookieManager operation has generated 78 * this notification. 79 */ 80 readonly attribute nsIDPtr operationID; 81 };