| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |