Interface nsIUrlClassifierDBServiceType

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.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

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

    Parameters

    • table: string

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

    Returns void

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

    Parameters

    • updater: nsIUrlClassifierUpdateObserver

      The update observer tied to this update.

    • tables: string

      A comma-separated list of tables included in this update.

    Returns void

  • 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.

    Returns void

  • Empty all the caches.

    Returns void

  • Forget the results that were used in the last DB update.

    Returns void

  • 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.

    Returns void

  • 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.

    Returns void

  • Lists the tables along with their meta info in the following format:

    tablename;[metadata]\n tablename2;[metadata]\n

    For v2 tables, the metadata is the chunks info such as

    goog-phish-shavar;a:10,14,30-40s:56,67 goog-unwanted-shavar;a:1-3,5

    For v4 tables, base64 encoded state is currently the only info in the metadata (can be extended whenever necessary). For exmaple,

    goog-phish-proto;Cg0IARAGGAEiAzAwMTABEKqTARoCGAjT1gDD:oCGAjT1gDD\n goog-malware-proto;Cg0IAhAGGAEiAzAwMTABENCQARoCGAjx5Yty:BENCQARoCGAj\n

    Note that the metadata is colon-separated.

    Parameters

    • c: nsIUrlClassifierCallback

    Returns void

  • Looks up a URI in the specified tables.

    Parameters

    • principal: nsIPrincipal
    • tables: string
    • c: nsIUrlClassifierCallback

    Returns void

  • Reload he url-classifier database. This will empty all cache for completions from gethash, and reload it from database. Mostly intended for use in tests.

    Returns void

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

    Returns void

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

    Parameters

    • tableName: string
    • completer: nsIUrlClassifierHashCompleter

    Returns void

  • Update the table incrementally.

    Parameters

    • updateChunk: string

    Returns void

Generated using TypeDoc