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

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

Issue 1511833004: Validate that root paths are absolute and normalized. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 15 matching lines...) Expand all
26 static final PhysicalResourceProvider INSTANCE = 26 static final PhysicalResourceProvider INSTANCE =
27 new PhysicalResourceProvider(null); 27 new PhysicalResourceProvider(null);
28 28
29 /** 29 /**
30 * The name of the directory containing plugin specific subfolders used to 30 * The name of the directory containing plugin specific subfolders used to
31 * store data across sessions. 31 * store data across sessions.
32 */ 32 */
33 static final String SERVER_DIR = ".dartServer"; 33 static final String SERVER_DIR = ".dartServer";
34 34
35 final AbsolutePathContext absolutePathContext = 35 final AbsolutePathContext absolutePathContext =
36 new AbsolutePathContext(io.Platform.pathSeparator); 36 new AbsolutePathContext(io.Platform.isWindows);
37 37
38 PhysicalResourceProvider(String fileReadMode(String s)) { 38 PhysicalResourceProvider(String fileReadMode(String s)) {
39 if (fileReadMode != null) { 39 if (fileReadMode != null) {
40 FileBasedSource.fileReadMode = fileReadMode; 40 FileBasedSource.fileReadMode = fileReadMode;
41 } 41 }
42 } 42 }
43 43
44 @override 44 @override
45 Context get pathContext => io.Platform.isWindows ? windows : posix; 45 Context get pathContext => io.Platform.isWindows ? windows : posix;
46 46
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 bool operator ==(other) { 220 bool operator ==(other) {
221 if (runtimeType != other.runtimeType) { 221 if (runtimeType != other.runtimeType) {
222 return false; 222 return false;
223 } 223 }
224 return path == other.path; 224 return path == other.path;
225 } 225 }
226 226
227 @override 227 @override
228 String toString() => path; 228 String toString() => path;
229 } 229 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698