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

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

Issue 1131673004: Use WorkManager(s) in AnalysisDriver. (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/dart_work_manager.dart
diff --git a/pkg/analyzer/lib/src/task/dart_work_manager.dart b/pkg/analyzer/lib/src/task/dart_work_manager.dart
index 76019f04bb51d5c8018327b3310f33a502d86081..d37bb32d547a2c8281401e212e7c2f8b2368d9b4 100644
--- a/pkg/analyzer/lib/src/task/dart_work_manager.dart
+++ b/pkg/analyzer/lib/src/task/dart_work_manager.dart
@@ -67,6 +67,10 @@ class DartWorkManager implements WorkManager {
// library queue
librarySourceQueue.removeAll(changedSources);
librarySourceQueue.removeAll(removedSources);
+ // TODO(scheglov) This is an inefficient implementation.
+ // We could make the cache to return invalidated results and use them
+ // to allow work managers to schedule work request.
+ librarySourceQueue.addAll(librarySources);
}
@override
@@ -104,6 +108,14 @@ class DartWorkManager implements WorkManager {
}
@override
+ WorkOrderPriority getNextResultPriority() {
Brian Wilkerson 2015/05/11 13:59:20 Do you have a plan for how this will return a prio
scheglov 2015/05/11 14:03:37 Yes. For example completion requests or one-symbol
+ if (unknownSourceQueue.isNotEmpty || librarySourceQueue.isNotEmpty) {
+ return WorkOrderPriority.NORMAL;
+ }
+ return WorkOrderPriority.NONE;
+ }
+
+ @override
void resultsComputed(
AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) {
// Organize sources.

Powered by Google App Engine
This is Rietveld 408576698