1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/public/nsIURIClassifier.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsISupports.idl" 1.9 + 1.10 +interface nsIPrincipal; 1.11 +interface nsIChannel; 1.12 + 1.13 +/** 1.14 + * Callback function for nsIURIClassifier lookups. 1.15 + */ 1.16 +[scriptable, function, uuid(8face46e-0c96-470f-af40-0037dcd797bd)] 1.17 +interface nsIURIClassifierCallback : nsISupports 1.18 +{ 1.19 + /** 1.20 + * Called by the URI classifier service when it is done checking a URI. 1.21 + * 1.22 + * Clients are responsible for associating callback objects with classify() 1.23 + * calls. 1.24 + * 1.25 + * @param aErrorCode 1.26 + * The error code with which the channel should be cancelled, or 1.27 + * NS_OK if the load should continue normally. 1.28 + */ 1.29 + void onClassifyComplete(in nsresult aErrorCode); 1.30 +}; 1.31 + 1.32 +/** 1.33 + * The URI classifier service checks a URI against lists of phishing 1.34 + * and malware sites. 1.35 + */ 1.36 +[scriptable, uuid(617f1002-ec55-42c4-a7b0-ebb221ba9fa2)] 1.37 +interface nsIURIClassifier : nsISupports 1.38 +{ 1.39 + /** 1.40 + * Classify a Principal using its URI. 1.41 + * 1.42 + * @param aPrincipal 1.43 + * The principal that should be checked by the URI classifier. 1.44 + * @param aCallback 1.45 + * The URI classifier will call this callback when the URI has been 1.46 + * classified. 1.47 + * 1.48 + * @return <code>false</code> if classification is not necessary. The 1.49 + * callback will not be called. 1.50 + * <code>true</code> if classification will be performed. The 1.51 + * callback will be called. 1.52 + */ 1.53 + boolean classify(in nsIPrincipal aPrincipal, 1.54 + in nsIURIClassifierCallback aCallback); 1.55 +};