Index: runtime/include/dart_api.h |
=================================================================== |
--- runtime/include/dart_api.h (revision 3557) |
+++ runtime/include/dart_api.h (working copy) |
@@ -424,81 +424,42 @@ |
// --- Messages and Ports --- |
/** |
- * Messages are used to communicate between isolates. |
- */ |
-typedef struct _Dart_Message* Dart_Message; |
- |
-/** |
* A port is used to send or receive inter-isolate messages |
*/ |
typedef int64_t Dart_Port; |
-const Dart_Port kNoReplyPort = 0; |
- |
/** |
- * A message posting callback. |
+ * A message notification callback. |
* |
- * This callback allows the embedder to provide an alternate delivery |
- * mechanism for inter-isolate messages. It is the responsibility of |
- * the embedder to call Dart_HandleMessage to process the message. |
- * |
- * If there is no reply port, then the constant 'kNoReplyPort' is |
- * passed as the 'reply_port' parameter. |
- * |
- * The memory pointed to by 'message' has been allocated by malloc. It |
- * is the responsibility of the callback to ensure that free(message) |
- * is called once the message has been processed. |
- * |
- * The callback should return false if it runs into a problem |
- * processing this message. |
+ * This callback allows the embedder to provide an alternate wakeup |
+ * mechanism for the delivery of inter-isolate messages. It is the |
+ * responsibility of the embedder to call Dart_HandleMessage to |
+ * process the message. |
*/ |
-typedef bool (*Dart_PostMessageCallback)(Dart_Isolate dest_isolate, |
- Dart_Port dest_port_id, |
- Dart_Port reply_port_id, |
- Dart_Message message); |
-// TODO(turnidge): Add a Dart_ReleaseMessage to hide allocation details. |
+typedef void (*Dart_MessageNotifyCallback)(Dart_Isolate dest_isolate); |
-const Dart_Port kCloseAllPorts = 0; |
- |
/** |
- * A close port callback. |
+ * Allows embedders to provide an alternative wakeup mechanism for the |
+ * delivery of inter-isolate messages. This setting only applies to |
+ * the current isolate. |
* |
- * This callback allows the embedder to receive notification when a |
- * port is closed. The constant 'kCloseAllPorts' is passed as the |
- * 'port' parameter when all active ports are being closed at once. |
- */ |
-typedef void (*Dart_ClosePortCallback)(Dart_Isolate isolate, |
- Dart_Port port_id); |
- |
-/** |
- * Allows embedders to provide an alternative mechanism for sending |
- * inter-isolate messages. This setting only applies to the current |
- * isolate. |
- * |
* Most embedders will only call this function once, before isolate |
* execution begins. If this function is called after isolate |
* execution begins, the embedder is responsible for threading issues. |
*/ |
-DART_EXPORT void Dart_SetMessageCallbacks( |
- Dart_PostMessageCallback post_message_callback, |
- Dart_ClosePortCallback close_port_callback); |
+DART_EXPORT void Dart_SetMessageNotifyCallback( |
+ Dart_MessageNotifyCallback message_notify_callback); |
// TODO(turnidge): Consider moving this to isolate creation so that it |
// is impossible to mess up. |
/** |
- * Handles a message on the current isolate. |
+ * Handles the next pending message for the current isolate. |
* |
* May generate an unhandled exception error. |
* |
- * Note that this function does not free the memory associated with |
- * 'dart_message'. |
- * |
* \return A valid handle if no error occurs during the operation. |
*/ |
-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'. |
+DART_EXPORT Dart_Handle Dart_HandleMessage(); |
/** |
* Processes any incoming messages for the current isolate. |