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

Unified Diff: runtime/lib/isolate_patch.dart

Issue 749373002: - Implement Isolate.ping. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate_patch.dart
===================================================================
--- runtime/lib/isolate_patch.dart (revision 42173)
+++ runtime/lib/isolate_patch.dart (working copy)
@@ -322,7 +322,9 @@
// in vm/isolate.cc.
static const _PAUSE = 1;
static const _RESUME = 2;
+ static const _PING = 3;
+
static SendPort _spawnFunction(SendPort readyPort, Function topLevelFunction,
var message)
native "Isolate_spawnFunction";
@@ -369,7 +371,12 @@
}
/* patch */ void ping(SendPort responsePort, [int pingType = IMMEDIATE]) {
- throw new UnsupportedError("ping");
+ var msg = new List(4)
+ ..[0] = 0 // Make room for OOM message type.
+ ..[1] = _PING
+ ..[2] = responsePort
+ ..[3] = pingType;
+ _sendOOB(controlPort, msg);
}
/* patch */ void addErrorListener(SendPort port) {
« no previous file with comments | « no previous file | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698