toolkit/components/url-classifier/nsIUrlListManager.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.

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 nsIPrincipal;
michael@0 9
michael@0 10 /**
michael@0 11 * Interface for a class that manages updates of the url classifier database.
michael@0 12 */
michael@0 13
michael@0 14 // Interface for JS function callbacks
michael@0 15 [scriptable, function, uuid(fa4caf12-d057-4e7e-81e9-ce066ceee90b)]
michael@0 16 interface nsIUrlListManagerCallback : nsISupports {
michael@0 17 void handleEvent(in ACString value);
michael@0 18 };
michael@0 19
michael@0 20
michael@0 21 [scriptable, uuid(62484bb5-bf7e-4988-9055-8803b16b48a1)]
michael@0 22 interface nsIUrlListManager : nsISupports
michael@0 23 {
michael@0 24 /**
michael@0 25 * Set the URL we check for updates.
michael@0 26 */
michael@0 27 void setUpdateUrl(in ACString url);
michael@0 28
michael@0 29 /**
michael@0 30 * Set the URL that we will query for complete hashes after a partial
michael@0 31 * hash match.
michael@0 32 */
michael@0 33 void setGethashUrl(in ACString url);
michael@0 34
michael@0 35 /**
michael@0 36 * Add a table to the list of tables we are managing. The name is a
michael@0 37 * string of the format provider_name-semantic_type-table_type. For
michael@0 38 * example, goog-white-enchash or goog-black-url.
michael@0 39 */
michael@0 40 boolean registerTable(in ACString tableName);
michael@0 41
michael@0 42 /**
michael@0 43 * Turn on update checking for a table. I.e., during the next server
michael@0 44 * check, download updates for this table.
michael@0 45 */
michael@0 46 void enableUpdate(in ACString tableName);
michael@0 47
michael@0 48 /**
michael@0 49 * Turn off update checking for a table.
michael@0 50 */
michael@0 51 void disableUpdate(in ACString tableName);
michael@0 52
michael@0 53 /**
michael@0 54 * Lookup a key. Should not raise exceptions. Calls the callback
michael@0 55 * function with a comma-separated list of tables to which the key
michael@0 56 * belongs.
michael@0 57 */
michael@0 58 void safeLookup(in nsIPrincipal key,
michael@0 59 in nsIUrlListManagerCallback cb);
michael@0 60
michael@0 61 void checkForUpdates();
michael@0 62 };

mercurial