1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/url-classifier/nsIUrlClassifierHashCompleter.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,66 @@ 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 +/** 1.11 + * This interface is implemented by nsIUrlClassifierHashCompleter clients. 1.12 + */ 1.13 +[scriptable, uuid(da16de40-df26-414d-bde7-c4faf4504868)] 1.14 +interface nsIUrlClassifierHashCompleterCallback : nsISupports 1.15 +{ 1.16 + /** 1.17 + * A complete hash has been found that matches the partial hash. 1.18 + * This method may be called 0-n times for a given 1.19 + * nsIUrlClassifierCompleter::complete() call. 1.20 + * 1.21 + * @param hash 1.22 + * The 128-bit hash that was discovered. 1.23 + * @param table 1.24 + * The name of the table that this hash belongs to. 1.25 + * @param chunkId 1.26 + * The database chunk that this hash belongs to. 1.27 + */ 1.28 + void completion(in ACString hash, 1.29 + in ACString table, 1.30 + in uint32_t chunkId); 1.31 + 1.32 + /** 1.33 + * The completion is complete. This method is called once per 1.34 + * nsIUrlClassifierCompleter::complete() call, after all completion() 1.35 + * calls are finished. 1.36 + * 1.37 + * @param status 1.38 + * NS_OK if the request completed successfully, or an error code. 1.39 + */ 1.40 + void completionFinished(in nsresult status); 1.41 +}; 1.42 + 1.43 +/** 1.44 + * Clients updating the url-classifier database have the option of sending 1.45 + * partial (32-bit) hashes of URL fragments to be blacklisted. If the 1.46 + * url-classifier encounters one of these truncated hashes, it will ask an 1.47 + * nsIUrlClassifierCompleter instance to asynchronously provide the complete 1.48 + * hash, along with some associated metadata. 1.49 + * This is only ever used for testing and should absolutely be deleted (I 1.50 + * think). 1.51 + */ 1.52 +[scriptable, uuid(ade9b72b-3562-44f5-aba6-e63246be53ae)] 1.53 +interface nsIUrlClassifierHashCompleter : nsISupports 1.54 +{ 1.55 + /** 1.56 + * Request a completed hash. 1.57 + * 1.58 + * @param partialHash 1.59 + * The 32-bit hash encountered by the url-classifier. 1.60 + * @param callback 1.61 + * An nsIUrlClassifierCompleterCallback instance. 1.62 + */ 1.63 + void complete(in ACString partialHash, 1.64 + in nsIUrlClassifierHashCompleterCallback callback); 1.65 + /** 1.66 + * The URL for the gethash request 1.67 + */ 1.68 + attribute ACString gethashUrl; 1.69 +};