Flutter Engine
FlutterTaskRunnerDescription Struct Reference

#include <embedder.h>

Public Attributes

size_t struct_size
 The size of this struct. Must be sizeof(FlutterTaskRunnerDescription). More...
 
void * user_data
 
BoolCallback runs_task_on_current_thread_callback
 
FlutterTaskRunnerPostTaskCallback post_task_callback
 
size_t identifier
 

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 720 of file embedder.h.

Member Data Documentation

◆ 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 742 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 739 of file embedder.h.

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

◆ 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 728 of file embedder.h.

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

◆ struct_size

size_t FlutterTaskRunnerDescription::struct_size

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

Definition at line 722 of file embedder.h.

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

◆ user_data

void* FlutterTaskRunnerDescription::user_data

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