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

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

Issue 807993002: Ensure that AnalysisContext futures are completed when context disposed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Handle case of computeAsync called after dispose Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis_server_test.dart » ('j') | 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 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 9
10 import 'package:analysis_server/src/analysis_logger.dart'; 10 import 'package:analysis_server/src/analysis_logger.dart';
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 void removeContext(Folder folder) { 1035 void removeContext(Folder folder) {
1036 AnalysisContext context = analysisServer.folderMap.remove(folder); 1036 AnalysisContext context = analysisServer.folderMap.remove(folder);
1037 if (analysisServer.index != null) { 1037 if (analysisServer.index != null) {
1038 analysisServer.index.removeContext(context); 1038 analysisServer.index.removeContext(context);
1039 } 1039 }
1040 _onContextsChangedController.add( 1040 _onContextsChangedController.add(
1041 new ContextsChangedEvent(removed: [context])); 1041 new ContextsChangedEvent(removed: [context]));
1042 analysisServer.sendContextAnalysisDoneNotifications( 1042 analysisServer.sendContextAnalysisDoneNotifications(
1043 context, 1043 context,
1044 AnalysisDoneReason.CONTEXT_REMOVED); 1044 AnalysisDoneReason.CONTEXT_REMOVED);
1045 context.dispose();
1045 } 1046 }
1046 1047
1047 @override 1048 @override
1048 void updateContextPackageUriResolver(Folder contextFolder, 1049 void updateContextPackageUriResolver(Folder contextFolder,
1049 UriResolver packageUriResolver) { 1050 UriResolver packageUriResolver) {
1050 AnalysisContext context = analysisServer.folderMap[contextFolder]; 1051 AnalysisContext context = analysisServer.folderMap[contextFolder];
1051 context.sourceFactory = _createSourceFactory(packageUriResolver); 1052 context.sourceFactory = _createSourceFactory(packageUriResolver);
1052 _onContextsChangedController.add( 1053 _onContextsChangedController.add(
1053 new ContextsChangedEvent(changed: [context])); 1054 new ContextsChangedEvent(changed: [context]));
1054 analysisServer.schedulePerformAnalysisOperation(context); 1055 analysisServer.schedulePerformAnalysisOperation(context);
(...skipping 12 matching lines...) Expand all
1067 * [packageUriResolver]. 1068 * [packageUriResolver].
1068 */ 1069 */
1069 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { 1070 SourceFactory _createSourceFactory(UriResolver packageUriResolver) {
1070 List<UriResolver> resolvers = <UriResolver>[ 1071 List<UriResolver> resolvers = <UriResolver>[
1071 new DartUriResolver(analysisServer.defaultSdk), 1072 new DartUriResolver(analysisServer.defaultSdk),
1072 new ResourceUriResolver(resourceProvider), 1073 new ResourceUriResolver(resourceProvider),
1073 packageUriResolver]; 1074 packageUriResolver];
1074 return new SourceFactory(resolvers); 1075 return new SourceFactory(resolvers);
1075 } 1076 }
1076 } 1077 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698