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

Side by Side Diff: vm/custom_isolate_test.cc

Issue 11613009: Changed the API in DartEntry for invoking dart code from C++ to make it more compatible with the re… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 // Custom Isolate Test. 9 // Custom Isolate Test.
10 // 10 //
(...skipping 30 matching lines...) Expand all
41 " completer.complete(port);\n" 41 " completer.complete(port);\n"
42 " return completer.future;\n" 42 " return completer.future;\n"
43 " }\n" 43 " }\n"
44 "\n" 44 "\n"
45 " static SendPort _start(entry)\n" 45 " static SendPort _start(entry)\n"
46 " native \"CustomIsolateImpl_start\";\n" 46 " native \"CustomIsolateImpl_start\";\n"
47 "\n" 47 "\n"
48 " String _entry;\n" 48 " String _entry;\n"
49 "}\n" 49 "}\n"
50 "\n" 50 "\n"
51 "interface CustomIsolate default CustomIsolateImpl {\n" 51 "abstract class CustomIsolate {\n"
52 " CustomIsolate(String entry);\n" 52 " factory CustomIsolate(String entry) = CustomIsolateImpl;\n"
53 "\n" 53 "\n"
54 " Future<SendPort> spawn();\n" 54 " Future<SendPort> spawn();\n"
55 "}\n" 55 "}\n"
56 "\n" 56 "\n"
57 "isolateMain() {\n" 57 "isolateMain() {\n"
58 " echo('Running isolateMain');\n" 58 " echo('Running isolateMain');\n"
59 " mainPort.receive((message, SendPort replyTo) {\n" 59 " mainPort.receive((message, SendPort replyTo) {\n"
60 " echo('Received: $message');\n" 60 " echo('Received: $message');\n"
61 " replyTo.send((message + 1), null);\n" 61 " replyTo.send((message + 1), null);\n"
62 " });\n" 62 " });\n"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 OS::Print("-- Finished event loop --\n"); 337 OS::Print("-- Finished event loop --\n");
338 EXPECT_STREQ("Received: 43", saved_echo); 338 EXPECT_STREQ("Received: 43", saved_echo);
339 free(const_cast<char*>(saved_echo)); 339 free(const_cast<char*>(saved_echo));
340 340
341 delete event_queue; 341 delete event_queue;
342 } 342 }
343 343
344 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 344 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
345 345
346 } // namespace dart 346 } // namespace dart
OLDNEW
« no previous file with comments | « vm/compiler.cc ('k') | vm/dart_api_impl.cc » ('j') | vm/dart_entry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698