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

Side by Side Diff: lib/isolate/isolate_leg.dart

Issue 9662046: Isolate library changes for leg support. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« lib/isolate/frog/natives.js ('K') | « lib/isolate/isolate_frog.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 5
6 // Dart isolate's API and implementation for frog. Since dartdocs are generated
7 // using frog, we include here some additional library level comments.
8
9 /** 6 /**
10 * The `dart:isolate` library defines APIs to spawn and communicate with 7 * The `dart:isolate` library defines APIs to spawn and communicate with
11 * isolates. 8 * isolates.
12 * 9 *
13 * All code in dart runs in the context of an isolate. Each isolate has its own 10 * All code in dart runs in the context of an isolate. Each isolate has its own
14 * heap, which means that all values in memory, including globals, are available 11 * heap, which means that all values in memory, including globals, are available
15 * only to that isolate. The only mechanism available to communicate between 12 * only to that isolate. The only mechanism available to communicate between
16 * isolates is to pass messages. Messages are sent through ports. This library 13 * isolates is to pass messages. Messages are sent through ports. This library
17 * defines [ReceivePort] to represent the receiver's end of a communication 14 * defines [ReceivePort] to represent the receiver's end of a communication
18 * channel, and [SendPort] to represent the sender's end. 15 * channel, and [SendPort] to represent the sender's end.
(...skipping 19 matching lines...) Expand all
38 * [spawnFunction] and [spawnUri], and we have an API to spawn DOM isolates. 35 * [spawnFunction] and [spawnUri], and we have an API to spawn DOM isolates.
39 */ 36 */
40 #library("dart:isolate"); 37 #library("dart:isolate");
41 38
42 #import("../uri/uri.dart"); 39 #import("../uri/uri.dart");
43 #source("isolate_api.dart"); 40 #source("isolate_api.dart");
44 #source("frog/compiler_hooks.dart"); 41 #source("frog/compiler_hooks.dart");
45 #source("frog/isolateimpl.dart"); 42 #source("frog/isolateimpl.dart");
46 #source("frog/ports.dart"); 43 #source("frog/ports.dart");
47 #source("frog/messages.dart"); 44 #source("frog/messages.dart");
48 #native("frog/natives.js");
ngeoffray 2012/03/11 15:43:54 I had to create another file because leg does not
49
50 ReceivePort _port;
51
52 SendPort _spawnFunction(void topLevelFunction()) {
53 final name = _IsolateNatives._getJSFunctionName(topLevelFunction);
54 if (name == null) {
55 throw new UnsupportedOperationException(
56 "only top-level functions can be spawned.");
57 }
58 return _IsolateNatives._spawn2(name, null, false);
59 }
60
61 SendPort _spawnUri(String uri) {
62 return _IsolateNatives._spawn2(null, uri, false);
63 }
OLDNEW
« lib/isolate/frog/natives.js ('K') | « lib/isolate/isolate_frog.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698