Response to custom protocol requests.
This class can not be used to create instances, you must use its sub-classes instead.
Note that the interface of this class will be modified in future for extensions.
Called by sub-classes when it is ready to read data.
Called when the loading of request should start.
false would cancel the request.
This method is asynchronous, when the request is ready to be read, the
notify_content_length function property of this class should be called
size is the expected length
of the data to be read, pass
-1 if uncertain.
Called when the loading should be stopped.
bool GetMimeType(std::string* mimetype)
Called when browser wants to get mime type of the request.
false would leave the browser to guess the mime type.
Depending on the platform, this method may be called before and after the request is started, and it may be called in a different thread from the one it was created.
size_t Read(void* buffer, size_t bytes)
Called when browser wants to read data.
The data should be written to the
buffer, which has the size of
It should return size of data written, returning
0 means there is no