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

Unified Diff: runtime/include/dart_native_api.h

Issue 1499853004: Adds a special case for sending an int over a port with the native API. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « no previous file | runtime/lib/isolate.cc » ('j') | runtime/vm/isolate.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_native_api.h
diff --git a/runtime/include/dart_native_api.h b/runtime/include/dart_native_api.h
index ea7900df6be69603e2e3ad1d83f928e60496ff6c..1dc3d3bf7f9ad2a1abac6ace56f5a1c6f7ba4eeb 100644
--- a/runtime/include/dart_native_api.h
+++ b/runtime/include/dart_native_api.h
@@ -102,6 +102,29 @@ typedef struct _Dart_CObject {
DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message);
/**
+ * Posts a simple message on some port.
+ *
+ * This can be used to handles obtained from Dart_Null(), Dart_True(),
+ * Dart_False(), Dart_EmptyString(), and Dart_NewInteger() for small integers.
+ *
+ * \param port_id The destination port.
+ * \param message The message to send.
+ *
+ * \return True if the message was posted.
+ */
+DART_EXPORT bool Dart_PostSimpleObject(Dart_Port port_id, Dart_Handle message);
Ivan Posva 2015/12/09 22:45:28 Please remove this as it should be handled by Dart
zra 2015/12/10 00:07:29 Done.
+
+/**
+ * Posts a message on some port. The message will contain the integer 'message'.
+ *
+ * \param port_id The destination port.
+ * \param message The message to send.
+ *
+ * \return True if the message was posted.
+ */
+DART_EXPORT bool Dart_PostInteger(Dart_Port port_id, intptr_t message);
+
+/**
* A native message handler.
*
* This handler is associated with a native port by calling
« no previous file with comments | « no previous file | runtime/lib/isolate.cc » ('j') | runtime/vm/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698