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

Unified Diff: sdk/lib/_internal/lib/isolate_patch.dart

Issue 293393005: Make methods on isolate external. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | « runtime/lib/isolate_patch.dart ('k') | sdk/lib/isolate/isolate.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/isolate_patch.dart
diff --git a/sdk/lib/_internal/lib/isolate_patch.dart b/sdk/lib/_internal/lib/isolate_patch.dart
index 4959a0df41b1761642ebf23394bbbc50ac8d5a3a..78a8ca925677e1af628421b09c040fa4642f2370 100644
--- a/sdk/lib/_internal/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/lib/isolate_patch.dart
@@ -44,6 +44,71 @@ patch class Isolate {
return new Future<Isolate>.error(e, st);
}
}
+
+ patch void _pause(Capability resumeCapability) {
+ var message = new List(3)
+ ..[0] = "pause"
+ ..[1] = pauseCapability
+ ..[2] = resumeCapability;
+ controlPort.send(message);
+ }
+
+ patch void resume(Capability resumeCapability) {
+ var message = new List(2)
+ ..[0] = "resume"
+ ..[1] = resumeCapability;
+ controlPort.send(message);
+ }
+
+ patch void addOnExitListener(SendPort responsePort) {
+ // TODO(lrn): Can we have an internal method that checks if the receiving
+ // isolate of a SendPort is still alive?
+ var message = new List(2)
+ ..[0] = "add-ondone"
+ ..[1] = responsePort;
+ controlPort.send(message);
+ }
+
+ patch void removeOnExitListener(SendPort responsePort) {
+ var message = new List(2)
+ ..[0] = "remove-ondone"
+ ..[1] = responsePort;
+ controlPort.send(message);
+ }
+
+ patch void setErrorsFatal(bool errorsAreFatal) {
+ var message = new List(3)
+ ..[0] = "set-errors-fatal"
+ ..[1] = terminateCapability
+ ..[2] = errorsAreFatal;
+ controlPort.send(message);
+ }
+
+ patch void kill([int priority = BEFORE_NEXT_EVENT]) {
+ controlPort.send(["kill", terminateCapability, priority]);
+ }
+
+ patch void ping(SendPort responsePort, [int pingType = IMMEDIATE]) {
+ var message = new List(3)
+ ..[0] = "ping"
+ ..[1] = responsePort
+ ..[2] = pingType;
+ controlPort.send(message);
+ }
+
+ patch void addErrorListener(SendPort port) {
+ var message = new List(2)
+ ..[0] = "getErrors"
+ ..[1] = port;
+ controlPort.send(message);
+ }
+
+ patch void removeErrorListener(SendPort port) {
+ var message = new List(2)
+ ..[0] = "stopErrors"
+ ..[1] = port;
+ controlPort.send(message);
+ }
}
/** Default factory for receive ports. */
« no previous file with comments | « runtime/lib/isolate_patch.dart ('k') | sdk/lib/isolate/isolate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698