netwerk/base/public/nsIURIClassifier.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial