5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TASK_RUNNER_WINDOW_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_TASK_RUNNER_WINDOW_H_
18 #include "flutter/fml/macros.h"
23 class TestTaskRunnerWindow;
42 std::chrono::time_point<std::chrono::high_resolution_clock> time_point);
45 void TimerThreadMain();
48 std::condition_variable cv_;
49 std::function<void()> callback_;
50 uint64_t schedule_counter_ = 0;
51 std::chrono::time_point<std::chrono::high_resolution_clock> next_fire_time_;
52 std::optional<std::thread> thread_;
75 void PollOnce(std::chrono::milliseconds timeout);
85 void SetTimer(std::chrono::nanoseconds when);
87 WNDCLASS RegisterWindowClass();
90 HandleMessage(UINT
const message,
92 LPARAM
const lparam) noexcept;
94 static LRESULT CALLBACK WndProc(HWND
const window,
97 LPARAM
const lparam) noexcept;
101 static void TimerProc(PTP_CALLBACK_INSTANCE Instance,
106 std::wstring window_class_name_;
107 std::vector<Delegate*> delegates_;
108 DWORD thread_id_ = 0;
112 std::atomic_bool wake_up_posted_ =
false;
virtual std::chrono::nanoseconds ProcessTasks()=0
void PollOnce(std::chrono::milliseconds timeout)
static std::shared_ptr< TaskRunnerWindow > GetSharedInstance()
void AddDelegate(Delegate *delegate)
void RemoveDelegate(Delegate *delegate)
void ScheduleAt(std::chrono::time_point< std::chrono::high_resolution_clock > time_point)
TimerThread(std::function< void()> callback)
FlutterDesktopBinaryReply callback