Interface nsIIncrementalStreamLoaderObserverType

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

  • Called when new data has arrived on the stream.

    Parameters

    • loader: nsIIncrementalStreamLoader

      the stream loader that loaded the stream.

    • ctxt: nsISupports

      the context parameter of the underlying channel

    • dataLength: number

      the length of the new data received

    • data: number

      the contents of the new data received.

      This method will always be called asynchronously by the nsIIncrementalStreamLoader involved, on the thread that called the loader's init() method.

      If the observer wants to not accumulate all or portional of the data in the internal buffer, the consumedLength shall be set to the value of the dataLength or less. By default the consumedLength value is assumed 0. The data and dataLength reflect the non-consumed data and will be accumulated if consumedLength is not set.

      In comparison with onStreamComplete(), the data buffer cannot be adopted if this method returns NS_SUCCESS_ADOPTED_DATA.

    • consumedLength: number

    Returns void

  • Called when the entire stream has been loaded.

    Parameters

    • loader: nsIIncrementalStreamLoader

      the stream loader that loaded the stream.

    • ctxt: nsISupports

      the context parameter of the underlying channel

    • status: number

      the status of the underlying channel

    • resultLength: number

      the length of the data loaded

    • result: number

      the data

      This method will always be called asynchronously by the nsIIncrementalStreamLoader involved, on the thread that called the loader's init() method.

      If the observer wants to take over responsibility for the data buffer (result), it returns NS_SUCCESS_ADOPTED_DATA in place of NS_OK as its success code. The loader will then "forget" about the data and not free() it after onStreamComplete() returns; observer must call free() when the data is no longer required.

    Returns void

Generated using TypeDoc