| 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 _sanitizeWindowsPath(path) { | 7 _sanitizeWindowsPath(path) { |
| 8 // For Windows we need to massage the paths a bit according to | 8 // For Windows we need to massage the paths a bit according to |
| 9 // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx | 9 // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx |
| 10 // | 10 // |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 // The directory to look in to resolve "package:" scheme URIs. By default it | 109 // The directory to look in to resolve "package:" scheme URIs. By default it |
| 110 // is the 'packages' directory right next to the script. | 110 // is the 'packages' directory right next to the script. |
| 111 Uri _packageRoot = null; | 111 Uri _packageRoot = null; |
| 112 | 112 |
| 113 // The map describing how certain package names are mapped to Uris. | 113 // The map describing how certain package names are mapped to Uris. |
| 114 Uri _packageConfig = null; | 114 Uri _packageConfig = null; |
| 115 Map<String, Uri> _packageMap = null; | 115 Map<String, Uri> _packageMap = null; |
| 116 | 116 |
| 117 _setPackageRoot(String packageRoot) { | 117 _setPackageRoot(String packageRoot) { |
| 118 packageRoot = _sanitizeWindowsPath(packageRoot); |
| 118 packageRoot = _enforceTrailingSlash(packageRoot); | 119 packageRoot = _enforceTrailingSlash(packageRoot); |
| 119 if (packageRoot.startsWith('file:') || | 120 if (packageRoot.startsWith('file:') || |
| 120 packageRoot.startsWith('http:') || | 121 packageRoot.startsWith('http:') || |
| 121 packageRoot.startsWith('https:')) { | 122 packageRoot.startsWith('https:')) { |
| 122 _packageRoot = _workingDirectory.resolve(packageRoot); | 123 _packageRoot = _workingDirectory.resolve(packageRoot); |
| 123 } else { | 124 } else { |
| 124 packageRoot = _sanitizeWindowsPath(packageRoot); | 125 packageRoot = _sanitizeWindowsPath(packageRoot); |
| 125 packageRoot = _trimWindowsPath(packageRoot); | 126 packageRoot = _trimWindowsPath(packageRoot); |
| 126 _packageRoot = _workingDirectory.resolveUri(new Uri.file(packageRoot)); | 127 _packageRoot = _workingDirectory.resolveUri(new Uri.file(packageRoot)); |
| 127 } | 128 } |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 } | 980 } |
| 980 resolvedUri = null; | 981 resolvedUri = null; |
| 981 } | 982 } |
| 982 sp.send(resolvedUri); | 983 sp.send(resolvedUri); |
| 983 }); | 984 }); |
| 984 break; | 985 break; |
| 985 default: | 986 default: |
| 986 _log('Unknown loader request tag=$tag from $isolateId'); | 987 _log('Unknown loader request tag=$tag from $isolateId'); |
| 987 } | 988 } |
| 988 } | 989 } |
| OLD | NEW |