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

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

Issue 1902123005: Use MODIFICATION_TIME in ScanDartTask and ParseHtmlTask. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | pkg/analyzer/lib/src/task/html.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.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 43f286bb1724680c62fe907ec42d41961ff216a7..fa360f1ac43c3518a04f74793d812bb5b0f22162 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -5093,6 +5093,11 @@ class ScanDartTask extends SourceBasedAnalysisTask {
static const String CONTENT_INPUT_NAME = 'CONTENT_INPUT_NAME';
/**
+ * The name of the input whose value is the modification time of the file.
+ */
+ static const String MODIFICATION_TIME_INPUT = 'MODIFICATION_TIME_INPUT';
+
+ /**
* The task descriptor describing this kind of task.
*/
static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
@@ -5115,9 +5120,10 @@ class ScanDartTask extends SourceBasedAnalysisTask {
@override
void internalPerform() {
Source source = getRequiredSource();
-
RecordingErrorListener errorListener = new RecordingErrorListener();
- if (context.getModificationStamp(target.source) < 0) {
+
+ int modificationTime = getRequiredInput(MODIFICATION_TIME_INPUT);
+ if (modificationTime < 0) {
String message = 'Content could not be read';
if (context is InternalAnalysisContext) {
CacheEntry entry =
@@ -5174,16 +5180,23 @@ class ScanDartTask extends SourceBasedAnalysisTask {
/**
* Return a map from the names of the inputs of this kind of task to the task
* input descriptors describing those inputs for a task with the given
- * [source].
+ * [target].
*/
static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
if (target is Source) {
- return <String, TaskInput>{CONTENT_INPUT_NAME: CONTENT.of(target)};
+ return <String, TaskInput>{
+ CONTENT_INPUT_NAME: CONTENT.of(target),
+ MODIFICATION_TIME_INPUT: MODIFICATION_TIME.of(target)
+ };
} else if (target is DartScript) {
// This task does not use the following input; it is included only to add
// a dependency between this value and the containing source so that when
// the containing source is modified these results will be invalidated.
- return <String, TaskInput>{'-': DART_SCRIPTS.of(target.source)};
+ Source source = target.source;
+ return <String, TaskInput>{
+ '-': DART_SCRIPTS.of(source),
+ MODIFICATION_TIME_INPUT: MODIFICATION_TIME.of(source)
+ };
}
throw new AnalysisException(
'Cannot build inputs for a ${target.runtimeType}');
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698