5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TASK_RUNNER_WINDOW_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_TASK_RUNNER_WINDOW_H_
17 #include "flutter/fml/macros.h"
37 std::chrono::time_point<std::chrono::high_resolution_clock> time_point);
40 void TimerThreadMain();
43 std::condition_variable cv_;
44 std::function<void()> callback_;
45 uint64_t schedule_counter_ = 0;
46 std::chrono::time_point<std::chrono::high_resolution_clock> next_fire_time_;
47 std::optional<std::thread> thread_;
70 void PollOnce(std::chrono::milliseconds timeout);
79 void SetTimer(std::chrono::nanoseconds when);
81 WNDCLASS RegisterWindowClass();
84 HandleMessage(UINT
const message,
86 LPARAM
const lparam) noexcept;
88 static LRESULT CALLBACK WndProc(HWND
const window,
91 LPARAM
const lparam) noexcept;
95 static void TimerProc(PTP_CALLBACK_INSTANCE Instance,
100 std::wstring window_class_name_;
101 std::vector<Delegate*> delegates_;
102 DWORD thread_id_ = 0;
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