toolkit/components/url-classifier/nsIUrlClassifierHashCompleter.idl

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     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 /**
     8  * This interface is implemented by nsIUrlClassifierHashCompleter clients.
     9  */
    10 [scriptable, uuid(da16de40-df26-414d-bde7-c4faf4504868)]
    11 interface nsIUrlClassifierHashCompleterCallback : nsISupports
    12 {
    13   /**
    14    * A complete hash has been found that matches the partial hash.
    15    * This method may be called 0-n times for a given
    16    * nsIUrlClassifierCompleter::complete() call.
    17    *
    18    * @param hash
    19    *        The 128-bit hash that was discovered.
    20    * @param table
    21    *        The name of the table that this hash belongs to.
    22    * @param chunkId
    23    *        The database chunk that this hash belongs to.
    24    */
    25   void completion(in ACString hash,
    26                   in ACString table,
    27                   in uint32_t chunkId);
    29   /**
    30    * The completion is complete.  This method is called once per
    31    * nsIUrlClassifierCompleter::complete() call, after all completion()
    32    * calls are finished.
    33    *
    34    * @param status
    35    *        NS_OK if the request completed successfully, or an error code.
    36    */
    37   void completionFinished(in nsresult status);
    38 };
    40 /**
    41  * Clients updating the url-classifier database have the option of sending
    42  * partial (32-bit) hashes of URL fragments to be blacklisted.  If the
    43  * url-classifier encounters one of these truncated hashes, it will ask an
    44  * nsIUrlClassifierCompleter instance to asynchronously provide the complete
    45  * hash, along with some associated metadata.
    46  * This is only ever used for testing and should absolutely be deleted (I
    47  * think).
    48  */
    49 [scriptable, uuid(ade9b72b-3562-44f5-aba6-e63246be53ae)]
    50 interface nsIUrlClassifierHashCompleter : nsISupports
    51 {
    52   /**
    53    * Request a completed hash.
    54    *
    55    * @param partialHash
    56    *        The 32-bit hash encountered by the url-classifier.
    57    * @param callback
    58    *        An nsIUrlClassifierCompleterCallback instance.
    59    */
    60   void complete(in ACString partialHash,
    61                 in nsIUrlClassifierHashCompleterCallback callback);
    62   /**
    63    * The URL for the gethash request
    64    */
    65   attribute ACString gethashUrl;
    66 };

mercurial