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

Side by Side Diff: tools/dom/src/dart2js_DOMImplementation.dart

Issue 296153013: Fixing iframe.contentWindow.postMessage passing incorrect data (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/postmessage_structured_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of html; 5 part of html;
6 6
7 // TODO(vsm): Unify with Dartium version. 7 // TODO(vsm): Unify with Dartium version.
8 class _DOMWindowCrossFrame implements WindowBase { 8 class _DOMWindowCrossFrame implements WindowBase {
9 // Private window. Note, this is a window in another frame, so it 9 // Private window. Note, this is a window in another frame, so it
10 // cannot be typed as "Window" as its prototype is not patched 10 // cannot be typed as "Window" as its prototype is not patched
(...skipping 14 matching lines...) Expand all
25 25
26 WindowBase get parent => _createSafe(JS('WindowBase', '#.parent', _window)); 26 WindowBase get parent => _createSafe(JS('WindowBase', '#.parent', _window));
27 27
28 WindowBase get top => _createSafe(JS('WindowBase', '#.top', _window)); 28 WindowBase get top => _createSafe(JS('WindowBase', '#.top', _window));
29 29
30 // Methods. 30 // Methods.
31 void close() => JS('void', '#.close()', _window); 31 void close() => JS('void', '#.close()', _window);
32 32
33 void postMessage(var message, String targetOrigin, [List messagePorts = null]) { 33 void postMessage(var message, String targetOrigin, [List messagePorts = null]) {
34 if (messagePorts == null) { 34 if (messagePorts == null) {
35 JS('void', '#.postMessage(#,#)', _window, message, targetOrigin); 35 JS('void', '#.postMessage(#,#)', _window,
36 convertDartToNative_SerializedScriptValue(message), targetOrigin);
36 } else { 37 } else {
37 JS('void', '#.postMessage(#,#,#)', _window, message, targetOrigin, message Ports); 38 JS('void', '#.postMessage(#,#,#)', _window,
39 convertDartToNative_SerializedScriptValue(message), targetOrigin,
40 messagePorts);
38 } 41 }
39 } 42 }
40 43
41 // Implementation support. 44 // Implementation support.
42 _DOMWindowCrossFrame(this._window); 45 _DOMWindowCrossFrame(this._window);
43 46
44 static WindowBase _createSafe(w) { 47 static WindowBase _createSafe(w) {
45 if (identical(w, window)) { 48 if (identical(w, window)) {
46 return w; 49 return w;
47 } else { 50 } else {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 110
108 static HistoryBase _createSafe(h) { 111 static HistoryBase _createSafe(h) {
109 if (identical(h, window.history)) { 112 if (identical(h, window.history)) {
110 return h; 113 return h;
111 } else { 114 } else {
112 // TODO(vsm): Cache or implement equality. 115 // TODO(vsm): Cache or implement equality.
113 return new _HistoryCrossFrame(h); 116 return new _HistoryCrossFrame(h);
114 } 117 }
115 } 118 }
116 } 119 }
OLDNEW
« no previous file with comments | « tests/html/postmessage_structured_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698