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

Unified Diff: pkg/front_end/lib/incremental_kernel_generator.dart

Issue 2869273006: Replace factory constructor with a static method for creating IncrementalKernelGenerator. (Closed)
Patch Set: Created 3 years, 7 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/front_end/lib/src/incremental_kernel_generator_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/incremental_kernel_generator.dart
diff --git a/pkg/front_end/lib/incremental_kernel_generator.dart b/pkg/front_end/lib/incremental_kernel_generator.dart
index f842f9fd9ab68b09fa2f61667ffa667c2849869f..3e8a96f6f6fb1e1c16af2a3037e4ff67ae3172f4 100644
--- a/pkg/front_end/lib/incremental_kernel_generator.dart
+++ b/pkg/front_end/lib/incremental_kernel_generator.dart
@@ -56,17 +56,6 @@ class DeltaProgram {
///
/// Not intended to be implemented or extended by clients.
abstract class IncrementalKernelGenerator {
- /// Creates an [IncrementalKernelGenerator] which is prepared to generate
- /// kernel representations of the program whose main library is in the given
- /// [source].
- ///
- /// No file system access is performed by this constructor; the initial
- /// "previous program state" is an empty program containing no code, and the
- /// initial set of valid sources is empty. To obtain a kernel representation
- /// of the program, call [computeDelta].
- factory IncrementalKernelGenerator(Uri source, CompilerOptions options) =>
- new IncrementalKernelGeneratorImpl(source, new ProcessedOptions(options));
-
/// Generates a kernel representation of the changes to the program, assuming
/// that all valid sources are unchanged since the last call to
/// [computeDelta].
@@ -108,4 +97,19 @@ abstract class IncrementalKernelGenerator {
/// unchanged, parts of the previous program state will still be re-used to
/// speed up compilation.
void invalidateAll();
+
+ /// Creates an [IncrementalKernelGenerator] which is prepared to generate
+ /// kernel representations of the program whose main library is in the given
+ /// [entryPoint].
+ ///
+ /// The initial "previous program state" is an empty program containing no
+ /// code, and the initial set of valid sources is empty. To obtain a kernel
+ /// representation of the program, call [computeDelta].
+ static Future<IncrementalKernelGenerator> newInstance(
+ CompilerOptions options, Uri entryPoint) async {
+ var processedOptions = new ProcessedOptions(options);
+ var uriTranslator = await processedOptions.getUriTranslator();
+ return new IncrementalKernelGeneratorImpl(
+ processedOptions, uriTranslator, entryPoint);
+ }
}
« no previous file with comments | « no previous file | pkg/front_end/lib/src/incremental_kernel_generator_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698