Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
Initialize this downloader
the observer to be notified when the download completes.
the location where the stream contents should be written. if null, the downloader will select a location and the resulting file will be deleted (or otherwise made invalid) when the downloader object is destroyed. if an explicit download location is specified then the resulting file will not be deleted, and it will be the callers responsibility to keep track of the file, etc.
Called when the next chunk of data (corresponding to the request) may be read without blocking the calling thread. The onDataAvailable impl must read exactly |aCount| bytes of data before returning.
request corresponding to the source of the data
input stream containing the data chunk
Number of bytes that were sent in previous onDataAvailable calls for this request. In other words, the sum of all previous count parameters.
number of bytes available in the stream
NOTE: The aInputStream parameter must implement readSegments.
An exception thrown from onDataAvailable has the side-effect of causing the request to be canceled.
Called to signify the end of an asynchronous request. This call is always preceded by a call to onStartRequest.
request being observed
reason for stopping (NS_OK if completed successfully)
An exception thrown from onStopRequest is generally ignored.
Generated using TypeDoc
nsIDownloader
A downloader is a special implementation of a nsIStreamListener that will make the contents of the stream available as a file. This may utilize the disk cache as an optimization to avoid an extra copy of the data on disk. The resulting file is valid from the time the downloader completes until the last reference to the downloader is released.