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

Unified Diff: pkg/analyzer/lib/src/context/context.dart

Issue 2297343002: Flush results when contexts are made idle. (Closed)
Patch Set: Un-fail completion tests. Created 4 years, 4 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/cache.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 6b15c8eab0f4affaad0be1617be5c2b8ff877e1b..d8efc31b06ce8bf733fbe2db767cc69028490b3c 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -78,6 +78,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
final int _id = _NEXT_ID++;
/**
+ * The flag that is `true` if the context is being analyzed.
+ */
+ bool _isActive = false;
+
+ /**
* A client-provided name used to identify this context, or `null` if the
* client has not provided a name.
*/
@@ -397,6 +402,17 @@ class AnalysisContextImpl implements InternalAnalysisContext {
_implicitAnalysisEventsController.stream;
@override
+ bool get isActive => _isActive;
+
+ @override
+ set isActive(bool active) {
+ if (active != _isActive) {
+ _isActive = active;
+ _privatePartition.isActive = active;
+ }
+ }
+
+ @override
bool get isDisposed => _disposed;
@override
« no previous file with comments | « pkg/analyzer/lib/src/context/cache.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698