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

Unified Diff: runtime/lib/isolate_patch.dart

Issue 881373002: Implemented more of the Isolate API (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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 | « no previous file | runtime/vm/isolate.h » ('j') | runtime/vm/isolate.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate_patch.dart
===================================================================
--- runtime/lib/isolate_patch.dart (revision 44200)
+++ runtime/lib/isolate_patch.dart (working copy)
@@ -335,6 +335,11 @@
static const _RESUME = 2;
static const _PING = 3;
static const _KILL = 4;
+ static const _ADD_EXIT = 5;
+ static const _DEL_EXIT = 6;
+ static const _ADD_ERROR = 7;
+ static const _DEL_ERROR = 8;
+ static const _ERROR_FATAL = 9;
static void _spawnFunction(SendPort readyPort, Function topLevelFunction,
@@ -367,15 +372,28 @@
}
/* patch */ void addOnExitListener(SendPort responsePort) {
- throw new UnsupportedError("addOnExitListener");
+ var msg = new List(3)
+ ..[0] = 0 // Make room for OOB message type.
+ ..[1] = _ADD_EXIT
+ ..[2] = responsePort;
+ _sendOOB(controlPort, msg);
}
/* patch */ void removeOnExitListener(SendPort responsePort) {
- throw new UnsupportedError("removeOnExitListener");
+ var msg = new List(3)
+ ..[0] = 0 // Make room for OOB message type.
+ ..[1] = _DEL_EXIT
+ ..[2] = responsePort;
+ _sendOOB(controlPort, msg);
}
/* patch */ void setErrorsFatal(bool errorsAreFatal) {
- throw new UnsupportedError("setErrorsFatal");
+ var msg = new List(4)
+ ..[0] = 0 // Make room for OOB message type.
+ ..[1] = _ERROR_FATAL
+ ..[2] = terminateCapability
+ ..[3] = errorsAreFatal;
+ _sendOOB(controlPort, msg);
}
/* patch */ void kill([int priority = BEFORE_NEXT_EVENT]) {
@@ -397,11 +415,19 @@
}
/* patch */ void addErrorListener(SendPort port) {
siva 2015/03/06 23:56:04 maybe call the param responsePort to be consistent
Ivan Posva 2015/03/07 04:20:39 I went by the names in the Dart API documentation.
- throw new UnsupportedError("addErrorListener");
+ var msg = new List(3)
+ ..[0] = 0 // Make room for OOB message type.
+ ..[1] = _ADD_ERROR
+ ..[2] = port;
+ _sendOOB(controlPort, msg);
}
/* patch */ void removeErrorListener(SendPort port) {
siva 2015/03/06 23:56:04 Ditto comment on responsePort
- throw new UnsupportedError("removeErrorListener");
+ var msg = new List(3)
+ ..[0] = 0 // Make room for OOB message type.
+ ..[1] = _DEL_ERROR
+ ..[2] = port;
+ _sendOOB(controlPort, msg);
}
static Isolate _getCurrentIsolate() {
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | runtime/vm/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698