Flutter Engine
task_runner_checker.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "flutter/fml/memory/task_runner_checker.h"
6 
7 namespace fml {
8 
10  : initialized_queue_id_(InitTaskQueueId()){};
11 
13 
16  const auto current_queue_id = MessageLoop::GetCurrentTaskQueueId();
17  return RunsOnTheSameThread(current_queue_id, initialized_queue_id_);
18 };
19 
21  TaskQueueId queue_b) {
22  if (queue_a == queue_b) {
23  return true;
24  }
25 
26  auto queues = MessageLoopTaskQueues::GetInstance();
27  if (queues->Owns(queue_a, queue_b)) {
28  return true;
29  }
30  if (queues->Owns(queue_b, queue_a)) {
31  return true;
32  }
33  return false;
34 };
35 
36 TaskQueueId TaskRunnerChecker::InitTaskQueueId() {
39 };
40 
41 } // namespace fml
static void EnsureInitializedForCurrentThread()
Definition: message_loop.cc:27
Definition: ascii_trie.cc:9
static TaskQueueId GetCurrentTaskQueueId()
Definition: message_loop.cc:76
static fml::RefPtr< MessageLoopTaskQueues > GetInstance()
#define FML_CHECK(condition)
Definition: logging.h:68
bool RunsOnCreationTaskRunner() const
static bool IsInitializedForCurrentThread()
Definition: message_loop.cc:35
static bool RunsOnTheSameThread(TaskQueueId queue_a, TaskQueueId queue_b)