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

Unified Diff: runtime/vm/custom_isolate_test.cc

Issue 27215002: Very simple version of Isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 2 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/vm/bootstrap_natives.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/custom_isolate_test.cc
diff --git a/runtime/vm/custom_isolate_test.cc b/runtime/vm/custom_isolate_test.cc
index d64e8366800542c59233c6f691bd56703f4b8da3..7d43473bcbf1c6be10c83bc37da92a1836c92886 100644
--- a/runtime/vm/custom_isolate_test.cc
+++ b/runtime/vm/custom_isolate_test.cc
@@ -24,7 +24,7 @@ static Dart_NativeFunction NativeLookup(Dart_Handle name, int argc);
static const char* kCustomIsolateScriptChars =
"import 'dart:isolate';\n"
"\n"
- "ReceivePort mainPort;\n"
+ "RawReceivePort mainPort;\n"
"\n"
"echo(arg) native \"native_echo\";\n"
"\n"
@@ -51,21 +51,23 @@ static const char* kCustomIsolateScriptChars =
"\n"
"isolateMain() {\n"
" echo('Running isolateMain');\n"
- " mainPort.receive((message, SendPort replyTo) {\n"
- " echo('Received: $message');\n"
- " replyTo.send((message + 1), null);\n"
- " });\n"
+ " mainPort.handler = (message) {\n"
+ " var data = message[0];\n"
+ " var replyTo = message[1];\n"
+ " echo('Received: $data');\n"
+ " replyTo.send(data + 1);\n"
+ " };\n"
"}\n"
"\n"
"main() {\n"
" var isolate = new CustomIsolate(\"isolateMain\");\n"
- " var receivePort = new ReceivePort();\n"
+ " var receivePort = new RawReceivePort();\n"
" SendPort port = isolate.spawn();\n"
- " port.send(42, receivePort.toSendPort());\n"
- " receivePort.receive((message, _) {\n"
+ " port.send([42, receivePort.sendPort]);\n"
+ " receivePort.handler = (message) {\n"
" receivePort.close();\n"
" echo('Received: $message');\n"
- " });\n"
+ " };\n"
" return 'success';\n"
"}\n";
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698