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

Unified Diff: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart

Issue 2929363002: Implement GC for FileState(s). (Closed)
Patch Set: Created 3 years, 6 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/front_end/lib/src/incremental_kernel_generator_impl.dart
diff --git a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
index 0211a42b668465923597b2282d8e0c58c15717e3..416f22ae151cf02021d1c738651fb6ae5fe2d564 100644
--- a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
+++ b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
@@ -79,8 +79,16 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
: _logger = _options.logger,
_byteStore = _options.byteStore {
_computeSalt();
+
+ Future<Null> onFileAdded(Uri uri) {
+ if (watch != null) {
+ return watch(uri, true);
+ }
+ return new Future.value();
+ }
+
_fsState = new FileSystemState(
- _options.fileSystem, _uriTranslator, _salt, (uri) => watch(uri, true));
+ _options.fileSystem, _uriTranslator, _salt, onFileAdded);
}
@override
@@ -304,6 +312,9 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
await file.refresh();
}
}
+
+ // The file graph might have changed, perform GC.
+ _fsState.gc(_entryPoint);
});
}
« no previous file with comments | « pkg/front_end/lib/src/incremental/file_state.dart ('k') | pkg/front_end/test/src/incremental/file_state_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698