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

Side by Side Diff: runtime/lib/isolate.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 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 class ReceivePortFactory { 5 class ReceivePortFactory {
6 factory ReceivePort() { 6 factory ReceivePort() {
7 return new ReceivePortImpl(); 7 return new ReceivePortImpl();
8 } 8 }
9 9
10 factory ReceivePort.singleShot() { 10 factory ReceivePort.singleShot() {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 // Forward the implementation of sending messages to the VM. Only port ids 134 // Forward the implementation of sending messages to the VM. Only port ids
135 // are being handed to the VM. 135 // are being handed to the VM.
136 static _sendInternal(int sendId, int replyId, var message) 136 static _sendInternal(int sendId, int replyId, var message)
137 native "SendPortImpl_sendInternal_"; 137 native "SendPortImpl_sendInternal_";
138 138
139 final int _id; 139 final int _id;
140 } 140 }
141 141
142 142 class _IsolateNatives {
143 class IsolateNatives {
144 static Future<SendPort> spawn(Isolate isolate, bool isLight) { 143 static Future<SendPort> spawn(Isolate isolate, bool isLight) {
145 Completer<SendPort> completer = new Completer<SendPort>(); 144 Completer<SendPort> completer = new Completer<SendPort>();
146 SendPort port = _start(isolate, isLight); 145 SendPort port = _start(isolate, isLight);
147 completer.complete(port); 146 completer.complete(port);
148 return completer.future; 147 return completer.future;
149 } 148 }
150 149
151 // Starts a new isolate calling the run method on a new instance of the 150 // Starts a new isolate calling the run method on a new instance of the
152 // remote class's type. 151 // remote class's type.
153 // Returns the send port which is passed to the newly created isolate. 152 // Returns the send port which is passed to the newly created isolate.
154 // This method is being dispatched to from the public core library code. 153 // This method is being dispatched to from the public core library code.
155 static SendPort _start(Isolate isolate, bool light) 154 static SendPort _start(Isolate isolate, bool light)
156 native "IsolateNatives_start"; 155 native "IsolateNatives_start";
157 } 156 }
157
158 class _IsolateFactory {
159
160 factory Isolate2.fromCode(Function topLevelFunction) {
161 throw new NotImplementedException();
162 }
163
164 factory Isolate2.fromUri(String uri) {
165 throw new NotImplementedException();
166 }
167 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698