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

Side by Side 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 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 analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:core' hide Resource; 9 import 'dart:core' hide Resource;
10 import 'dart:math' show max; 10 import 'dart:math' show max;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 * A table mapping [AnalysisService]s to the file paths for which these 178 * A table mapping [AnalysisService]s to the file paths for which these
179 * notifications should be sent. 179 * notifications should be sent.
180 */ 180 */
181 Map<AnalysisService, Set<String>> analysisServices = 181 Map<AnalysisService, Set<String>> analysisServices =
182 new HashMap<AnalysisService, Set<String>>(); 182 new HashMap<AnalysisService, Set<String>>();
183 183
184 /** 184 /**
185 * A table mapping [AnalysisContext]s to the completers that should be 185 * A table mapping [AnalysisContext]s to the completers that should be
186 * completed when analysis of this context is finished. 186 * completed when analysis of this context is finished.
187 */ 187 */
188 Map<AnalysisContext, 188 Map<AnalysisContext, Completer<AnalysisDoneReason>>
189 Completer<AnalysisDoneReason>> contextAnalysisDoneCompleters = 189 contextAnalysisDoneCompleters =
190 new HashMap<AnalysisContext, Completer<AnalysisDoneReason>>(); 190 new HashMap<AnalysisContext, Completer<AnalysisDoneReason>>();
191 191
192 /** 192 /**
193 * Performance information before initial analysis is complete. 193 * Performance information before initial analysis is complete.
194 */ 194 */
195 ServerPerformance performanceDuringStartup = new ServerPerformance(); 195 ServerPerformance performanceDuringStartup = new ServerPerformance();
196 196
197 /** 197 /**
198 * Performance information after initial analysis is complete 198 * Performance information after initial analysis is complete
199 * or `null` if the initial analysis is not yet complete 199 * or `null` if the initial analysis is not yet complete
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 } 725 }
726 726
727 /** 727 /**
728 * Return `true` if analysis is complete. 728 * Return `true` if analysis is complete.
729 */ 729 */
730 bool isAnalysisComplete() { 730 bool isAnalysisComplete() {
731 return operationQueue.isEmpty; 731 return operationQueue.isEmpty;
732 } 732 }
733 733
734 /** 734 /**
735 * Return `true` if the given path is a valid `FilePath`.
736 *
737 * This means that it is absolute and normalized.
738 */
739 bool isValidFilePath(String path) {
740 return resourceProvider.absolutePathContext.isValid(path);
741 }
742
743 /**
735 * Returns a [Future] completing when [file] has been completely analyzed, in 744 * Returns a [Future] completing when [file] has been completely analyzed, in
736 * particular, all its errors have been computed. The future is completed 745 * particular, all its errors have been computed. The future is completed
737 * with an [AnalysisDoneReason] indicating what caused the file's analysis to 746 * with an [AnalysisDoneReason] indicating what caused the file's analysis to
738 * be considered complete. 747 * be considered complete.
739 * 748 *
740 * If the given file doesn't belong to any context, null is returned. 749 * If the given file doesn't belong to any context, null is returned.
741 * 750 *
742 * TODO(scheglov) this method should be improved. 751 * TODO(scheglov) this method should be improved.
743 * 752 *
744 * 1. The analysis context should be told to analyze this particular file ASAP . 753 * 1. The analysis context should be told to analyze this particular file ASAP .
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 /** 1676 /**
1668 * The [PerformanceTag] for time spent in server request handlers. 1677 * The [PerformanceTag] for time spent in server request handlers.
1669 */ 1678 */
1670 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); 1679 static PerformanceTag serverRequests = new PerformanceTag('serverRequests');
1671 1680
1672 /** 1681 /**
1673 * The [PerformanceTag] for time spent in split store microtasks. 1682 * The [PerformanceTag] for time spent in split store microtasks.
1674 */ 1683 */
1675 static PerformanceTag splitStore = new PerformanceTag('splitStore'); 1684 static PerformanceTag splitStore = new PerformanceTag('splitStore');
1676 } 1685 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698