#include <v8.h>
For streaming incomplete script data to V8. The embedder should implement a subclass of this class.
Definition at line 1303 of file v8.h.
◆ ~ExternalSourceStream()
◆ GetMoreData()
virtual size_t GetMoreData |
( |
const uint8_t ** |
src | ) |
|
|
pure virtual |
V8 calls this to request the next chunk of data from the embedder. This function will be called on a background thread, so it's OK to block and wait for the data, if the embedder doesn't have data yet. Returns the length of the data returned. When the data ends, GetMoreData should return 0. Caller takes ownership of the data.
If the embedder wants to cancel the streaming, they should make the next GetMoreData call return 0. V8 will interpret it as end of data (and most probably, parsing will fail). The streaming task will return as soon as V8 has parsed the data it received so far.
◆ ResetToBookmark()
virtual void ResetToBookmark |
( |
| ) |
|
|
virtual |
V8 calls this to return to a previously set bookmark.
◆ SetBookmark()
virtual bool SetBookmark |
( |
| ) |
|
|
virtual |
V8 calls this method to set a 'bookmark' at the current position in the source stream, for the purpose of (maybe) later calling ResetToBookmark. If ResetToBookmark is called later, then subsequent calls to GetMoreData should return the same data as they did when SetBookmark was called earlier.
The embedder may return 'false' to indicate it cannot provide this functionality.
The documentation for this class was generated from the following file: