michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * This interface is implemented by nsIUrlClassifierHashCompleter clients. michael@0: */ michael@0: [scriptable, uuid(da16de40-df26-414d-bde7-c4faf4504868)] michael@0: interface nsIUrlClassifierHashCompleterCallback : nsISupports michael@0: { michael@0: /** michael@0: * A complete hash has been found that matches the partial hash. michael@0: * This method may be called 0-n times for a given michael@0: * nsIUrlClassifierCompleter::complete() call. michael@0: * michael@0: * @param hash michael@0: * The 128-bit hash that was discovered. michael@0: * @param table michael@0: * The name of the table that this hash belongs to. michael@0: * @param chunkId michael@0: * The database chunk that this hash belongs to. michael@0: */ michael@0: void completion(in ACString hash, michael@0: in ACString table, michael@0: in uint32_t chunkId); michael@0: michael@0: /** michael@0: * The completion is complete. This method is called once per michael@0: * nsIUrlClassifierCompleter::complete() call, after all completion() michael@0: * calls are finished. michael@0: * michael@0: * @param status michael@0: * NS_OK if the request completed successfully, or an error code. michael@0: */ michael@0: void completionFinished(in nsresult status); michael@0: }; michael@0: michael@0: /** michael@0: * Clients updating the url-classifier database have the option of sending michael@0: * partial (32-bit) hashes of URL fragments to be blacklisted. If the michael@0: * url-classifier encounters one of these truncated hashes, it will ask an michael@0: * nsIUrlClassifierCompleter instance to asynchronously provide the complete michael@0: * hash, along with some associated metadata. michael@0: * This is only ever used for testing and should absolutely be deleted (I michael@0: * think). michael@0: */ michael@0: [scriptable, uuid(ade9b72b-3562-44f5-aba6-e63246be53ae)] michael@0: interface nsIUrlClassifierHashCompleter : nsISupports michael@0: { michael@0: /** michael@0: * Request a completed hash. michael@0: * michael@0: * @param partialHash michael@0: * The 32-bit hash encountered by the url-classifier. michael@0: * @param callback michael@0: * An nsIUrlClassifierCompleterCallback instance. michael@0: */ michael@0: void complete(in ACString partialHash, michael@0: in nsIUrlClassifierHashCompleterCallback callback); michael@0: /** michael@0: * The URL for the gethash request michael@0: */ michael@0: attribute ACString gethashUrl; michael@0: };