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

Unified Diff: Source/core/frame/Window.idl

Issue 393353003: Improve the declared IDL type for postMessage()'s transferables (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use sequence<Transferable> rather than Transferable[] Created 6 years, 5 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 | « Source/core/dom/MessagePort.idl ('k') | Source/core/workers/DedicatedWorkerGlobalScope.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/Window.idl
diff --git a/Source/core/frame/Window.idl b/Source/core/frame/Window.idl
index f916ce9e3d8b9f69831141d11f4c96863270b36c..e82990ce7f1f09249c731af952cdd748d0c2ed8b 100644
--- a/Source/core/frame/Window.idl
+++ b/Source/core/frame/Window.idl
@@ -166,7 +166,7 @@
[Replaceable] readonly attribute Console console;
// cross-document messaging
- [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScriptValue message, DOMString targetOrigin, optional MessagePort[] messagePorts);
+ [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScriptValue message, DOMString targetOrigin, optional sequence<Transferable> transfer);
[Replaceable] readonly attribute Performance performance;
@@ -211,6 +211,21 @@
[Custom, NotEnumerable] getter Window (DOMString name);
};
+// http://www.whatwg.org/specs/web-apps/current-work/#transferable-objects
+//
+// Expressing the Transferable typedef in IDL depends on http://crbug.com/240176.
+// The postMessage() methods taking a Transferable array argument have custom
+// binding code that is able to handle the Transferables that we currently
+// recognize. To be able to declare a postMessage() signature that matches
+// the implementation, we provide a Transferable typedef but with an
+// incomplete type.
+//
+// FIXME: make this typedef accurate once enough of http://crbug.com/240176
+// is in place.
+// FIXME: consider putting this typedef in an .idl file containing spec-wide
+// utility type definitions.
+typedef MessagePort Transferable;
+
Window implements GlobalEventHandlers;
Window implements WindowBase64;
Window implements WindowEventHandlers;
« no previous file with comments | « Source/core/dom/MessagePort.idl ('k') | Source/core/workers/DedicatedWorkerGlobalScope.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698