WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIUrlClassifierDBService

IID:bcc32b18-78be-49f6-a895-a1a341a9e94b
Inherits From:nsISupports

This interface is implemented by the following components:


Methods

void beginStream ( ACString table ) void beginUpdate ( nsIUrlClassifierUpdateObserver updater ) void cancelUpdate ( ) void finishStream ( ) void finishUpdate ( ) void getTables ( nsIUrlClassifierCallback c ) void lookup ( ACString spec , nsIUrlClassifierCallback c ) void resetDatabase ( ) void setHashCompleter ( ACString tableName , nsIUrlClassifierHashCompleter completer ) void updateStream ( ACString updateChunk )

void beginStream ( ACString table )

Begin a stream update. This should be called once per url being fetched.

Arguments:
table: The table the contents of this stream will be associated with, or empty for the initial stream.

void beginUpdate ( nsIUrlClassifierUpdateObserver updater )

Begin an update process. Will throw NS_ERROR_NOT_AVAILABLE if there is already an update in progress.

Arguments:
updater

void cancelUpdate ( )

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 finishStream ( )

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 finishUpdate ( )

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 getTables ( nsIUrlClassifierCallback c )

Lists the tables along with which chunks are available in each table. This list is in the format of the request body: tablename;chunkdata\n tablename2;chunkdata2\n

For example: goog-phish-regexp;a:10,14,30-40s:56,67 goog-white-regexp;a:1-3,5

Arguments:
c

void lookup ( ACString spec , nsIUrlClassifierCallback c )

Looks up a key in the database.

Arguments:
spec
c: : The callback will be called with a comma-separated list of tables to which the key belongs.

void resetDatabase ( )

Reset the url-classifier database. This call will delete the existing database, emptying all tables. Mostly intended for use in unit tests.


void setHashCompleter ( ACString tableName , nsIUrlClassifierHashCompleter completer )

Set the nsIUrlClassifierCompleter object for a given table. This object will be used to request complete versions of partial hashes.

Arguments:
tableName
completer

void updateStream ( ACString updateChunk )

Update the table incrementally.

Arguments:
updateChunk

Reference documentation is generated from Mozilla's source.