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

Unified Diff: pkg/analyzer/lib/src/task/html.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 | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/test/src/task/html_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/html.dart
diff --git a/pkg/analyzer/lib/src/task/html.dart b/pkg/analyzer/lib/src/task/html.dart
index 257567764be06baa4dda3b18db1fcaf76b96226e..93e00edd8e905d4786983f91f8a575ff3e4004a1 100644
--- a/pkg/analyzer/lib/src/task/html.dart
+++ b/pkg/analyzer/lib/src/task/html.dart
@@ -269,6 +269,11 @@ class ParseHtmlTask 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(
@@ -292,7 +297,8 @@ class ParseHtmlTask extends SourceBasedAnalysisTask {
void internalPerform() {
String content = getRequiredInput(CONTENT_INPUT_NAME);
- 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 =
@@ -343,7 +349,10 @@ class ParseHtmlTask extends SourceBasedAnalysisTask {
* [source].
*/
static Map<String, TaskInput> buildInputs(AnalysisTarget source) {
- return <String, TaskInput>{CONTENT_INPUT_NAME: CONTENT.of(source)};
+ return <String, TaskInput>{
+ CONTENT_INPUT_NAME: CONTENT.of(source),
+ MODIFICATION_TIME_INPUT: MODIFICATION_TIME.of(source)
+ };
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/test/src/task/html_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698