caps/idl/nsIDomainPolicy.idl

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7
michael@0 8 interface nsIURI;
michael@0 9 interface nsIDomainSet;
michael@0 10
michael@0 11 /*
michael@0 12 * When a domain policy is instantiated by invoking activateDomainPolicy() on
michael@0 13 * nsIScriptSecurityManager, these domain sets are consulted when each new
michael@0 14 * global is created (they have no effect on already-created globals).
michael@0 15 * If javascript is globally enabled with |javascript.enabled|, the blacklists
michael@0 16 * are consulted. If globally disabled, the whitelists are consulted. Lookups
michael@0 17 * on blacklist and whitelist happen with contains(), and lookups on
michael@0 18 * superBlacklist and superWhitelist happen with containsSuperDomain().
michael@0 19 *
michael@0 20 * When deactivate() is invoked, the domain sets are emptied, and the
michael@0 21 * nsIDomainPolicy ceases to have any effect on the system.
michael@0 22 */
michael@0 23 [scriptable, builtinclass, uuid(27b10f54-f34b-42b7-8594-4348d3ad7953)]
michael@0 24 interface nsIDomainPolicy : nsISupports
michael@0 25 {
michael@0 26 readonly attribute nsIDomainSet blacklist;
michael@0 27 readonly attribute nsIDomainSet superBlacklist;
michael@0 28 readonly attribute nsIDomainSet whitelist;
michael@0 29 readonly attribute nsIDomainSet superWhitelist;
michael@0 30
michael@0 31 void deactivate();
michael@0 32 };
michael@0 33
michael@0 34 [scriptable, builtinclass, uuid(946a01ff-6525-4007-a2c2-447ebe1875d3)]
michael@0 35 interface nsIDomainSet : nsISupports
michael@0 36 {
michael@0 37 /*
michael@0 38 * Add a domain to the set. No-op if it already exists.
michael@0 39 */
michael@0 40 void add(in nsIURI aDomain);
michael@0 41
michael@0 42 /*
michael@0 43 * Remove a domain from the set. No-op if it doesn't exist.
michael@0 44 */
michael@0 45 void remove(in nsIURI aDomain);
michael@0 46
michael@0 47 /*
michael@0 48 * Remove all entries from the set.
michael@0 49 */
michael@0 50 void clear();
michael@0 51
michael@0 52 /*
michael@0 53 * Returns true if a given domain is in the set.
michael@0 54 */
michael@0 55 bool contains(in nsIURI aDomain);
michael@0 56
michael@0 57 /*
michael@0 58 * Returns true if a given domain is a subdomain of one of the entries in
michael@0 59 * the set.
michael@0 60 */
michael@0 61 bool containsSuperDomain(in nsIURI aDomain);
michael@0 62 };

mercurial