Implemented by
This is a proxy class that is instantiated and called from the JS thread. It provides async methods for querying and updating the database. As the methods complete, they call the callback function.
[scriptable, uuid(7aae3f3a-527d-488b-a448-45dca6db0e80)]
interface nsIUrlClassifierDBService : nsISupports
Methods
Begin a stream update. This should be called once per url being
fetched.
@param table The table the contents of this stream will be associated
with, or empty for the initial stream.
@param serverMAC The MAC specified by the update server for this stream.
If the server has not specified a MAC (which is the case
for the initial stream), this will be empty.
void
beginStream(in ACString table, in ACString serverMAC)
Begin an update process. Will throw NS_ERROR_NOT_AVAILABLE if there
is already an update in progress.
@param updater The update observer tied to this update.
@param tables A comma-separated list of tables included in this update.
@param clientKey The client key for calculating an update's MAC,
or empty to ignore MAC.
void
beginUpdate(in nsIUrlClassifierUpdateObserver updater, in ACString tables, in ACString clientKey)
Cancel an incremental update. This rolls back any pending changes. and resets the update interface. The update observer's updateError method will be called when the update has been rolled back.
void
cancelUpdate()
Finish an individual stream update. Must be called for every beginStream() call, before the next beginStream() or finishUpdate(). The update observer's streamFinished will be called once the stream has been processed.
void
finishStream()
Finish an incremental update. This will attempt to commit any pending changes and resets the update interface. The update observer's updateSucceeded or updateError methods will be called when the update has been processed.
void
finishUpdate()
Lists the tables along with which chunks are available in each table. This list is in the format of the request body: tablename;chunkdata tablename2;chunkdata2 For example: goog-phish-regexp;a:10,14,30-40s:56,67 goog-white-regexp;a:1-3,5
void
getTables(in nsIUrlClassifierCallback c)
Looks up a key in the database.
@param key: The URL to search for. This URL will be canonicalized
by the service.
@param c: The callback will be called with a comma-separated list
of tables to which the key belongs.
void
lookup(in ACString spec, in nsIUrlClassifierCallback c)
Reset the url-classifier database. This call will delete the existing database, emptying all tables. Mostly intended for use in unit tests.
void
resetDatabase()
Set the nsIUrlClassifierCompleter object for a given table. This object will be used to request complete versions of partial hashes.
void
setHashCompleter(in ACString tableName, in nsIUrlClassifierHashCompleter completer)
Update the table incrementally.
void
updateStream(in ACString updateChunk)
Compare to: