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

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

Issue 987143002: Fix for dartbug.com/22656- analysis.flushedResults implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: comment 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
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:math' show max; 9 import 'dart:math' show max;
10 10
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 analysisServer.schedulePerformAnalysisOperation(context); 1232 analysisServer.schedulePerformAnalysisOperation(context);
1233 return context; 1233 return context;
1234 } 1234 }
1235 1235
1236 @override 1236 @override
1237 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) { 1237 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) {
1238 AnalysisContext context = analysisServer.folderMap[contextFolder]; 1238 AnalysisContext context = analysisServer.folderMap[contextFolder];
1239 if (context != null) { 1239 if (context != null) {
1240 context.applyChanges(changeSet); 1240 context.applyChanges(changeSet);
1241 analysisServer.schedulePerformAnalysisOperation(context); 1241 analysisServer.schedulePerformAnalysisOperation(context);
1242 List<String> flushedFiles = new List<String>();
1243 for (Source source in changeSet.removedSources) {
1244 flushedFiles.add(source.fullName);
1245 }
1246 sendAnalysisNotificationFlushResults(analysisServer, flushedFiles);
1242 } 1247 }
1243 } 1248 }
1244 1249
1245 @override 1250 @override
1246 void beginComputePackageMap() { 1251 void beginComputePackageMap() {
1247 _computingPackageMap(true); 1252 _computingPackageMap(true);
1248 } 1253 }
1249 1254
1250 @override 1255 @override
1251 void endComputePackageMap() { 1256 void endComputePackageMap() {
1252 _computingPackageMap(false); 1257 _computingPackageMap(false);
1253 } 1258 }
1254 1259
1255 @override 1260 @override
1256 void removeContext(Folder folder) { 1261 void removeContext(Folder folder) {
1257 AnalysisContext context = analysisServer.folderMap.remove(folder); 1262 AnalysisContext context = analysisServer.folderMap.remove(folder);
1263
1264 // See dartbug.com/22689, the AnalysisContext is computed in
1265 // computeFlushedFiles instead of using the referenced context above, this
1266 // is an attempt to be careful concerning the referenced issue.
1267 List<String> flushedFiles = computeFlushedFiles(folder);
1268 sendAnalysisNotificationFlushResults(analysisServer, flushedFiles);
1269
1258 if (analysisServer.index != null) { 1270 if (analysisServer.index != null) {
1259 analysisServer.index.removeContext(context); 1271 analysisServer.index.removeContext(context);
1260 } 1272 }
1261 analysisServer.operationQueue.contextRemoved(context); 1273 analysisServer.operationQueue.contextRemoved(context);
1262 _onContextsChangedController 1274 _onContextsChangedController
1263 .add(new ContextsChangedEvent(removed: [context])); 1275 .add(new ContextsChangedEvent(removed: [context]));
1264 analysisServer.sendContextAnalysisDoneNotifications( 1276 analysisServer.sendContextAnalysisDoneNotifications(
1265 context, AnalysisDoneReason.CONTEXT_REMOVED); 1277 context, AnalysisDoneReason.CONTEXT_REMOVED);
1266 context.dispose(); 1278 context.dispose();
1267 } 1279 }
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 /** 1405 /**
1394 * The [PerformanceTag] for time spent in server request handlers. 1406 * The [PerformanceTag] for time spent in server request handlers.
1395 */ 1407 */
1396 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); 1408 static PerformanceTag serverRequests = new PerformanceTag('serverRequests');
1397 1409
1398 /** 1410 /**
1399 * The [PerformanceTag] for time spent in split store microtasks. 1411 * The [PerformanceTag] for time spent in split store microtasks.
1400 */ 1412 */
1401 static PerformanceTag splitStore = new PerformanceTag('splitStore'); 1413 static PerformanceTag splitStore = new PerformanceTag('splitStore');
1402 } 1414 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/context_manager.dart » ('j') | pkg/analysis_server/lib/src/context_manager.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698