michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0:
michael@0: #include "nsISupports.idl"
michael@0:
michael@0: interface nsIPrincipal;
michael@0: interface nsIChannel;
michael@0:
michael@0: /**
michael@0: * Callback function for nsIURIClassifier lookups.
michael@0: */
michael@0: [scriptable, function, uuid(8face46e-0c96-470f-af40-0037dcd797bd)]
michael@0: interface nsIURIClassifierCallback : nsISupports
michael@0: {
michael@0: /**
michael@0: * Called by the URI classifier service when it is done checking a URI.
michael@0: *
michael@0: * Clients are responsible for associating callback objects with classify()
michael@0: * calls.
michael@0: *
michael@0: * @param aErrorCode
michael@0: * The error code with which the channel should be cancelled, or
michael@0: * NS_OK if the load should continue normally.
michael@0: */
michael@0: void onClassifyComplete(in nsresult aErrorCode);
michael@0: };
michael@0:
michael@0: /**
michael@0: * The URI classifier service checks a URI against lists of phishing
michael@0: * and malware sites.
michael@0: */
michael@0: [scriptable, uuid(617f1002-ec55-42c4-a7b0-ebb221ba9fa2)]
michael@0: interface nsIURIClassifier : nsISupports
michael@0: {
michael@0: /**
michael@0: * Classify a Principal using its URI.
michael@0: *
michael@0: * @param aPrincipal
michael@0: * The principal that should be checked by the URI classifier.
michael@0: * @param aCallback
michael@0: * The URI classifier will call this callback when the URI has been
michael@0: * classified.
michael@0: *
michael@0: * @return false
if classification is not necessary. The
michael@0: * callback will not be called.
michael@0: * true
if classification will be performed. The
michael@0: * callback will be called.
michael@0: */
michael@0: boolean classify(in nsIPrincipal aPrincipal,
michael@0: in nsIURIClassifierCallback aCallback);
michael@0: };