Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analyzer.file_system.physical_file_system; | 5 library analyzer.file_system.physical_file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:core' hide Resource; | 8 import 'dart:core' hide Resource; |
| 9 import 'dart:io' as io; | 9 import 'dart:io' as io; |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 PhysicalResourceProvider(String fileReadMode(String s)) { | 65 PhysicalResourceProvider(String fileReadMode(String s)) { |
| 66 if (fileReadMode != null) { | 66 if (fileReadMode != null) { |
| 67 FileBasedSource.fileReadMode = fileReadMode; | 67 FileBasedSource.fileReadMode = fileReadMode; |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 | 70 |
| 71 @override | 71 @override |
| 72 Context get pathContext => io.Platform.isWindows ? windows : posix; | 72 Context get pathContext => io.Platform.isWindows ? windows : posix; |
| 73 | 73 |
| 74 @override | 74 @override |
| 75 File getFile(String path) => new _PhysicalFile(new io.File(path)); | 75 File getFile(String path) { |
| 76 path = normalize(path); | |
|
Brian Wilkerson
2016/08/12 17:43:33
Should this be "pathContext.normalize()"?
scheglov
2016/08/12 18:02:50
It could be, but it does not have to.
We has "pat
| |
| 77 return new _PhysicalFile(new io.File(path)); | |
| 78 } | |
| 76 | 79 |
| 77 @override | 80 @override |
| 78 Folder getFolder(String path) => new _PhysicalFolder(new io.Directory(path)); | 81 Folder getFolder(String path) { |
| 82 path = normalize(path); | |
| 83 return new _PhysicalFolder(new io.Directory(path)); | |
| 84 } | |
| 79 | 85 |
| 80 @override | 86 @override |
| 81 Future<List<int>> getModificationTimes(List<Source> sources) async { | 87 Future<List<int>> getModificationTimes(List<Source> sources) async { |
| 82 List<String> paths = sources | 88 List<String> paths = sources |
| 83 .map((source) => source is FileBasedSource ? source.fullName : null) | 89 .map((source) => source is FileBasedSource ? source.fullName : null) |
| 84 .toList(); | 90 .toList(); |
| 85 IsolateRunner runner = await pathsToTimesIsolateProvider.get(); | 91 IsolateRunner runner = await pathsToTimesIsolateProvider.get(); |
| 86 return runner.run(_pathsToTimes, paths); | 92 return runner.run(_pathsToTimes, paths); |
| 87 } | 93 } |
| 88 | 94 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 timer.cancel(); | 345 timer.cancel(); |
| 340 } | 346 } |
| 341 }); | 347 }); |
| 342 return completer.future; | 348 return completer.future; |
| 343 } | 349 } |
| 344 _isSpawning = true; | 350 _isSpawning = true; |
| 345 _runner = await IsolateRunner.spawn(); | 351 _runner = await IsolateRunner.spawn(); |
| 346 return _runner; | 352 return _runner; |
| 347 } | 353 } |
| 348 } | 354 } |
| OLD | NEW |