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

Unified Diff: pkg/analyzer/lib/src/generated/source.dart

Issue 823123004: Display overlays at /overlays URI. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/generated/source.dart
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index 6b876736622e01f114a62187a40d380129c07844..f5038312362b83ad90b495728684d0aa3460c375 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -16,6 +16,11 @@ import 'java_engine.dart';
import 'sdk.dart' show DartSdk;
/**
+ * A function that is used to handle [ContentCache] entries.
+ */
+typedef void ContentCacheVisitor(Source source, int stamp, String contents);
+
+/**
* Instances of class `ContentCache` hold content used to override the default content of a
* [Source].
*/
@@ -33,6 +38,16 @@ class ContentCache {
HashMap<Source, int> _stampMap = new HashMap<Source, int>();
/**
+ * Visit all entries of this cache.
+ */
+ void accept(ContentCacheVisitor visitor) {
+ _contentMap.forEach((Source source, String contents) {
+ int stamp = _stampMap[source];
+ visitor(source, stamp, contents);
+ });
+ }
+
+ /**
* Return the contents of the given source, or `null` if this cache does not override the
* contents of the source.
*
« pkg/analysis_server/lib/src/get_handler.dart ('K') | « pkg/analyzer/lib/src/generated/engine.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698