Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / netwerk / url-classifier / nsIUrlClassifierExceptionListService.idl
blob256d0b89aecdb923b22015f778414cc2c22af074
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 /**
8 * Observer for exception list updates.
9 */
10 [scriptable, function, uuid(f7c918e5-94bf-4b6e-9758-ef7bdab6af7e)]
11 interface nsIUrlClassifierExceptionListObserver : nsISupports
13 /**
14 * Called by nsIUrlClassifierExceptionListService when the exception list
15 * for a designated feature changes and when the observer is first registered.
17 * @param aList
18 * A comma-separated list of url patterns, intended to be parsed
19 * by nsContentUtils::IsURIInList.
21 void onExceptionListUpdate(in ACString aList);
24 /**
25 * A service that monitors updates to the exception list of url-classifier
26 * feature from sources such as a local pref and remote settings updates.
28 [scriptable, uuid(75c3d1a3-e977-4079-9e27-b3b56bdb76ea)]
29 interface nsIUrlClassifierExceptionListService : nsISupports
31 /**
32 * Register a new observer to exception list updates. When the observer is
33 * registered it is called immediately once. Afterwards it will be called
34 * whenever the specified pref changes or when remote settings for
35 * url-classifier features updates.
37 * @param aFeature
38 * The feature for which to observe the exception list.
40 * @param aPrefName
41 * (Optional) A pref name to monitor. The pref must be of string
42 * type and contain a comma-separated list of URL patterns.
44 * @param aObserver
45 * An nsIUrlClassifierExceptionListObserver object or function that
46 * will receive updates to the exception list as a comma-separated
47 * string. Will be called immediately with the current exception
48 * list value.
50 void registerAndRunExceptionListObserver(in ACString aFeature,
51 in ACString aPrefName,
52 in nsIUrlClassifierExceptionListObserver aObserver);
54 /**
55 * Unregister an observer.
57 * @param aFeature
58 * The feature for which to stop observing.
60 * @param aObserver
61 * The nsIUrlClassifierExceptionListObserver object to unregister.
63 void unregisterExceptionListObserver(in ACString aFeature,
64 in nsIUrlClassifierExceptionListObserver aObserver);
66 /**
67 * Clear all data in the service.
68 * This API is for testing only.
70 void clear();