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

Side by Side Diff: runtime/bin/vmservice/loader.dart

Issue 1278623002: - Make sure to close the port if a packages file was passed on the (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address previous review comments. Created 5 years, 4 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 | « runtime/bin/builtin.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 part of vmservice_io; 5 part of vmservice_io;
6 6
7 _log(msg) { 7 _log(msg) {
8 print("% $msg"); 8 print("% $msg");
9 } 9 }
10 10
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // Try to load the .packages file next to the resource. 390 // Try to load the .packages file next to the resource.
391 var packagesUri = resource.resolve(".packages"); 391 var packagesUri = resource.resolve(".packages");
392 var exists = await _loadHttpPackagesFile(sp, traceLoading, packagesUri); 392 var exists = await _loadHttpPackagesFile(sp, traceLoading, packagesUri);
393 if (!exists) { 393 if (!exists) {
394 // If the loading of the .packages file failed for http/https based 394 // If the loading of the .packages file failed for http/https based
395 // scripts then setup the package root. 395 // scripts then setup the package root.
396 var packageRoot = resource.resolve('packages/'); 396 var packageRoot = resource.resolve('packages/');
397 sp.send([packageRoot.toString()]); 397 sp.send([packageRoot.toString()]);
398 } 398 }
399 } else { 399 } else {
400 sp.send("Unsupported base URI to identify .packages file: " 400 sp.send("Unsupported scheme used to locate .packages file: "
401 "'$resource'."); 401 "'$resource'.");
402 } 402 }
403 } else if (id == -2) { 403 } else if (id == -2) {
404 if (traceLoading) { 404 if (traceLoading) {
405 _log("Handling load of packages map: '$resource'."); 405 _log("Handling load of packages map: '$resource'.");
406 } 406 }
407 if (resource.scheme == 'file') { 407 if (resource.scheme == 'file') {
408 var exists = await new File.fromUri(resource).exists(); 408 var exists = await new File.fromUri(resource).exists();
409 if (exists) { 409 if (exists) {
410 _loadPackagesFile(sp, traceLoading, resource); 410 _loadPackagesFile(sp, traceLoading, resource);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 assert(id != null); 442 assert(id != null);
443 String resource = request[3]; 443 String resource = request[3];
444 assert(resource != null); 444 assert(resource != null);
445 var uri = Uri.parse(resource); 445 var uri = Uri.parse(resource);
446 if (id >= 0) { 446 if (id >= 0) {
447 _handleResourceRequest(sp, traceLoading, id, uri); 447 _handleResourceRequest(sp, traceLoading, id, uri);
448 } else { 448 } else {
449 _handlePackagesRequest(sp, traceLoading, id, uri); 449 _handlePackagesRequest(sp, traceLoading, id, uri);
450 } 450 }
451 } 451 }
OLDNEW
« no previous file with comments | « runtime/bin/builtin.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698