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

Side by Side Diff: pkg/analyzer/lib/file_system/physical_file_system.dart

Issue 1228493003: Revert "Package map source factory support" [TBR]. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
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 physical_file_system; 5 library 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 23 matching lines...) Expand all
34 PhysicalResourceProvider(String fileReadMode(String s)) { 34 PhysicalResourceProvider(String fileReadMode(String s)) {
35 if (fileReadMode != null) { 35 if (fileReadMode != null) {
36 FileBasedSource.fileReadMode = fileReadMode; 36 FileBasedSource.fileReadMode = fileReadMode;
37 } 37 }
38 } 38 }
39 39
40 @override 40 @override
41 Context get pathContext => io.Platform.isWindows ? windows : posix; 41 Context get pathContext => io.Platform.isWindows ? windows : posix;
42 42
43 @override 43 @override
44 File getFile(String path) => new _PhysicalFile(new io.File(path));
45
46 @override
47 Folder getFolder(String path) => new _PhysicalFolder(new io.Directory(path));
48
49 @override
50 Resource getResource(String path) { 44 Resource getResource(String path) {
51 if (io.FileSystemEntity.isDirectorySync(path)) { 45 if (io.FileSystemEntity.isDirectorySync(path)) {
52 return getFolder(path); 46 io.Directory directory = new io.Directory(path);
47 return new _PhysicalFolder(directory);
53 } else { 48 } else {
54 return getFile(path); 49 io.File file = new io.File(path);
50 return new _PhysicalFile(file);
55 } 51 }
56 } 52 }
57 53
58 @override 54 @override
59 Folder getStateLocation(String pluginId) { 55 Folder getStateLocation(String pluginId) {
60 String home; 56 String home;
61 if (io.Platform.isWindows) { 57 if (io.Platform.isWindows) {
62 home = io.Platform.environment['LOCALAPPDATA']; 58 home = io.Platform.environment['LOCALAPPDATA'];
63 } else { 59 } else {
64 home = io.Platform.environment['HOME']; 60 home = io.Platform.environment['HOME'];
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 bool operator ==(other) { 209 bool operator ==(other) {
214 if (runtimeType != other.runtimeType) { 210 if (runtimeType != other.runtimeType) {
215 return false; 211 return false;
216 } 212 }
217 return path == other.path; 213 return path == other.path;
218 } 214 }
219 215
220 @override 216 @override
221 String toString() => path; 217 String toString() => path;
222 } 218 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/file_system/memory_file_system.dart ('k') | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698