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

Unified Diff: client/dart.js

Issue 10960062: Fix SendPortSync dispatch for FF (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix indentation Created 8 years, 3 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 | lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dart.js
diff --git a/client/dart.js b/client/dart.js
index 094122a2537797fa7a69b2d4f5b7c7998c19d2d2..c76e3fa5fad0d02620f7b0050b640179aa8c314a 100644
--- a/client/dart.js
+++ b/client/dart.js
@@ -191,7 +191,7 @@ function ReceivePortSync() {
if (navigator.webkitStartDart) {
window.addEventListener('js-sync-message', function(event) {
- var data = JSON.parse(event.data);
+ var data = JSON.parse(getPortSyncEventData(event));
var deserialized = deserialize(data.message);
var result = ReceivePortSync.map[data.id].callback(deserialized);
// TODO(vsm): Handle and propagate exceptions.
@@ -220,11 +220,15 @@ function ReceivePortSync() {
function dispatchEvent(receiver, message) {
var string = JSON.stringify(message);
- var event = document.createEvent('TextEvent');
- event.initTextEvent(receiver, false, false, window, string);
+ var event = document.createEvent('CustomEvent');
+ event.initCustomEvent(receiver, false, false, string);
window.dispatchEvent(event);
}
+ function getPortSyncEventData(event) {
+ return event.detail;
+ }
+
DartSendPortSync.prototype.callSync = function(message) {
var serialized = serialize(message);
var target = 'dart-port-' + this.isolateId + '-' + this.portId;
@@ -233,7 +237,7 @@ function ReceivePortSync() {
var source = target + '-result';
var result = null;
var listener = function (e) {
- result = JSON.parse(e.data);
+ result = JSON.parse(getPortSyncEventData(e));
};
window.addEventListener(source, listener, false);
dispatchEvent(target, [source, serialized]);
« no previous file with comments | « no previous file | lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698