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

Unified Diff: runtime/include/dart_api.h

Issue 8588040: Add a mid-sized integration test for the Dart Embedding Api which (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
===================================================================
--- runtime/include/dart_api.h (revision 1904)
+++ runtime/include/dart_api.h (working copy)
@@ -382,8 +382,8 @@
* processing this message.
*/
typedef bool (*Dart_PostMessageCallback)(Dart_Isolate dest_isolate,
- Dart_Port dest_port,
- Dart_Port reply_port,
+ Dart_Port dest_port_id,
+ Dart_Port reply_port_id,
Dart_Message message);
// TODO(turnidge): Add a Dart_ReleaseMessage to hide allocation details.
@@ -397,7 +397,7 @@
* 'port' parameter when all active ports are being closed at once.
*/
typedef void (*Dart_ClosePortCallback)(Dart_Isolate isolate,
- Dart_Port port);
+ Dart_Port port_id);
/**
* Allows embedders to provide an alternative mechanism for sending
@@ -424,8 +424,8 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_HandleMessage(Dart_Port dest_port,
- Dart_Port reply_port,
+DART_EXPORT Dart_Handle Dart_HandleMessage(Dart_Port dest_port_id,
+ Dart_Port reply_port_id,
Dart_Message dart_message);
// TODO(turnidge): Revisit memory management of 'dart_message'.
@@ -445,6 +445,18 @@
// TODO(turnidge): Should this be removed from the public api?
/**
+ * Gets the main port id for the current isolate.
+ */
+DART_EXPORT Dart_Port Dart_GetMainPortId();
+
+/**
+ * Does the current isolate have live ReceivePorts?
+ *
+ * A ReceivePort is live when it has not been closed.
+ */
+DART_EXPORT bool Dart_HasLivePorts();
+
+/**
* Posts a message for some isolate. The message is built from a raw
* array.
*
@@ -454,7 +466,7 @@
*
* \return True if the message was posted.
*/
-DART_EXPORT bool Dart_PostIntArray(Dart_Port port,
+DART_EXPORT bool Dart_PostIntArray(Dart_Port port_id,
intptr_t length,
intptr_t* data);
// TODO(turnidge): Should this be intptr_t or some fixed length type?
@@ -471,8 +483,20 @@
*
* \return True if the message was posted.
*/
-DART_EXPORT bool Dart_Post(Dart_Port port, Dart_Handle object);
+DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle object);
+/**
+ * Returns a new SendPort with the provided port id.
+ */
+DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id);
+
+/**
+ * Gets the ReceivePort for the provided port id, creating it if necessary.
+ *
+ * Note that there is at most one ReceivePort for a given port id.
+ */
+DART_EXPORT Dart_Handle Dart_GetReceivePort(Dart_Port port_id);
+
// --- Scopes ----
/**
« no previous file with comments | « no previous file | runtime/lib/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698