Flutter Engine
 
Loading...
Searching...
No Matches
FlutterTaskRunnerDescription Struct Reference

#include <embedder.h>

Public Attributes

size_t struct_size
 The size of this struct. Must be sizeof(FlutterTaskRunnerDescription).
 
void * user_data
 
BoolCallback runs_task_on_current_thread_callback
 
FlutterTaskRunnerPostTaskCallback post_task_callback
 
size_t identifier
 
VoidCallback destruction_callback
 The callback invoked when the task runner is destroyed.
 

Detailed Description

An interface used by the Flutter engine to execute tasks at the target time on a specified thread. There should be a 1-1 relationship between a thread and a task runner. It is undefined behavior to run a task on a thread that is not associated with its task runner.

Definition at line 1862 of file embedder.h.

Member Data Documentation

◆ destruction_callback

VoidCallback FlutterTaskRunnerDescription::destruction_callback

◆ identifier

size_t FlutterTaskRunnerDescription::identifier

A unique identifier for the task runner. If multiple task runners service tasks on the same thread, their identifiers must match.

Definition at line 1884 of file embedder.h.

Referenced by flutter::testing::EmbedderTestTaskRunner::EmbedderTestTaskRunner(), and fl_engine_start().

◆ post_task_callback

FlutterTaskRunnerPostTaskCallback FlutterTaskRunnerDescription::post_task_callback

May be called from any thread. The given task should be executed by the embedder on the thread associated with that task runner by calling FlutterEngineRunTask at the given target time. The system monotonic clock should be used for the target time. The target time is the absolute time from epoch (NOT a delta) at which the task must be returned back to the engine on the correct thread. If the embedder needs to calculate a delta, FlutterEngineGetCurrentTime may be called and the difference used as the delta.

Attention
This field is required.

Definition at line 1881 of file embedder.h.

Referenced by ConfigurePlatformTaskRunner(), flutter::CreateEmbedderTaskRunner(), flutter::testing::EmbedderTestTaskRunner::EmbedderTestTaskRunner(), fl_engine_start(), and flutter::FlutterWindowsEngine::Run().

◆ runs_task_on_current_thread_callback

BoolCallback FlutterTaskRunnerDescription::runs_task_on_current_thread_callback

May be called from any thread. Should return true if tasks posted on the calling thread will be run on that same thread.

Attention
This field is required.

Definition at line 1870 of file embedder.h.

Referenced by ConfigurePlatformTaskRunner(), flutter::CreateEmbedderTaskRunner(), flutter::testing::EmbedderTestTaskRunner::EmbedderTestTaskRunner(), fl_engine_start(), and flutter::FlutterWindowsEngine::Run().

◆ struct_size

size_t FlutterTaskRunnerDescription::struct_size

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

Definition at line 1864 of file embedder.h.

Referenced by ConfigurePlatformTaskRunner(), flutter::testing::EmbedderTestTaskRunner::EmbedderTestTaskRunner(), fl_engine_start(), and flutter::FlutterWindowsEngine::Run().

◆ user_data


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