toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     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"
     7 #include "nsIFile.idl"
     9 // Note that the PrefixSet name is historical and we do properly support
    10 // duplicated values, so it's really a Prefix Trie.
    11 // All methods are thread-safe.
    12 [scriptable, uuid(3d8579f0-75fa-4e00-ba41-38661d5b5d17)]
    13 interface nsIUrlClassifierPrefixSet : nsISupports
    14 {
    15   // Initialize the PrefixSet. Give it a name for memory reporting.
    16   void init(in ACString aName);
    17   // Fills the PrefixSet with the given array of prefixes.
    18   // Can send an empty Array to clear the tree.
    19   // Requires array to be sorted.
    20   void setPrefixes([const, array, size_is(aLength)] in unsigned long aPrefixes,
    21                    in unsigned long aLength);
    22   void getPrefixes(out unsigned long aCount,
    23                   [array, size_is(aCount), retval] out unsigned long aPrefixes);
    24   // Do a lookup in the PrefixSet, return whether the value is present.
    25   boolean contains(in unsigned long aPrefix);
    26   boolean isEmpty();
    27   void loadFromFile(in nsIFile aFile);
    28   void storeToFile(in nsIFile aFile);
    29 };

mercurial