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

Unified Diff: frog/lib/isolate.dart

Issue 8457005: convert isolates to use Future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated co19 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 | « frog/lib/dom/html.dart ('k') | runtime/lib/isolate.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/lib/isolate.dart
diff --git a/frog/lib/isolate.dart b/frog/lib/isolate.dart
index 0680c740d1c4e3fd392009d8aadf8cdc4bf54dbf..ce13bf00de404592979a99b12ee2f3a0250bc026 100644
--- a/frog/lib/isolate.dart
+++ b/frog/lib/isolate.dart
@@ -153,15 +153,15 @@ class ReceivePortSingleShotImpl implements ReceivePort {
final String _SPAWNED_SIGNAL = "spawned";
class IsolateNatives {
- static Promise<SendPort> spawn(Isolate isolate, bool isLight) {
- Promise<SendPort> result = new Promise<SendPort>();
+ static Future<SendPort> spawn(Isolate isolate, bool isLight) {
+ Completer<SendPort> completer = new Completer<SendPort>();
ReceivePort port = new ReceivePort.singleShot();
port.receive((msg, SendPort replyPort) {
assert(msg == _SPAWNED_SIGNAL);
- result.complete(replyPort);
+ completer.complete(replyPort);
});
_spawn(isolate, isLight, port.toSendPort());
- return result;
+ return completer.future;
}
static SendPort _spawn(Isolate isolate, bool light, SendPort port) native;
« no previous file with comments | « frog/lib/dom/html.dart ('k') | runtime/lib/isolate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698