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

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: Undo sorting or context_test.dart file. 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
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
+ if (unknownSourceQueue.isNotEmpty || librarySourceQueue.isNotEmpty) {
+ return WorkOrderPriority.NORMAL;
+ }
+ return WorkOrderPriority.NONE;
+ }
+
+ @override
void resultsComputed(
AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) {
// Organize sources.
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698