From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- netwerk/url-classifier/nsIURIClassifier.idl | 115 ++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 netwerk/url-classifier/nsIURIClassifier.idl (limited to 'netwerk/url-classifier/nsIURIClassifier.idl') diff --git a/netwerk/url-classifier/nsIURIClassifier.idl b/netwerk/url-classifier/nsIURIClassifier.idl new file mode 100644 index 0000000000..788d7b3465 --- /dev/null +++ b/netwerk/url-classifier/nsIURIClassifier.idl @@ -0,0 +1,115 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIUrlClassifierFeature.idl" + +%{C++ +#include "nsStringFwd.h" +#include "nsTArrayForwardDeclare.h" +%} +[ref] native StringArrayRef(nsTArray); + +interface nsIChannel; +interface nsISerialEventTarget; +interface nsIPrincipal; +interface nsIURI; +interface nsIUrlClassifierFeatureCallback; + +/** + * Callback function for nsIURIClassifier lookups. + */ +[scriptable, function, uuid(8face46e-0c96-470f-af40-0037dcd797bd)] +interface nsIURIClassifierCallback : nsISupports +{ + /** + * Called by the URI classifier service when it is done checking a URI. + * + * Clients are responsible for associating callback objects with classify() + * calls. + * + * @param aErrorCode + * The error code with which the channel should be cancelled, or + * NS_OK if the load should continue normally. + * @param aList + * Name of the list that matched + * @param aProvider + * Name of provider that matched + * @param aFullHash + * Full hash of URL that matched + */ + void onClassifyComplete(in nsresult aErrorCode, + in ACString aList, + in ACString aProvider, + in ACString aFullHash); +}; + +/** + * The URI classifier service checks a URI against lists of phishing + * and malware sites. + */ +[scriptable, uuid(596620cc-76e3-4133-9d90-360e59a794cf)] +interface nsIURIClassifier : nsISupports +{ + /** + * Classify a Principal using its URI. + * + * @param aPrincipal + * The principal that should be checked by the URI classifier. + * + * @param aCallback + * The URI classifier will call this callback when the URI has been + * classified. + * + * @return false if classification is not necessary. The + * callback will not be called. + * true if classification will be performed. The + * callback will be called. + */ + boolean classify(in nsIPrincipal aPrincipal, + in nsIURIClassifierCallback aCallback); + + /** + * Asynchronously classify a URI with list of features. This does not make + * network requests. + */ + void asyncClassifyLocalWithFeatures(in nsIURI aURI, + in Array aFeatures, + in nsIUrlClassifierFeature_listType aListType, + in nsIUrlClassifierFeatureCallback aCallback); + + /** + * Returns a feature named aFeatureName. + */ + nsIUrlClassifierFeature getFeatureByName(in ACString aFeatureName); + + /** + * Returns all the feature names. + */ + Array getFeatureNames(); + + /** + * Create a new feature with a list of tables. This method is just for + * testing! Don't use it elsewhere. + */ + nsIUrlClassifierFeature createFeatureWithTables(in ACString aName, + in Array aBlocklistTables, + in Array aEntitylistTables); + + /** + * Report to the provider that a Safe Browsing warning was shown. + * + * @param aChannel + * Channel for which the URL matched something on the threat list. + * @param aProvider + * Provider to notify. + * @param aList + * List where the full hash was found. + * @param aFullHash + * Full URL hash that triggered the warning. + */ + + void sendThreatHitReport(in nsIChannel aChannel, in ACString aProvider, + in ACString aList, in ACString aFullHash); +}; -- cgit v1.2.3