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

Side by Side Diff: runtime/lib/isolate_patch.dart

Issue 545483002: Per isolate package root. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up main.cc Created 6 years, 3 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
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | 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) 2012, 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 import "dart:collection" show HashMap; 5 import "dart:collection" show HashMap;
6 6
7 patch class ReceivePort { 7 patch class ReceivePort {
8 /* patch */ factory ReceivePort() = _ReceivePortImpl; 8 /* patch */ factory ReceivePort() = _ReceivePortImpl;
9 9
10 /* patch */ factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) = 10 /* patch */ factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) =
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 readyPort.close(); 270 readyPort.close();
271 } 271 }
272 return new Future<Isolate>.error(e, st); 272 return new Future<Isolate>.error(e, st);
273 }; 273 };
274 } 274 }
275 275
276 /* patch */ static Future<Isolate> spawnUri( 276 /* patch */ static Future<Isolate> spawnUri(
277 Uri uri, List<String> args, var message, 277 Uri uri, List<String> args, var message,
278 { bool paused: false, Uri packageRoot }) { 278 { bool paused: false, Uri packageRoot }) {
279 // `paused` isn't handled yet. 279 // `paused` isn't handled yet.
280 // `packageRoot` isn't handled yet.
281 if (packageRoot != null) throw new UnimplementedError("packageRoot");
282 RawReceivePort readyPort; 280 RawReceivePort readyPort;
283 try { 281 try {
284 // The VM will invoke [_startIsolate] and not `main`. 282 // The VM will invoke [_startIsolate] and not `main`.
285 readyPort = new RawReceivePort(); 283 readyPort = new RawReceivePort();
286 _spawnUri(readyPort.sendPort, uri.toString(), args, message); 284 var packageRootString;
Ivan Posva 2014/09/19 16:50:17 var packageRootString = (packageRoot == null) ? nu
Anders Johnsen 2014/09/22 07:08:33 Done.
285 if (packageRoot != null) {
286 packageRootString = packageRoot.toString();
287 }
288 _spawnUri(
289 readyPort.sendPort, uri.toString(), args, message, packageRootString);
287 Completer completer = new Completer<Isolate>.sync(); 290 Completer completer = new Completer<Isolate>.sync();
288 readyPort.handler = (readyMessage) { 291 readyPort.handler = (readyMessage) {
289 readyPort.close(); 292 readyPort.close();
290 assert(readyMessage is List); 293 assert(readyMessage is List);
291 assert(readyMessage.length == 2); 294 assert(readyMessage.length == 2);
292 SendPort controlPort = readyMessage[0]; 295 SendPort controlPort = readyMessage[0];
293 List capabilities = readyMessage[1]; 296 List capabilities = readyMessage[1];
294 completer.complete(new Isolate(controlPort, 297 completer.complete(new Isolate(controlPort,
295 pauseCapability: capabilities[0], 298 pauseCapability: capabilities[0],
296 terminateCapability: capabilities[1])); 299 terminateCapability: capabilities[1]));
(...skipping 12 matching lines...) Expand all
309 // These values need to be kept in sync with the class IsolateMessageHandler 312 // These values need to be kept in sync with the class IsolateMessageHandler
310 // in vm/isolate.cc. 313 // in vm/isolate.cc.
311 static const _PAUSE = 1; 314 static const _PAUSE = 1;
312 static const _RESUME = 2; 315 static const _RESUME = 2;
313 316
314 static SendPort _spawnFunction(SendPort readyPort, Function topLevelFunction, 317 static SendPort _spawnFunction(SendPort readyPort, Function topLevelFunction,
315 var message) 318 var message)
316 native "Isolate_spawnFunction"; 319 native "Isolate_spawnFunction";
317 320
318 static SendPort _spawnUri(SendPort readyPort, String uri, 321 static SendPort _spawnUri(SendPort readyPort, String uri,
319 List<String> args, var message) 322 List<String> args, var message,
323 String packageRoot)
320 native "Isolate_spawnUri"; 324 native "Isolate_spawnUri";
321 325
322 static void _sendOOB(port, msg) native "Isolate_sendOOB"; 326 static void _sendOOB(port, msg) native "Isolate_sendOOB";
323 327
324 /* patch */ void _pause(Capability resumeCapability) { 328 /* patch */ void _pause(Capability resumeCapability) {
325 var msg = new List(4) 329 var msg = new List(4)
326 ..[0] = 0 // Make room for OOM message type. 330 ..[0] = 0 // Make room for OOM message type.
327 ..[1] = _PAUSE 331 ..[1] = _PAUSE
328 ..[2] = pauseCapability 332 ..[2] = pauseCapability
329 ..[3] = resumeCapability; 333 ..[3] = resumeCapability;
(...skipping 30 matching lines...) Expand all
360 } 364 }
361 365
362 /* patch */ void addErrorListener(SendPort port) { 366 /* patch */ void addErrorListener(SendPort port) {
363 throw new UnsupportedError("addErrorListener"); 367 throw new UnsupportedError("addErrorListener");
364 } 368 }
365 369
366 /* patch */ void removeErrorListener(SendPort port) { 370 /* patch */ void removeErrorListener(SendPort port) {
367 throw new UnsupportedError("removeErrorListener"); 371 throw new UnsupportedError("removeErrorListener");
368 } 372 }
369 } 373 }
OLDNEW
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698