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

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

Issue 197923002: Mock up code completion. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Too many changes to summarize in one line. Created 6 years, 9 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: dart/site/try/src/compilation.dart
diff --git a/dart/site/try/src/compilation.dart b/dart/site/try/src/compilation.dart
index eb824579e4088d3fc76ee8e972b0191491d9fd72..e977e2a9b92ea382ceb9973260018a8aab85a543 100644
--- a/dart/site/try/src/compilation.dart
+++ b/dart/site/try/src/compilation.dart
@@ -29,25 +29,42 @@ import 'run.dart' show
makeOutputFrame;
import 'ui.dart' show
- alwaysRunInWorker,
- applyingSettings,
buildButton,
+ outputDiv,
+ outputFrame;
+
+import 'settings.dart' show
+ alwaysRunInWorker,
+ compilationPaused,
minified,
onlyAnalyze,
- outputDiv,
- outputFrame,
verboseCompiler;
+@lazy import 'caching_compiler.dart' as cacheCompiler;
+
@lazy import 'compiler_isolate.dart';
// const lazy = const DeferredLibrary('compiler_isolate');
const lazy = null;
+/**
+ * Scheme for recognizing files stored in memory.
+ *
+ * From http://tools.ietf.org/html/bcp35#section-2.8:
+ *
+ * Organizations that desire a private name space for URI scheme names
+ * are encouraged to use a prefix based on their domain name, expressed
+ * in reverse order. For example, a URI scheme name of com-example-info
+ * might be registered by the vendor that owns the example.com domain
+ * name.
+ */
+const String PRIVATE_SCHEME = 'org-trydart';
+
SendPort compilerPort;
Timer compilerTimer;
void scheduleCompilation() {
- if (applyingSettings) return;
+ if (compilationPaused) return;
if (compilerTimer != null) {
compilerTimer.cancel();
compilerTimer = null;
@@ -168,6 +185,7 @@ self.importScripts("$url");
var frame = makeOutputFrame(url);
outputFrame.replaceWith(frame);
outputFrame = frame;
+ console.append(buildButton('Try in iframe', retryInIframe));
}
void onError(String errorMessage) {
console.appendText(errorMessage);
@@ -254,7 +272,7 @@ self.importScripts("$url");
consolePrint(message);
return;
}
- if (uri != 'memory:/main.dart') return;
+ if (uri != '${PRIVATE_SCHEME}:/main.dart') return;
if (currentSource != source) return;
int begin = diagnostic['begin'];
int end = diagnostic['end'];
@@ -284,4 +302,5 @@ void compilerIsolate(SendPort port) {
port.send('$exception\n$stack');
}
});
+ // cacheCompiler.compilerFor(null);
kasperl 2014/03/24 10:32:51 ?
ahe 2014/03/24 15:20:23 This code will be cleaned up in a follow-up CL.
}

Powered by Google App Engine
This is Rietveld 408576698