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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:front_end/src/base/processed_options.dart'; 7 import 'package:front_end/src/base/processed_options.dart';
8 import 'package:front_end/src/incremental_kernel_generator_impl.dart'; 8 import 'package:front_end/src/incremental_kernel_generator_impl.dart';
9 import 'package:kernel/kernel.dart'; 9 import 'package:kernel/kernel.dart';
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 /// [computeDelta]. 49 /// [computeDelta].
50 /// 50 ///
51 /// Behavior is undefined if the client does not obey the following concurrency 51 /// Behavior is undefined if the client does not obey the following concurrency
52 /// restrictions: 52 /// restrictions:
53 /// - no two invocations of [computeDelta] may be outstanding at any given time. 53 /// - no two invocations of [computeDelta] may be outstanding at any given time.
54 /// - neither [invalidate] nor [invalidateAll] may be called while an invocation 54 /// - neither [invalidate] nor [invalidateAll] may be called while an invocation
55 /// of [computeDelta] is outstanding. 55 /// of [computeDelta] is outstanding.
56 /// 56 ///
57 /// Not intended to be implemented or extended by clients. 57 /// Not intended to be implemented or extended by clients.
58 abstract class IncrementalKernelGenerator { 58 abstract class IncrementalKernelGenerator {
59 /// Creates an [IncrementalKernelGenerator] which is prepared to generate
60 /// kernel representations of the program whose main library is in the given
61 /// [source].
62 ///
63 /// No file system access is performed by this constructor; the initial
64 /// "previous program state" is an empty program containing no code, and the
65 /// initial set of valid sources is empty. To obtain a kernel representation
66 /// of the program, call [computeDelta].
67 factory IncrementalKernelGenerator(Uri source, CompilerOptions options) =>
68 new IncrementalKernelGeneratorImpl(source, new ProcessedOptions(options));
69
70 /// Generates a kernel representation of the changes to the program, assuming 59 /// Generates a kernel representation of the changes to the program, assuming
71 /// that all valid sources are unchanged since the last call to 60 /// that all valid sources are unchanged since the last call to
72 /// [computeDelta]. 61 /// [computeDelta].
73 /// 62 ///
74 /// Source files in the set of valid sources are guaranteed not to be re-read 63 /// Source files in the set of valid sources are guaranteed not to be re-read
75 /// from disk; they are assumed to be unchanged regardless of the state of the 64 /// from disk; they are assumed to be unchanged regardless of the state of the
76 /// filesystem. 65 /// filesystem.
77 /// 66 ///
78 /// If [watch] is not `null`, then when a source file is first used 67 /// If [watch] is not `null`, then when a source file is first used
79 /// by [computeDelta], [watch] is called with the Uri of that source 68 /// by [computeDelta], [watch] is called with the Uri of that source
(...skipping 21 matching lines...) Expand all
101 void invalidate(Uri uri); 90 void invalidate(Uri uri);
102 91
103 /// Remove all source files from the set of valid sources. This guarantees 92 /// Remove all source files from the set of valid sources. This guarantees
104 /// that all files will be re-read on the next call to [computeDelta]. 93 /// that all files will be re-read on the next call to [computeDelta].
105 /// 94 ///
106 /// Note that this does not erase the previous program state; the next time 95 /// Note that this does not erase the previous program state; the next time
107 /// [computeDelta] is called, if parts of the program are discovered to be 96 /// [computeDelta] is called, if parts of the program are discovered to be
108 /// unchanged, parts of the previous program state will still be re-used to 97 /// unchanged, parts of the previous program state will still be re-used to
109 /// speed up compilation. 98 /// speed up compilation.
110 void invalidateAll(); 99 void invalidateAll();
100
101 /// Creates an [IncrementalKernelGenerator] which is prepared to generate
102 /// kernel representations of the program whose main library is in the given
103 /// [entryPoint].
104 ///
105 /// The initial "previous program state" is an empty program containing no
106 /// code, and the initial set of valid sources is empty. To obtain a kernel
107 /// representation of the program, call [computeDelta].
108 static Future<IncrementalKernelGenerator> newInstance(
109 CompilerOptions options, Uri entryPoint) async {
110 var processedOptions = new ProcessedOptions(options);
111 var uriTranslator = await processedOptions.getUriTranslator();
112 return new IncrementalKernelGeneratorImpl(
113 processedOptions, uriTranslator, entryPoint);
114 }
111 } 115 }
OLDNEW
« 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