Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
fml::TaskRunnerChecker Class Referencefinal

#include <task_runner_checker.h>

Public Member Functions

 TaskRunnerChecker ()
 
 ~TaskRunnerChecker ()
 
bool RunsOnCreationTaskRunner () const
 

Static Public Member Functions

static bool RunsOnTheSameThread (TaskQueueId queue_a, TaskQueueId queue_b)
 

Detailed Description

Definition at line 13 of file task_runner_checker.h.

Constructor & Destructor Documentation

◆ TaskRunnerChecker()

fml::TaskRunnerChecker::TaskRunnerChecker ( )

Definition at line 9 of file task_runner_checker.cc.

10 : initialized_queue_id_(InitTaskQueueId()),
11 subsumed_queue_ids_(
12 MessageLoopTaskQueues::GetInstance()->GetSubsumedTaskQueueId(
13 initialized_queue_id_)){};
static MessageLoopTaskQueues * GetInstance()

◆ ~TaskRunnerChecker()

fml::TaskRunnerChecker::~TaskRunnerChecker ( )
default

Member Function Documentation

◆ RunsOnCreationTaskRunner()

bool fml::TaskRunnerChecker::RunsOnCreationTaskRunner ( ) const

Definition at line 17 of file task_runner_checker.cc.

17 {
19 const auto current_queue_id = MessageLoop::GetCurrentTaskQueueId();
20 if (RunsOnTheSameThread(current_queue_id, initialized_queue_id_)) {
21 return true;
22 }
23 for (auto& subsumed : subsumed_queue_ids_) {
24 if (RunsOnTheSameThread(current_queue_id, subsumed)) {
25 return true;
26 }
27 }
28 return false;
29};
static bool IsInitializedForCurrentThread()
Definition: message_loop.cc:35
static TaskQueueId GetCurrentTaskQueueId()
Definition: message_loop.cc:76
static bool RunsOnTheSameThread(TaskQueueId queue_a, TaskQueueId queue_b)
#define FML_CHECK(condition)
Definition: logging.h:85

◆ RunsOnTheSameThread()

bool fml::TaskRunnerChecker::RunsOnTheSameThread ( TaskQueueId  queue_a,
TaskQueueId  queue_b 
)
static

Definition at line 31 of file task_runner_checker.cc.

32 {
33 if (queue_a == queue_b) {
34 return true;
35 }
36
38 if (queues->Owns(queue_a, queue_b)) {
39 return true;
40 }
41 if (queues->Owns(queue_b, queue_a)) {
42 return true;
43 }
44 return false;
45};

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