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

Unified Diff: pkg/analysis_server/lib/src/operation/operation_queue.dart

Issue 988593002: Don't send notifications for disposed contexts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/analysis_server/lib/src/operation/operation_queue.dart
diff --git a/pkg/analysis_server/lib/src/operation/operation_queue.dart b/pkg/analysis_server/lib/src/operation/operation_queue.dart
index 7ea825759599e6e047531dc6ef25c9c6a66f3a3c..8163174859ae0e10072529854369dbd1ebda4278 100644
--- a/pkg/analysis_server/lib/src/operation/operation_queue.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_queue.dart
@@ -8,6 +8,7 @@ import 'dart:collection';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/operation/operation.dart';
+import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
/**
@@ -51,6 +52,17 @@ class ServerOperationQueue {
}
/**
+ * The given [context] has been removed, so all pending operations that refer
+ * to it should be removed from the queue.
+ */
+ void contextRemoved(AnalysisContext context) {
+ for (Queue<ServerOperation> queue in _queues) {
+ queue.removeWhere(
+ (ServerOperation operation) => operation.context == context);
scheglov 2015/03/06 00:37:23 IMHO if there is a line break, the function is too
Paul Berry 2015/03/06 01:11:09 Hmm, I'm not sure if I agree with the general prin
+ }
+ }
+
+ /**
* Return the next operation to perform, or `null` if the queue is empty.
* This method does not change the queue.
*/

Powered by Google App Engine
This is Rietveld 408576698