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

Unified Diff: pkg/analysis_server/lib/src/analysis_server.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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 980bb9de7126387e6081e6a95045a54b05220d0c..f72f051e2077cad3b693bd2d28a4b37564ffc451 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -185,8 +185,8 @@ class AnalysisServer {
* A table mapping [AnalysisContext]s to the completers that should be
* completed when analysis of this context is finished.
*/
- Map<AnalysisContext,
- Completer<AnalysisDoneReason>> contextAnalysisDoneCompleters =
+ Map<AnalysisContext, Completer<AnalysisDoneReason>>
+ contextAnalysisDoneCompleters =
new HashMap<AnalysisContext, Completer<AnalysisDoneReason>>();
/**
@@ -732,6 +732,15 @@ class AnalysisServer {
}
/**
+ * Return `true` if the given path is a valid `FilePath`.
+ *
+ * This means that it is absolute and normalized.
+ */
+ bool isValidFilePath(String path) {
+ return resourceProvider.absolutePathContext.isValid(path);
+ }
+
+ /**
* Returns a [Future] completing when [file] has been completely analyzed, in
* particular, all its errors have been computed. The future is completed
* with an [AnalysisDoneReason] indicating what caused the file's analysis to

Powered by Google App Engine
This is Rietveld 408576698