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

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

Issue 40023002: Make dart2js Isolate.spawn work. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove whitespace changes to dart2js_html. 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
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 4f9ac711fbff3707dfce71c6cd8f20ff19ef1221..46eb383ab72242fd5a58f03cc1e7eed2f0a90511 100644
--- a/sdk/lib/_internal/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/lib/isolate_patch.dart
@@ -12,10 +12,11 @@ import 'dart:_isolate_helper' show IsolateNatives,
patch class Isolate {
patch static Future<Isolate> spawn(void entryPoint(message), var message) {
- throw new UnimplementedError("spawn");
+ SendPort controlPort = IsolateNatives.spawnFunction(entryPoint, message);
+ return new Future<Isolate>.value(new Isolate.fromControlPort(controlPort));
floitsch 2013/10/24 14:27:10 We are in the isolate library. So Isolate._fromCon
Lasse Reichstein Nielsen 2013/10/25 10:38:16 Avk, yes. Didn't need it in isolate_helper anyway.
}
- patch static Future<Isolate> spawnUri(Uri uri, var arguments) {
+ patch static Future<Isolate> spawnUri(Uri uri, var message) {
throw new UnimplementedError("spawn uri");
}
}
@@ -28,14 +29,8 @@ patch class _Isolate {
return lazyPort;
}
- static SendPort _spawnFunction(void topLevelFunction(),
- [bool unhandledExceptionCallback(IsolateUnhandledException e)]) {
- if (unhandledExceptionCallback != null) {
- // TODO(9012): Implement the UnhandledExceptionCallback.
- throw new UnimplementedError(
- "spawnFunction with unhandledExceptionCallback");
- }
- return IsolateNatives.spawnFunction(topLevelFunction);
+ static SendPort _spawnFunction(void topLevelFunction(), [message]) {
floitsch 2013/10/24 14:27:10 remove this static and call directly the IsolateNa
Lasse Reichstein Nielsen 2013/10/25 10:38:16 Removed completely. It's not being called.
+ return IsolateNatives.spawnFunction(topLevelFunction, message);
}
patch static SendPort spawnUri(String uri) {
@@ -58,4 +53,4 @@ patch class RawReceivePort {
patch factory RawReceivePort([void handler(event)]) {
throw new UnimplementedError("RawReceivePort");
}
-}
+}

Powered by Google App Engine
This is Rietveld 408576698