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

Unified Diff: pkg/analyzer/lib/src/task/driver.dart

Issue 1132893003: Add DartWorkManager to manage Dart-specific results computation scheduling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 4abd9b3fe8ab84c99cc850dfcea192b8a10d861f..17149227675dfbc60c8db9427e19f6d0ddbb5ea1 100644
--- a/pkg/analyzer/lib/src/task/driver.dart
+++ b/pkg/analyzer/lib/src/task/driver.dart
@@ -25,6 +25,12 @@ class AnalysisDriver {
*/
final TaskManager taskManager;
+// /**
+// * The list of [WorkManager] used to figure out which analysis results to
+// * compute.
+// */
+// final List<WorkManager> workManagers;
+
/**
* The context in which analysis is to be performed.
*/
@@ -469,3 +475,24 @@ class WorkOrder implements Iterator<WorkItem> {
return false;
}
}
+
+/**
+ * [AnalysisDriver] uses [WorkManager]s to select results to compute.
+ *
+ * They know specific of the targets and results they care about,
+ * so they can request analysis results in optimal order.
+ */
+abstract class WorkManager {
+ /**
+ * Return the next [TargetedResult] that this work manager wants to be
+ * computed, or `null` if this manager doesn't need any new results.
+ */
+ TargetedResult getNextResult();
+
+ /**
+ * Notifies the manager that the given [outputs] were produced for
+ * the given [target].
+ */
+ void resultsComputed(
+ AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs);
+}

Powered by Google App Engine
This is Rietveld 408576698