19Handle::Handle(zx_handle_t handle) :
handle_(handle) {}
23 zx_status_t status =
Close();
29 return fml::MakeRefCounted<Handle>(handle);
36zx_handle_t Handle::ReleaseHandle() {
41 cached_koid_ = std::nullopt;
42 while (waiters_.size()) {
46 waiters_.back()->Cancel();
56 zx_handle_t handle = ReleaseHandle();
57 return zx_handle_close(handle);
59 return ZX_ERR_BAD_HANDLE;
65 FML_LOG(WARNING) <<
"Attempt to wait on an invalid handle.";
71 waiters_.push_back(waiter.
get());
78 auto iter =
std::find(waiters_.cbegin(), waiters_.cend(), waiter);
89 zx_handle_t out_handle;
90 zx_status_t status = zx_handle_duplicate(
handle_, rights, &out_handle);
91 if (status != ZX_OK) {
102 zx_handle_t out_handle;
103 zx_status_t status = zx_handle_replace(ReleaseHandle(), rights, &out_handle);
104 if (status != ZX_OK) {
112#define FOR_EACH_STATIC_BINDING(V) V(Handle, CreateInvalid)
114#define FOR_EACH_BINDING(V) \
117 V(Handle, is_valid) \
119 V(Handle, AsyncWait) \
120 V(Handle, Duplicate) \
126#define DART_REGISTER_NATIVE_STATIC_(CLASS, METHOD) \
127 DART_REGISTER_NATIVE_STATIC(CLASS, METHOD),
static sk_sp< Effect > Create()
static bool is_valid(SkISize dim)
int find(T *array, int N, T item)
struct _Dart_Handle * Dart_Handle
#define DART_NATIVE_CALLBACK_STATIC(CLASS, METHOD)
#define DART_NATIVE_NO_UI_CHECK_CALLBACK(CLASS, METHOD)
#define DART_REGISTER_NATIVE(CLASS, METHOD)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
static guint signals[kSignalLastSignal]
#define FML_LOG(severity)
#define FML_DCHECK(condition)
fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor)
void Close(PathBuilder *builder)
Dart_Handle ToDart(const T &object)
IMPLEMENT_WRAPPERTYPEINFO(zircon, Handle)
#define FOR_EACH_STATIC_BINDING(V)
#define FOR_EACH_BINDING(V)
#define DART_REGISTER_NATIVE_STATIC_(CLASS, METHOD)