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

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

Issue 2072873002: Fix for issue 26555, do not inherit package root and package config from the parent isolate when do… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | tests/standalone/packages_file_test.dart » ('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 import "dart:_internal"; 6 import "dart:_internal";
7 7
8 patch class ReceivePort { 8 patch class ReceivePort {
9 /* patch */ factory ReceivePort() = _ReceivePortImpl; 9 /* patch */ factory ReceivePort() = _ReceivePortImpl;
10 10
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 305
306 /* patch */ static Future<Isolate> spawn( 306 /* patch */ static Future<Isolate> spawn(
307 void entryPoint(message), var message, 307 void entryPoint(message), var message,
308 {bool paused: false, bool errorsAreFatal, 308 {bool paused: false, bool errorsAreFatal,
309 SendPort onExit, SendPort onError}) async { 309 SendPort onExit, SendPort onError}) async {
310 // `paused` isn't handled yet. 310 // `paused` isn't handled yet.
311 RawReceivePort readyPort; 311 RawReceivePort readyPort;
312 try { 312 try {
313 // The VM will invoke [_startIsolate] with entryPoint as argument. 313 // The VM will invoke [_startIsolate] with entryPoint as argument.
314 readyPort = new RawReceivePort(); 314 readyPort = new RawReceivePort();
315 var packageRoot = null;
316 var packageConfig = null;
317 if (Isolate._packageSupported()) {
318 packageRoot = (await Isolate.packageRoot)?.toString();
319 packageConfig = (await Isolate.packageConfig)?.toString();
320 }
321 315
316 // We do not inherit the package root or package config settings
317 // from the parent isolate, instead we use the values that were
318 // set on the command line.
319 var packageRoot = VMLibraryHooks.packageRootString;
320 var packageConfig = VMLibraryHooks.packageConfigString;
322 var script = VMLibraryHooks.platformScript; 321 var script = VMLibraryHooks.platformScript;
323 if (script == null) { 322 if (script == null) {
324 // We do not have enough information to support spawning the new 323 // We do not have enough information to support spawning the new
325 // isolate. 324 // isolate.
326 throw new UnsupportedError("Isolate.spawn"); 325 throw new UnsupportedError("Isolate.spawn");
327 } 326 }
328 if (script.scheme == "package") { 327 if (script.scheme == "package") {
329 script = await Isolate.resolvePackageUri(script); 328 script = await Isolate.resolvePackageUri(script);
330 } 329 }
331 330
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 try { 573 try {
575 return Uri.parse(_getCurrentRootUriStr()); 574 return Uri.parse(_getCurrentRootUriStr());
576 } catch (e, s) { 575 } catch (e, s) {
577 return null; 576 return null;
578 } 577 }
579 } 578 }
580 579
581 static String _getCurrentRootUriStr() 580 static String _getCurrentRootUriStr()
582 native "Isolate_getCurrentRootUriStr"; 581 native "Isolate_getCurrentRootUriStr";
583 } 582 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/packages_file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698