5#ifndef RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_
6#define RUNTIME_BIN_EVENTHANDLER_FUCHSIA_H_
8#if !defined(RUNTIME_BIN_EVENTHANDLER_H_)
9#error Do not include eventhandler_fuchsia.h directly; use eventhandler.h.
13#include <lib/fdio/unsafe.h>
14#include <sys/socket.h>
16#include <zircon/status.h>
17#include <zircon/syscalls.h>
18#include <zircon/syscalls/object.h>
19#include <zircon/syscalls/port.h>
35 write_events_enabled_(
true),
36 read_events_enabled_(
true),
37 close_events_enabled_(
true),
39 handle_(ZX_HANDLE_INVALID),
41 fdio_(fdio_unsafe_fd_to_io(
fd)) {}
43 intptr_t
fd()
const {
return fd_; }
49 intptr_t
Accept(
struct sockaddr*
addr, socklen_t* addrlen);
66 if (fdio_ !=
nullptr) {
67 fdio_unsafe_release(fdio_);
71 bool AsyncWaitLocked(zx_handle_t
port, uint32_t events, uint64_t
key);
75 bool write_events_enabled_;
76 bool read_events_enabled_;
77 bool close_events_enabled_;
81 intptr_t available_bytes_;
153 static constexpr uint64_t kInterruptPacketKey = 1;
156 static void* GetHashmapKeyFromFd(intptr_t fd);
157 static uint32_t GetHashmapHashFromFd(intptr_t fd);
158 static void AddToPort(zx_handle_t port_handle,
DescriptorInfo* di);
159 static void RemoveFromPort(zx_handle_t port_handle,
DescriptorInfo* di);
161 int64_t GetTimeout()
const;
162 void HandlePacket(zx_port_packet_t* pkt);
163 void HandleTimeout();
164 void WakeupHandler(intptr_t
id,
Dart_Port dart_port, int64_t
data);
165 intptr_t GetPollEvents(intptr_t events);
171 zx_handle_t port_handle_;
DescriptorInfoMultiple(intptr_t fd)
virtual ~DescriptorInfoMultiple()
DescriptorInfoSingle(intptr_t fd)
virtual ~DescriptorInfoSingle()
IOHandle * io_handle() const
DescriptorInfo(intptr_t fd)
virtual ~DescriptorInfo()
void SendData(intptr_t id, Dart_Port dart_port, int64_t data)
EventHandlerImplementation()
void UpdatePort(intptr_t old_mask, DescriptorInfo *di)
void Start(EventHandler *handler)
~EventHandlerImplementation()
DescriptorInfo * GetDescriptorInfo(intptr_t fd, bool is_listening)
bool AsyncWait(zx_handle_t port, uint32_t events, uint64_t key)
intptr_t Write(const void *buffer, intptr_t num_bytes)
uint32_t WaitEnd(zx_signals_t observed)
static intptr_t EpollEventsToMask(intptr_t events)
intptr_t AvailableBytes()
intptr_t ToggleEvents(intptr_t event_mask)
intptr_t Read(void *buffer, intptr_t num_bytes)
intptr_t Accept(struct sockaddr *addr, socklen_t *addrlen)
void CancelWait(zx_handle_t port, uint64_t key)
uint32_t MaskToEpollEvents(intptr_t mask)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static int8_t data[kExtLength]
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service port
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer