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

Side by Side Diff: pkg/analysis_server/lib/src/domain_execution.dart

Issue 1015463003: Use faster way to get AnalysisContext in execution domain notifications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 domain.execution; 5 library domain.execution;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 onFileAnalyzed = null; 147 onFileAnalyzed = null;
148 } 148 }
149 } 149 }
150 return new ExecutionSetSubscriptionsResult().toResponse(request.id); 150 return new ExecutionSetSubscriptionsResult().toResponse(request.id);
151 } 151 }
152 152
153 void _fileAnalyzed(ChangeNotice notice) { 153 void _fileAnalyzed(ChangeNotice notice) {
154 ServerPerformanceStatistics.executionNotifications.makeCurrentWhile(() { 154 ServerPerformanceStatistics.executionNotifications.makeCurrentWhile(() {
155 Source source = notice.source; 155 Source source = notice.source;
156 String filePath = source.fullName; 156 String filePath = source.fullName;
157 if (!_isInAnalysisRoot(filePath)) { 157 AnalysisContext context = server.getContainingContext(filePath);
158 return;
159 }
160 AnalysisContext context = server.getAnalysisContext(filePath);
161 if (context == null) { 158 if (context == null) {
162 return; 159 return;
163 } 160 }
164 if (AnalysisEngine.isDartFileName(filePath)) { 161 if (AnalysisEngine.isDartFileName(filePath)) {
165 ExecutableKind kind = ExecutableKind.NOT_EXECUTABLE; 162 ExecutableKind kind = ExecutableKind.NOT_EXECUTABLE;
166 if (context.isClientLibrary(source)) { 163 if (context.isClientLibrary(source)) {
167 kind = ExecutableKind.CLIENT; 164 kind = ExecutableKind.CLIENT;
168 if (context.isServerLibrary(source)) { 165 if (context.isServerLibrary(source)) {
169 kind = ExecutableKind.EITHER; 166 kind = ExecutableKind.EITHER;
170 } 167 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 if (_isInAnalysisRoot(filePath)) { 226 if (_isInAnalysisRoot(filePath)) {
230 server.sendNotification( 227 server.sendNotification(
231 new ExecutionLaunchDataParams(filePath, kind: kind).toNotification()); 228 new ExecutionLaunchDataParams(filePath, kind: kind).toNotification());
232 } 229 }
233 } 230 }
234 231
235 static List<String> _getFullNames(List<Source> sources) { 232 static List<String> _getFullNames(List<Source> sources) {
236 return sources.map((Source source) => source.fullName).toList(); 233 return sources.map((Source source) => source.fullName).toList();
237 } 234 }
238 } 235 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698