Bug 1867560 [wpt PR 43456] - [FLEDGE]: Add allSlotsRequestedSizes to AuctionConfig...
[gecko.git] / caps / nsIDomainPolicy.idl
blob74d7f3b656996af5743d7aac3b8015a57bfb6fd6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsIURI;
9 interface nsIDomainSet;
11 %{ C++
12 namespace mozilla {
13 namespace dom {
14 class DomainPolicyClone;
19 [ptr] native DomainPolicyClonePtr(mozilla::dom::DomainPolicyClone);
20 [ptr] native DomainPolicyCloneConstPtr(const mozilla::dom::DomainPolicyClone);
23 * When a domain policy is instantiated by invoking activateDomainPolicy() on
24 * nsIScriptSecurityManager, these domain sets are consulted when each new
25 * global is created (they have no effect on already-created globals).
26 * If javascript is globally enabled with |javascript.enabled|, the blocklists
27 * are consulted. If globally disabled, the allowlists are consulted. Lookups
28 * on blocklist and allowlist happen with contains(), and lookups on
29 * superBlocklist and superAllowlist happen with containsSuperDomain().
31 * When deactivate() is invoked, the domain sets are emptied, and the
32 * nsIDomainPolicy ceases to have any effect on the system.
34 [scriptable, builtinclass, uuid(82b24a20-6701-4d40-a0f9-f5dc7321b555)]
35 interface nsIDomainPolicy : nsISupports
37 readonly attribute nsIDomainSet blocklist;
38 readonly attribute nsIDomainSet superBlocklist;
39 readonly attribute nsIDomainSet allowlist;
40 readonly attribute nsIDomainSet superAllowlist;
42 void deactivate();
44 [noscript, notxpcom] void cloneDomainPolicy(in DomainPolicyClonePtr aClone);
45 [noscript, notxpcom] void applyClone(in DomainPolicyCloneConstPtr aClone);
48 [scriptable, builtinclass, uuid(665c981b-0a0f-4229-ac06-a826e02d4f69)]
49 interface nsIDomainSet : nsISupports
52 * Add a domain to the set. No-op if it already exists.
54 void add(in nsIURI aDomain);
57 * Remove a domain from the set. No-op if it doesn't exist.
59 void remove(in nsIURI aDomain);
62 * Remove all entries from the set.
64 void clear();
67 * Returns true if a given domain is in the set.
69 bool contains(in nsIURI aDomain);
72 * Returns true if a given domain is a subdomain of one of the entries in
73 * the set.
75 bool containsSuperDomain(in nsIURI aDomain);