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

Unified Diff: dart/pkg/browser/lib/dart.js

Issue 847573003: Push updates to browser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update package:browser version. Created 5 years, 11 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/pkg/browser/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/browser/lib/dart.js
diff --git a/dart/pkg/browser/lib/dart.js b/dart/pkg/browser/lib/dart.js
index 4dd825d1d14268a8c3db7c966394eba2256fcb31..b1f97b1804b6cf57edc33768bcad8523ddb4a23f 100644
--- a/dart/pkg/browser/lib/dart.js
+++ b/dart/pkg/browser/lib/dart.js
@@ -26,6 +26,22 @@ if (!navigator.dartEnabled && (navigator.userAgent.indexOf('(Dart)') === -1)) {
// than one script.
document.currentScript = script;
parent.replaceChild(script, scripts[i]);
+
+ // Support for incremental compilation.
+ script.onload = function (event) {
+ var script = event.target;
+ if (self.$dart_unsafe_incremental_support) {
+ new WebSocket(script.src.replace(/^http/, 'ws')).onmessage =
+ function (event) {
+ var patch = String(event.data);
+ self.$dart_unsafe_incremental_support.patch(patch);
+ script.dispatchEvent(
+ new CustomEvent(
+ "dart_program_updated",
+ { bubbles: true, detail: { patch: patch } }));
+ };
+ }
+ };
}
}
}
« no previous file with comments | « no previous file | dart/pkg/browser/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698