V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
|
Public Member Functions | |
Serializer (Isolate *isolate) | |
Maybe< bool > | WriteValue (Local< Context > context, Local< Value > value, Local< Value > transfer) |
std::unique_ptr< SerializationData > | Release () |
void | AppendExternalizedContentsTo (std::vector< ExternalizedContents > *to) |
Public Member Functions inherited from v8::ValueSerializer::Delegate | |
virtual Maybe< bool > | WriteHostObject (Isolate *isolate, Local< Object > object) |
Protected Member Functions | |
void | ThrowDataCloneError (Local< String > message) override |
Maybe< uint32_t > | GetSharedArrayBufferId (Isolate *isolate, Local< SharedArrayBuffer > shared_array_buffer) override |
Maybe< uint32_t > | GetWasmModuleTransferId (Isolate *isolate, Local< WasmCompiledModule > module) override |
void * | ReallocateBufferMemory (void *old_buffer, size_t size, size_t *actual_size) override |
void | FreeBufferMemory (void *buffer) override |
|
inlineoverrideprotectedvirtual |
Frees a buffer allocated with |ReallocateBufferMemory|.
The default implementation uses the stdlib's free()
function.
Reimplemented from v8::ValueSerializer::Delegate.
|
inlineoverrideprotectedvirtual |
Called when the ValueSerializer is going to serialize a SharedArrayBuffer object. The embedder must return an ID for the object, using the same ID if this SharedArrayBuffer has already been serialized in this buffer. When deserializing, this ID will be passed to ValueDeserializer::GetSharedArrayBufferFromId as |clone_id|.
If the object cannot be serialized, an exception should be thrown and Nothing<uint32_t>() returned.
Reimplemented from v8::ValueSerializer::Delegate.
|
inlineoverrideprotectedvirtual |
Allocates memory for the buffer of at least the size provided. The actual size (which may be greater or equal) is written to |actual_size|. If no buffer has been allocated yet, nullptr will be provided.
If the memory cannot be allocated, nullptr should be returned. |actual_size| will be ignored. It is assumed that |old_buffer| is still valid in this case and has not been modified.
The default implementation uses the stdlib's realloc()
function.
Reimplemented from v8::ValueSerializer::Delegate.
Handles the case where a DataCloneError would be thrown in the structured clone spec. Other V8 embedders may throw some other appropriate exception type.
Implements v8::ValueSerializer::Delegate.