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

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

Issue 43663003: dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 8ad378569618eb3dd922e5f140e5eb57a35d47bb..a8dd6bac1c54f6343b7a5ffc994a15c78dfb4c8e 100644
--- a/sdk/lib/_internal/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/lib/isolate_patch.dart
@@ -12,35 +12,14 @@ 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));
}
patch static Future<Isolate> spawnUri(
Uri uri, List<String> args, var message) {
- throw new UnimplementedError("spawn uri");
- }
-}
-
-class _Isolate {
- static ReceivePort get port {
- if (lazyPort == null) {
- lazyPort = new ReceivePort();
- }
- 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 _spawnUri(String uri) {
- return IsolateNatives.spawn(null, uri, false);
+ SendPort controlPort = IsolateNatives.spawn(uri, args, message);
Lasse Reichstein Nielsen 2013/10/25 12:45:59 spawn->spawnUri
floitsch 2013/10/25 13:52:56 argh. That was already fixed locally in a differen
+ return new Future<Isolate>.value(new Isolate._fromControlPort(controlPort));
}
}
@@ -59,4 +38,4 @@ patch class RawReceivePort {
patch factory RawReceivePort([void handler(event)]) {
throw new UnimplementedError("RawReceivePort");
}
-}
+}

Powered by Google App Engine
This is Rietveld 408576698