Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "nsISupports.idl" |
michael@0 | 6 | |
michael@0 | 7 | interface nsIPrincipal; |
michael@0 | 8 | interface nsIChannel; |
michael@0 | 9 | |
michael@0 | 10 | /** |
michael@0 | 11 | * Callback function for nsIURIClassifier lookups. |
michael@0 | 12 | */ |
michael@0 | 13 | [scriptable, function, uuid(8face46e-0c96-470f-af40-0037dcd797bd)] |
michael@0 | 14 | interface nsIURIClassifierCallback : nsISupports |
michael@0 | 15 | { |
michael@0 | 16 | /** |
michael@0 | 17 | * Called by the URI classifier service when it is done checking a URI. |
michael@0 | 18 | * |
michael@0 | 19 | * Clients are responsible for associating callback objects with classify() |
michael@0 | 20 | * calls. |
michael@0 | 21 | * |
michael@0 | 22 | * @param aErrorCode |
michael@0 | 23 | * The error code with which the channel should be cancelled, or |
michael@0 | 24 | * NS_OK if the load should continue normally. |
michael@0 | 25 | */ |
michael@0 | 26 | void onClassifyComplete(in nsresult aErrorCode); |
michael@0 | 27 | }; |
michael@0 | 28 | |
michael@0 | 29 | /** |
michael@0 | 30 | * The URI classifier service checks a URI against lists of phishing |
michael@0 | 31 | * and malware sites. |
michael@0 | 32 | */ |
michael@0 | 33 | [scriptable, uuid(617f1002-ec55-42c4-a7b0-ebb221ba9fa2)] |
michael@0 | 34 | interface nsIURIClassifier : nsISupports |
michael@0 | 35 | { |
michael@0 | 36 | /** |
michael@0 | 37 | * Classify a Principal using its URI. |
michael@0 | 38 | * |
michael@0 | 39 | * @param aPrincipal |
michael@0 | 40 | * The principal that should be checked by the URI classifier. |
michael@0 | 41 | * @param aCallback |
michael@0 | 42 | * The URI classifier will call this callback when the URI has been |
michael@0 | 43 | * classified. |
michael@0 | 44 | * |
michael@0 | 45 | * @return <code>false</code> if classification is not necessary. The |
michael@0 | 46 | * callback will not be called. |
michael@0 | 47 | * <code>true</code> if classification will be performed. The |
michael@0 | 48 | * callback will be called. |
michael@0 | 49 | */ |
michael@0 | 50 | boolean classify(in nsIPrincipal aPrincipal, |
michael@0 | 51 | in nsIURIClassifierCallback aCallback); |
michael@0 | 52 | }; |