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.

     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 /*
    12  * When a domain policy is instantiated by invoking activateDomainPolicy() on
    13  * nsIScriptSecurityManager, these domain sets are consulted when each new
    14  * global is created (they have no effect on already-created globals).
    15  * If javascript is globally enabled with |javascript.enabled|, the blacklists
    16  * are consulted. If globally disabled, the whitelists are consulted. Lookups
    17  * on blacklist and whitelist happen with contains(), and lookups on
    18  * superBlacklist and superWhitelist happen with containsSuperDomain().
    19  *
    20  * When deactivate() is invoked, the domain sets are emptied, and the
    21  * nsIDomainPolicy ceases to have any effect on the system.
    22  */
    23 [scriptable, builtinclass, uuid(27b10f54-f34b-42b7-8594-4348d3ad7953)]
    24 interface nsIDomainPolicy : nsISupports
    25 {
    26     readonly attribute nsIDomainSet blacklist;
    27     readonly attribute nsIDomainSet superBlacklist;
    28     readonly attribute nsIDomainSet whitelist;
    29     readonly attribute nsIDomainSet superWhitelist;
    31     void deactivate();
    32 };
    34 [scriptable, builtinclass, uuid(946a01ff-6525-4007-a2c2-447ebe1875d3)]
    35 interface nsIDomainSet : nsISupports
    36 {
    37     /*
    38      * Add a domain to the set. No-op if it already exists.
    39      */
    40     void add(in nsIURI aDomain);
    42     /*
    43      * Remove a domain from the set. No-op if it doesn't exist.
    44      */
    45     void remove(in nsIURI aDomain);
    47     /*
    48      * Remove all entries from the set.
    49      */
    50     void clear();
    52     /*
    53      * Returns true if a given domain is in the set.
    54      */
    55     bool contains(in nsIURI aDomain);
    57     /*
    58      * Returns true if a given domain is a subdomain of one of the entries in
    59      * the set.
    60      */
    61     bool containsSuperDomain(in nsIURI aDomain);
    62 };

mercurial