1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,29 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 +#include "nsIFile.idl" 1.11 + 1.12 +// Note that the PrefixSet name is historical and we do properly support 1.13 +// duplicated values, so it's really a Prefix Trie. 1.14 +// All methods are thread-safe. 1.15 +[scriptable, uuid(3d8579f0-75fa-4e00-ba41-38661d5b5d17)] 1.16 +interface nsIUrlClassifierPrefixSet : nsISupports 1.17 +{ 1.18 + // Initialize the PrefixSet. Give it a name for memory reporting. 1.19 + void init(in ACString aName); 1.20 + // Fills the PrefixSet with the given array of prefixes. 1.21 + // Can send an empty Array to clear the tree. 1.22 + // Requires array to be sorted. 1.23 + void setPrefixes([const, array, size_is(aLength)] in unsigned long aPrefixes, 1.24 + in unsigned long aLength); 1.25 + void getPrefixes(out unsigned long aCount, 1.26 + [array, size_is(aCount), retval] out unsigned long aPrefixes); 1.27 + // Do a lookup in the PrefixSet, return whether the value is present. 1.28 + boolean contains(in unsigned long aPrefix); 1.29 + boolean isEmpty(); 1.30 + void loadFromFile(in nsIFile aFile); 1.31 + void storeToFile(in nsIFile aFile); 1.32 +};