Flutter Engine
Loading...
Searching...
No Matches
event_watcher.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/shell/platform/windows/event_watcher.h
"
6
7
namespace
flutter
{
8
9
EventWatcher::EventWatcher
(std::function<
void
()>
callback
)
10
: callback_(
callback
) {
11
handle_ =
CreateEvent
(NULL,
TRUE
, FALSE, NULL);
12
13
RegisterWaitForSingleObject(&handle_for_wait_, handle_, &CallbackForWait,
14
reinterpret_cast<
void
*
>
(
this
), INFINITE,
15
WT_EXECUTEONLYONCE | WT_EXECUTEINWAITTHREAD);
16
}
17
18
EventWatcher::~EventWatcher
() {
19
UnregisterWait(handle_for_wait_);
20
CloseHandle(handle_);
21
}
22
23
HANDLE
EventWatcher::GetHandle
() {
24
return
handle_;
25
}
26
27
// static
28
VOID
CALLBACK
EventWatcher::CallbackForWait(
PVOID
context,
BOOLEAN
) {
29
EventWatcher
*
self
=
reinterpret_cast<
EventWatcher
*
>
(context);
30
ResetEvent(
self
->handle_);
31
self
->callback_();
32
}
33
34
}
// namespace flutter
self
return self
Definition
FlutterTextureRegistryRelay.mm:19
flutter::EventWatcher
Definition
event_watcher.h:17
flutter::EventWatcher::~EventWatcher
~EventWatcher()
Definition
event_watcher.cc:18
flutter::EventWatcher::GetHandle
HANDLE GetHandle()
Definition
event_watcher.cc:23
flutter::EventWatcher::EventWatcher
EventWatcher(std::function< void()> callback)
Definition
event_watcher.cc:9
event_watcher.h
TRUE
return TRUE
Definition
fl_compositor_software.cc:68
callback
FlutterDesktopBinaryReply callback
Definition
flutter_windows_view_unittests.cc:52
flutter
Definition
asset_manager.cc:10
PVOID
void * PVOID
Definition
windows_types.h:35
BOOLEAN
BYTE BOOLEAN
Definition
windows_types.h:39
CreateEvent
#define CreateEvent
Definition
windows_types.h:250
VOID
#define VOID
Definition
windows_types.h:27
HANDLE
void * HANDLE
Definition
windows_types.h:36
CALLBACK
#define CALLBACK
Definition
windows_types.h:216
shell
platform
windows
event_watcher.cc
Generated on Thu Nov 6 2025 16:11:28 for Flutter Engine by
1.9.8