Index: runtime/vm/native_api_impl.cc |
diff --git a/runtime/vm/native_api_impl.cc b/runtime/vm/native_api_impl.cc |
index c707c9e9cf776f4b752becc58dedc150cdd3a504..2345b465323c2abbd3404b2018c200992d2f6833 100644 |
--- a/runtime/vm/native_api_impl.cc |
+++ b/runtime/vm/native_api_impl.cc |
@@ -56,6 +56,17 @@ DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message) { |
} |
+DART_EXPORT bool Dart_PostInteger(Dart_Port port_id, intptr_t message) { |
+ if (!Smi::IsValid(message)) { |
+ return false; |
+ } |
+ Message* msg = new Message(port_id, message, Message::kNormalPriority); |
+ |
+ // Post the message at the given port. |
+ return PortMap::PostMessage(msg); |
+} |
+ |
+ |
DART_EXPORT Dart_Port Dart_NewNativePort(const char* name, |
Dart_NativeMessageHandler handler, |
bool handle_concurrently) { |