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

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

Issue 1403033002: State-carrying context API. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix Created 5 years, 2 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/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index b2c2471d7a7372ca5d30f15bbe52bef073a56693..0f8e663dd89c65441144c1cf8ac65771f7594083 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -115,6 +115,12 @@ class AnalysisContextImpl implements InternalAnalysisContext {
AnalysisCache _cache;
/**
+ * Configuration data associated with this context.
+ */
+ final HashMap<ResultDescriptor, Object> _configurationData =
+ <ResultDescriptor, Object>{};
scheglov 2015/10/14 18:20:04 new HashMap<>()
pquitslund 2015/10/14 22:31:45 Done.
+
+ /**
* The task manager used to manage the tasks used to analyze code.
*/
TaskManager _taskManager;
@@ -764,6 +770,9 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
+ Object getConfigurationData(ResultDescriptor key) => _configurationData[key];
+
+ @override
TimestampedData<String> getContents(Source source) {
String contents = _contentCache.getContents(source);
if (contents != null) {
@@ -1201,6 +1210,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
+ void setConfigurationData(ResultDescriptor key, Object data) {
+ _configurationData[key] = data;
+ }
+
+ @override
void setContents(Source source, String contents) {
_contentsChanged(source, contents, true);
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | pkg/analyzer/lib/src/generated/engine.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698