Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Unified Diff: runtime/bin/eventhandler_fuchsia.h

Issue 2168193002: Fuchsia: Build standalone VM. Make it run "Hello, World!". (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/eventhandler.h ('k') | runtime/bin/eventhandler_fuchsia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_fuchsia.h
diff --git a/runtime/bin/eventhandler_fuchsia.h b/runtime/bin/eventhandler_fuchsia.h
new file mode 100644
index 0000000000000000000000000000000000000000..013099232471828b81db8bac0a791805bc5f5cef
--- /dev/null
+++ b/runtime/bin/eventhandler_fuchsia.h
@@ -0,0 +1,44 @@
+// 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_
« no previous file with comments | « runtime/bin/eventhandler.h ('k') | runtime/bin/eventhandler_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698