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

Unified Diff: lib/dom/frog/dom_frog.dart

Issue 10388234: Fix for postMessage on dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/dom/src/frog_DOMImplementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/frog/dom_frog.dart
diff --git a/lib/dom/frog/dom_frog.dart b/lib/dom/frog/dom_frog.dart
index 6fdffe1b7930b026db544b6724efb0f33afa22a2..594e5350ff17847d123cb92e9e1fd7eb0bd967a8 100644
--- a/lib/dom/frog/dom_frog.dart
+++ b/lib/dom/frog/dom_frog.dart
@@ -24978,12 +24978,23 @@ class _DOMWindowCrossFrameImpl implements DOMType, DOMWindow {
String targetOrigin,
[List messagePorts = null]) {
if (messagePorts == null) {
- _window.postMessage(message, targetOrigin);
+ _postMessage2(_window, message, targetOrigin);
} else {
- _window.postMessage(message, targetOrigin, messagePorts);
+ _postMessage3(_window, message, targetOrigin, messagePorts);
}
}
+ // TODO(vsm): This is a hack to workaround dartbug.com/3175. We
+ // need a more robust convention to invoke JS methods on the
+ // underlying window.
+ static void _postMessage2(win, message, targetOrigin) native """
+ win.postMessage(message, targetOrigin);
+""";
+
+ static void _postMessage3(win, message, targetOrigin, messagePorts) native """
+ win.postMessage(message, targetOrigin, messagePorts);
+""";
+
// Implementation support.
_DOMWindowCrossFrameImpl(this._window);
« no previous file with comments | « no previous file | lib/dom/src/frog_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698