2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2007-08-31 23:18:46 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-07-20 16:46:59 +00:00
|
|
|
interface nsIPrincipal;
|
2007-08-31 23:18:46 +00:00
|
|
|
interface nsIChannel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
void onClassifyComplete(in nsresult aErrorCode);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The URI classifier service checks a URI against lists of phishing
|
|
|
|
* and malware sites.
|
|
|
|
*/
|
2014-12-18 18:18:09 +00:00
|
|
|
[scriptable, uuid(03d26681-0ef5-4718-9777-33c9e1ee3e32)]
|
2007-08-31 23:18:46 +00:00
|
|
|
interface nsIURIClassifier : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
2013-09-07 00:12:33 +00:00
|
|
|
* Classify a Principal using its URI.
|
2007-08-31 23:18:46 +00:00
|
|
|
*
|
2012-07-20 16:46:59 +00:00
|
|
|
* @param aPrincipal
|
|
|
|
* The principal that should be checked by the URI classifier.
|
2014-07-24 17:59:00 +00:00
|
|
|
* @param aTrackingProtectionEnabled
|
|
|
|
* Whether or not to classify the given URI against tracking
|
|
|
|
* protection lists
|
|
|
|
*
|
2007-08-31 23:18:46 +00:00
|
|
|
* @param aCallback
|
|
|
|
* The URI classifier will call this callback when the URI has been
|
|
|
|
* classified.
|
|
|
|
*
|
|
|
|
* @return <code>false</code> if classification is not necessary. The
|
|
|
|
* callback will not be called.
|
|
|
|
* <code>true</code> if classification will be performed. The
|
|
|
|
* callback will be called.
|
|
|
|
*/
|
2012-07-20 16:46:59 +00:00
|
|
|
boolean classify(in nsIPrincipal aPrincipal,
|
2014-07-24 17:59:00 +00:00
|
|
|
in boolean aTrackingProtectionEnabled,
|
2007-08-31 23:18:46 +00:00
|
|
|
in nsIURIClassifierCallback aCallback);
|
2014-12-18 18:18:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronously classify a Principal locally using its URI. This does not
|
|
|
|
* make network requests. The result is an error code with which the channel
|
|
|
|
* should be cancelled, or NS_OK if no result was found.
|
|
|
|
*/
|
|
|
|
nsresult classifyLocal(in nsIPrincipal aPrincipal,
|
|
|
|
in boolean aTrackingProtectionEnabled);
|
2007-08-31 23:18:46 +00:00
|
|
|
};
|