1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/url-classifier/nsIUrlListManager.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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 + 1.11 +interface nsIPrincipal; 1.12 + 1.13 +/** 1.14 + * Interface for a class that manages updates of the url classifier database. 1.15 + */ 1.16 + 1.17 +// Interface for JS function callbacks 1.18 +[scriptable, function, uuid(fa4caf12-d057-4e7e-81e9-ce066ceee90b)] 1.19 +interface nsIUrlListManagerCallback : nsISupports { 1.20 + void handleEvent(in ACString value); 1.21 +}; 1.22 + 1.23 + 1.24 +[scriptable, uuid(62484bb5-bf7e-4988-9055-8803b16b48a1)] 1.25 +interface nsIUrlListManager : nsISupports 1.26 +{ 1.27 + /** 1.28 + * Set the URL we check for updates. 1.29 + */ 1.30 + void setUpdateUrl(in ACString url); 1.31 + 1.32 + /** 1.33 + * Set the URL that we will query for complete hashes after a partial 1.34 + * hash match. 1.35 + */ 1.36 + void setGethashUrl(in ACString url); 1.37 + 1.38 + /** 1.39 + * Add a table to the list of tables we are managing. The name is a 1.40 + * string of the format provider_name-semantic_type-table_type. For 1.41 + * example, goog-white-enchash or goog-black-url. 1.42 + */ 1.43 + boolean registerTable(in ACString tableName); 1.44 + 1.45 + /** 1.46 + * Turn on update checking for a table. I.e., during the next server 1.47 + * check, download updates for this table. 1.48 + */ 1.49 + void enableUpdate(in ACString tableName); 1.50 + 1.51 + /** 1.52 + * Turn off update checking for a table. 1.53 + */ 1.54 + void disableUpdate(in ACString tableName); 1.55 + 1.56 + /** 1.57 + * Lookup a key. Should not raise exceptions. Calls the callback 1.58 + * function with a comma-separated list of tables to which the key 1.59 + * belongs. 1.60 + */ 1.61 + void safeLookup(in nsIPrincipal key, 1.62 + in nsIUrlListManagerCallback cb); 1.63 + 1.64 + void checkForUpdates(); 1.65 +};