V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
v8::Serializer Class Reference
Inheritance diagram for v8::Serializer:
v8::ValueSerializer::Delegate

Public Member Functions

 Serializer (Isolate *isolate)
 
Maybe< boolWriteValue (Local< Context > context, Local< Value > value, Local< Value > transfer)
 
std::unique_ptr< SerializationDataRelease ()
 
void AppendExternalizedContentsTo (std::vector< ExternalizedContents > *to)
 
- Public Member Functions inherited from v8::ValueSerializer::Delegate
virtual Maybe< boolWriteHostObject (Isolate *isolate, Local< Object > object)
 

Protected Member Functions

void ThrowDataCloneError (Local< String > message) override
 
Maybe< uint32_tGetSharedArrayBufferId (Isolate *isolate, Local< SharedArrayBuffer > shared_array_buffer) override
 
Maybe< uint32_tGetWasmModuleTransferId (Isolate *isolate, Local< WasmCompiledModule > module) override
 
void * ReallocateBufferMemory (void *old_buffer, size_t size, size_t *actual_size) override
 
void FreeBufferMemory (void *buffer) override
 

Detailed Description

Definition at line 3060 of file d8.cc.

Member Function Documentation

◆ FreeBufferMemory()

void v8::Serializer::FreeBufferMemory ( void *  buffer)
inlineoverrideprotectedvirtual

Frees a buffer allocated with |ReallocateBufferMemory|.

The default implementation uses the stdlib's free() function.

Reimplemented from v8::ValueSerializer::Delegate.

Definition at line 3150 of file d8.cc.

◆ GetSharedArrayBufferId()

Maybe<uint32_t> v8::Serializer::GetSharedArrayBufferId ( Isolate *  isolate,
Local< SharedArrayBuffer shared_array_buffer 
)
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.

Definition at line 3107 of file d8.cc.

◆ ReallocateBufferMemory()

void* v8::Serializer::ReallocateBufferMemory ( void *  old_buffer,
size_t  size,
size_t actual_size 
)
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.

Definition at line 3138 of file d8.cc.

◆ ThrowDataCloneError()

void v8::Serializer::ThrowDataCloneError ( Local< String message)
inlineoverrideprotectedvirtual

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.

Definition at line 3103 of file d8.cc.


The documentation for this class was generated from the following file: