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

Unified Diff: lib/isolate/isolate_frog.dart

Issue 9422019: isolates refactor: this change introduces 'dart:isolate' as a library. This is a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 10 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 | « lib/isolate/isolate_compiler.dart ('k') | runtime/bin/builtin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/isolate/isolate_frog.dart
diff --git a/lib/isolate/isolate_frog.dart b/lib/isolate/isolate_frog.dart
new file mode 100644
index 0000000000000000000000000000000000000000..52a6686f14fcb509b1698a968f628860a4e62553
--- /dev/null
+++ b/lib/isolate/isolate_frog.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+// Dart isolate's API and implementation for frog.
+#library("dart:isolate");
+
+#source("isolate_api.dart");
+#source("frog/compiler_hooks.dart");
+#source("frog/isolateimpl.dart");
+#source("frog/ports.dart");
+#source("frog/messages.dart");
+#native("frog/natives.js");
+
+/** Default factory for [Isolate2]. */
+class _IsolateFactory {
+
+ factory Isolate2.fromCode(Function topLevelFunction) {
+ final name = _IsolateNatives._getJSFunctionName(topLevelFunction);
+ if (name == null) {
+ throw new UnsupportedOperationException(
+ "only top-level functions can be spawned.");
+ }
+ return new _Isolate2Impl(_IsolateNatives._spawn2(name, null, false));
+ }
+
+ factory Isolate2.fromUri(String uri) {
+ return new _Isolate2Impl(_IsolateNatives._spawn2(null, uri, false));
+ }
+}
« no previous file with comments | « lib/isolate/isolate_compiler.dart ('k') | runtime/bin/builtin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698