5#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TASK_RUNNER_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_TASK_RUNNER_H_
16#include "flutter/shell/platform/embedder/embedder.h"
17#include "flutter/shell/platform/windows/task_runner_window.h"
44 uint64_t flutter_target_time_nanos);
63 typedef std::variant<FlutterTask, TaskClosure> TaskVariant;
72 if (
a.fire_time ==
b.fire_time) {
73 return a.order >
b.order;
75 return a.fire_time >
b.fire_time;
81 void EnqueueTask(
Task task);
91 return TaskTimePoint::clock::now();
96 uint64_t flutter_target_time_nanos)
const;
100 std::mutex task_queue_mutex_;
101 std::priority_queue<Task, std::deque<Task>, Task::Comparer> task_queue_;
102 DWORD main_thread_id_;
103 std::shared_ptr<TaskRunnerWindow> task_runner_window_;
std::chrono::steady_clock::time_point TaskTimePoint
void PostFlutterTask(FlutterTask flutter_task, uint64_t flutter_target_time_nanos)
TaskRunner(CurrentTimeProc get_current_time, const TaskExpiredCallback &on_task_expired)
virtual bool RunsTasksOnCurrentThread() const
std::function< void(const FlutterTask *)> TaskExpiredCallback
void RunNowOrPostTask(TaskClosure task)
std::function< void()> TaskClosure
void PostTask(TaskClosure task)
virtual TaskTimePoint GetCurrentTimeForTask() const
std::chrono::nanoseconds ProcessTasks()
Dart_NativeFunction function
uint64_t(* CurrentTimeProc)()
bool operator()(const Task &a, const Task &b)