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

Side by Side Diff: pkg/analyzer/lib/src/context/cache.dart

Issue 1776023002: Add AnalysisContext.onResultInvalidated(descriptor). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update Analysis Server. Created 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer.src.context.cache; 5 library analyzer.src.context.cache;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/dart/element/element.dart' 10 import 'package:analyzer/src/dart/element/element.dart'
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 1088
1089 /** 1089 /**
1090 * Keep this result and stop visiting results that depend on this one. 1090 * Keep this result and stop visiting results that depend on this one.
1091 */ 1091 */
1092 STOP 1092 STOP
1093 } 1093 }
1094 1094
1095 /** 1095 /**
1096 * [InvalidatedResult] describes an invalidated result. 1096 * [InvalidatedResult] describes an invalidated result.
1097 */ 1097 */
1098 class InvalidatedResult { 1098 class InvalidatedResult<V> {
1099 /** 1099 /**
1100 * The target in which the result was invalidated. 1100 * The target in which the result was invalidated.
1101 */ 1101 */
1102 final CacheEntry entry; 1102 final CacheEntry entry;
1103 1103
1104 /** 1104 /**
1105 * The descriptor of the result which was invalidated. 1105 * The descriptor of the result which was invalidated.
1106 */ 1106 */
1107 final ResultDescriptor descriptor; 1107 final ResultDescriptor<V> descriptor;
1108 1108
1109 /** 1109 /**
1110 * The value of the result which was invalidated. 1110 * The value of the result before it was invalidated, may be the default
1111 * value if the result was flushed.
1111 */ 1112 */
1112 final Object value; 1113 final V value;
1113 1114
1114 InvalidatedResult(this.entry, this.descriptor, this.value); 1115 InvalidatedResult(this.entry, this.descriptor, this.value);
1115 1116
1116 @override 1117 @override
1117 String toString() => '$descriptor of ${entry.target}'; 1118 String toString() => '$descriptor of ${entry.target}';
1118 } 1119 }
1119 1120
1120 /** 1121 /**
1121 * A Stream-like interface, which broadcasts events synchronously. 1122 * A Stream-like interface, which broadcasts events synchronously.
1122 * If a second event is fired while delivering a first event, then the second 1123 * If a second event is fired while delivering a first event, then the second
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 void resultAccessed(TargetedResult result) {} 1269 void resultAccessed(TargetedResult result) {}
1269 1270
1270 @override 1271 @override
1271 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { 1272 List<TargetedResult> resultStored(TargetedResult newResult, newValue) {
1272 return TargetedResult.EMPTY_LIST; 1273 return TargetedResult.EMPTY_LIST;
1273 } 1274 }
1274 1275
1275 @override 1276 @override
1276 void targetRemoved(AnalysisTarget target) {} 1277 void targetRemoved(AnalysisTarget target) {}
1277 } 1278 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698