5#ifndef FLUTTER_FML_MESSAGE_LOOP_TASK_QUEUES_H_
6#define FLUTTER_FML_MESSAGE_LOOP_TASK_QUEUES_H_
14#include "flutter/fml/closure.h"
15#include "flutter/fml/delayed_task.h"
16#include "flutter/fml/macros.h"
17#include "flutter/fml/memory/ref_counted.h"
18#include "flutter/fml/synchronization/shared_mutex.h"
19#include "flutter/fml/task_queue_id.h"
20#include "flutter/fml/task_source.h"
21#include "flutter/fml/wakeable.h"
141 class MergedQueuesRunner;
149 bool HasPendingTasksUnlocked(
TaskQueueId queue_id)
const;
155 mutable std::mutex queue_mutex_;
156 std::map<TaskQueueId, std::unique_ptr<TaskQueueEntry>> queue_entries_;
158 size_t task_queue_id_counter_ = 0;
160 std::atomic_int order_;
fml::closure GetNextTaskToRun(TaskQueueId queue_id, fml::TimePoint from_time)
bool HasPendingTasks(TaskQueueId queue_id) const
size_t GetNumPendingTasks(TaskQueueId queue_id) const
static TaskSourceGrade GetCurrentTaskSourceGrade()
static MessageLoopTaskQueues * GetInstance()
void ResumeSecondarySource(TaskQueueId queue_id)
void DisposeTasks(TaskQueueId queue_id)
bool Merge(TaskQueueId owner, TaskQueueId subsumed)
bool Unmerge(TaskQueueId owner, TaskQueueId subsumed)
TaskQueueId CreateTaskQueue()
void RegisterTask(TaskQueueId queue_id, const fml::closure &task, fml::TimePoint target_time, fml::TaskSourceGrade task_source_grade=fml::TaskSourceGrade::kUnspecified)
std::vector< fml::closure > GetObserversToNotify(TaskQueueId queue_id) const
void PauseSecondarySource(TaskQueueId queue_id)
bool Owns(TaskQueueId owner, TaskQueueId subsumed) const
Returns true if owner owns the subsumed task queue.
void AddTaskObserver(TaskQueueId queue_id, intptr_t key, const fml::closure &callback)
void RemoveTaskObserver(TaskQueueId queue_id, intptr_t key)
std::set< TaskQueueId > GetSubsumedTaskQueueId(TaskQueueId owner) const
void SetWakeable(TaskQueueId queue_id, fml::Wakeable *wakeable)
void Dispose(TaskQueueId queue_id)
std::set< TaskQueueId > owner_of
std::unique_ptr< TaskSource > task_source
TaskQueueEntry(TaskQueueId created_for)
TaskObservers task_observers
std::map< intptr_t, fml::closure > TaskObservers
static const size_t kUnmerged
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName)
static const TaskQueueId kUnmerged
std::function< void()> closure
@ kUnspecified
The absence of a specialized TaskSourceGrade.
static double time(int loops, Benchmark *bench, Target *target)