Files
sdk/runtime/bin/eventhandler_fuchsia.h
T
Zachary Anderson 53374c3b99 Fuchsia: Build standalone VM. Make it run "Hello, World!".
This CL adds targets to the GN build that build the standalone Dart VM
without the observatory, and with dart:io enabled but with most of the
functionality stubbed out as UNIMPLEMENTED(). It also adds a simple
eventhandler for Fuchsia for implementing Timers.

R=asiva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2168193002 .
2016-07-22 14:00:31 -07:00

45 lines
1.1 KiB
C++

// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef BIN_EVENTHANDLER_FUCHSIA_H_
#define BIN_EVENTHANDLER_FUCHSIA_H_
#if !defined(BIN_EVENTHANDLER_H_)
#error Do not include eventhandler_fuchsia.h directly; use eventhandler.h instead.
#endif
#include <magenta/syscalls.h>
namespace dart {
namespace bin {
class EventHandlerImplementation {
public:
EventHandlerImplementation();
~EventHandlerImplementation();
void SendData(intptr_t id, Dart_Port dart_port, int64_t data);
void Start(EventHandler* handler);
void Shutdown();
private:
int64_t GetTimeout() const;
void HandleEvents();
void HandleTimeout();
void WakeupHandler(intptr_t id, Dart_Port dart_port, int64_t data);
void HandleInterruptFd();
static void Poll(uword args);
TimeoutQueue timeout_queue_;
bool shutdown_;
mx_handle_t interrupt_handles_[2];
DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation);
};
} // namespace bin
} // namespace dart
#endif // BIN_EVENTHANDLER_FUCHSIA_H_