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

Unified Diff: pkg/analyzer/lib/src/task/driver.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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/task/driver.dart
diff --git a/pkg/analyzer/lib/src/task/driver.dart b/pkg/analyzer/lib/src/task/driver.dart
index c172ce2e1188162edc4ec2ceb04e9edfcac8b189..b729a2b95e56f39811e1d00fee46b583a8eee2ff 100644
--- a/pkg/analyzer/lib/src/task/driver.dart
+++ b/pkg/analyzer/lib/src/task/driver.dart
@@ -44,11 +44,11 @@ class AnalysisDriver {
final InternalAnalysisContext context;
/**
- * The map of [ComputedResult] controllers.
+ * The map of [ResultChangedEvent] controllers.
*/
- final Map<ResultDescriptor, StreamController<ComputedResult>>
+ final Map<ResultDescriptor, StreamController<ResultChangedEvent>>
resultComputedControllers =
- <ResultDescriptor, StreamController<ComputedResult>>{};
+ <ResultDescriptor, StreamController<ResultChangedEvent>>{};
/**
* The work order that was previously computed but that has not yet been
@@ -208,11 +208,10 @@ class AnalysisDriver {
* Return the stream that is notified when a new value for the given
* [descriptor] is computed.
*/
- Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor) {
- return resultComputedControllers
- .putIfAbsent(descriptor,
- () => new StreamController<ComputedResult>.broadcast(sync: true))
- .stream;
+ Stream<ResultChangedEvent> onResultComputed(ResultDescriptor descriptor) {
+ return resultComputedControllers.putIfAbsent(descriptor, () {
+ return new StreamController<ResultChangedEvent>.broadcast(sync: true);
+ }).stream;
}
/**
@@ -284,11 +283,11 @@ class AnalysisDriver {
entry.setValue(result, outputs[result], dependedOn);
}
outputs.forEach((ResultDescriptor descriptor, value) {
- StreamController<ComputedResult> controller =
+ StreamController<ResultChangedEvent> controller =
resultComputedControllers[descriptor];
if (controller != null) {
- ComputedResult event =
- new ComputedResult(context, descriptor, target, value);
+ ResultChangedEvent event = new ResultChangedEvent(
+ context, target, descriptor, value, true);
controller.add(event);
}
});

Powered by Google App Engine
This is Rietveld 408576698