Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Friends | List of all members
dart::bin::EventHandler Class Reference

#include <eventhandler.h>

Public Member Functions

 EventHandler ()
 
void SendData (intptr_t id, Dart_Port dart_port, int64_t data)
 
void NotifyShutdownDone ()
 

Static Public Member Functions

static void Start ()
 
static void Stop ()
 
static EventHandlerImplementationdelegate ()
 
static void SendFromNative (intptr_t id, Dart_Port port, int64_t data)
 

Friends

class EventHandlerImplementation
 

Detailed Description

Definition at line 603 of file eventhandler.h.

Constructor & Destructor Documentation

◆ EventHandler()

dart::bin::EventHandler::EventHandler ( )
inline

Definition at line 605 of file eventhandler.h.

605{}

Member Function Documentation

◆ delegate()

EventHandlerImplementation * dart::bin::EventHandler::delegate ( )
static

Definition at line 64 of file eventhandler.cc.

64 {
65 if (event_handler == nullptr) {
66 return nullptr;
67 }
68 return &event_handler->delegate_;
69}
static EventHandler * event_handler
Definition: eventhandler.cc:18

◆ NotifyShutdownDone()

void dart::bin::EventHandler::NotifyShutdownDone ( )

Signal to main thread that event handler is done.

Definition at line 35 of file eventhandler.cc.

35 {
36 MonitorLocker ml(shutdown_monitor);
37 ml.Notify();
38}
static Monitor * shutdown_monitor
Definition: eventhandler.cc:19

◆ SendData()

void dart::bin::EventHandler::SendData ( intptr_t  id,
Dart_Port  dart_port,
int64_t  data 
)
inline

Definition at line 606 of file eventhandler.h.

606 {
607 delegate_.SendData(id, dart_port, data);
608 }
void SendData(intptr_t id, Dart_Port dart_port, int64_t data)
static int8_t data[kExtLength]

◆ SendFromNative()

void dart::bin::EventHandler::SendFromNative ( intptr_t  id,
Dart_Port  port,
int64_t  data 
)
static

Definition at line 71 of file eventhandler.cc.

71 {
73}
void SendData(intptr_t id, Dart_Port dart_port, int64_t data)
Definition: eventhandler.h:606
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
Definition: switches.h:87

◆ Start()

void dart::bin::EventHandler::Start ( )
static

Start the event-handler.

Definition at line 21 of file eventhandler.cc.

21 {
22 // Initialize global socket registry.
24
25 ASSERT(event_handler == nullptr);
26 shutdown_monitor = new Monitor();
29
31 FATAL("Failed to initialize sockets");
32 }
33}
void Start(EventHandler *handler)
static bool Initialize()
#define ASSERT(E)
#define FATAL(error)

◆ Stop()

void dart::bin::EventHandler::Stop ( )
static

Stop the event-handler. It's expected that there will be no further calls to SendData after a call to Stop.

Definition at line 40 of file eventhandler.cc.

40 {
41 if (event_handler == nullptr) {
42 return;
43 }
44
45 // Wait until it has stopped.
46 {
47 MonitorLocker ml(shutdown_monitor);
48
49 // Signal to event handler that we want it to stop.
50 event_handler->delegate_.Shutdown();
51 ml.Wait(Monitor::kNoTimeout);
52 }
53
54 // Cleanup
55 delete event_handler;
56 event_handler = nullptr;
57 delete shutdown_monitor;
58 shutdown_monitor = nullptr;
59
60 // Destroy the global socket registry.
62}
static constexpr int64_t kNoTimeout
Definition: thread.h:79

Friends And Related Function Documentation

◆ EventHandlerImplementation

friend class EventHandlerImplementation
friend

Definition at line 631 of file eventhandler.h.


The documentation for this class was generated from the following files: