Flutter Engine
The Flutter Engine
Public Attributes | List of all members
FlutterEngineDartBuffer Struct Reference

#include <embedder.h>

Public Attributes

size_t struct_size
 The size of this struct. Must be sizeof(FlutterEngineDartBuffer). More...
void * user_data
VoidCallback buffer_collect_callback
uint8_t * buffer
size_t buffer_size
 The size of the buffer. More...

Detailed Description

Definition at line 2024 of file embedder.h.

Member Data Documentation

◆ buffer

uint8_t* FlutterEngineDartBuffer::buffer

A pointer to the bytes of the buffer. When the buffer is owned by the embedder (by specifying the buffer_collect_callback), Dart code may modify that embedder owned buffer. For this reason, it is important that this buffer not have page protections that restrict writing to this buffer.

Definition at line 2056 of file embedder.h.

◆ buffer_collect_callback

VoidCallback FlutterEngineDartBuffer::buffer_collect_callback

This is an optional field.

When specified, the engine will assume that the buffer is owned by the embedder. When the data is no longer needed by any isolate, this callback will be made on an internal engine managed thread. The embedder is free to collect the buffer here. When this field is specified, it is the embedders responsibility to keep the buffer alive and not modify it till this callback is invoked by the engine. The user data specified in the callback is the value of user_data field in this struct.

When NOT specified, the VM creates an internal copy of the buffer. The caller is free to modify the buffer as necessary or collect it immediately after the call to FlutterEnginePostDartObject.

The buffer_collect_callback is will only be invoked by the engine when the FlutterEnginePostDartObject method returns kSuccess. In case of non-successful calls to this method, it is the embedders responsibility to collect the buffer.

Definition at line 2050 of file embedder.h.

◆ buffer_size

size_t FlutterEngineDartBuffer::buffer_size

The size of the buffer.

Definition at line 2058 of file embedder.h.

◆ struct_size

size_t FlutterEngineDartBuffer::struct_size

The size of this struct. Must be sizeof(FlutterEngineDartBuffer).

Definition at line 2026 of file embedder.h.

◆ user_data

void* FlutterEngineDartBuffer::user_data

An opaque baton passed back to the embedder when the buffer_collect_callback is invoked. The engine does not interpret this field in any way.

Definition at line 2030 of file embedder.h.

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