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

Unified Diff: dart/site/try/src/interaction_manager.dart

Issue 350443006: Add secret option "live" which compiles more frequently. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add comment Created 6 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
« no previous file with comments | « no previous file | dart/site/try/src/settings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/interaction_manager.dart
diff --git a/dart/site/try/src/interaction_manager.dart b/dart/site/try/src/interaction_manager.dart
index 066c6f13800cf88a3008fe8c19aaf584a520ce54..dba6d5547423d4dea912623aea08ed0853c566a6 100644
--- a/dart/site/try/src/interaction_manager.dart
+++ b/dart/site/try/src/interaction_manager.dart
@@ -94,6 +94,10 @@ const Duration SAVE_INTERVAL = const Duration(seconds: 5);
/// from the time of last modification.
const Duration COMPILE_INTERVAL = const Duration(seconds: 1);
+/// Determines how frequently the compiler is invoked in "live" mode. The time
+/// is measured from the time of last modification.
+const Duration LIVE_COMPILE_INTERVAL = const Duration(seconds: 0);
+
/// Determines if a compilation is slow. The time is measured from the last
/// compilation started. If a compilation is slow, progress information is
/// displayed to the user, but the console is untouched if the compilation
@@ -209,6 +213,10 @@ class InteractionContext extends InteractionManager {
final Set<AnchorElement> oldDiagnostics = new Set<AnchorElement>();
+ final Duration compileInterval = settings.live.value
+ ? LIVE_COMPILE_INTERVAL
+ : COMPILE_INTERVAL;
+
InteractionContext()
: super.internal() {
state = new InitialState(this);
@@ -569,7 +577,7 @@ class InitialState extends InteractionState {
saveUnits();
}
if (!settings.compilationPaused &&
- context.compileTimer.elapsed > COMPILE_INTERVAL) {
+ context.compileTimer.elapsed > context.compileInterval) {
if (startCompilation()) {
context.compileTimer
..stop()
« no previous file with comments | « no previous file | dart/site/try/src/settings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698