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

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: 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
Index: Source/core/frame/Window.idl
diff --git a/Source/core/frame/Window.idl b/Source/core/frame/Window.idl
index f916ce9e3d8b9f69831141d11f4c96863270b36c..164d452676fd0aaaa33446d1acf3f24540281464 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 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;

Powered by Google App Engine
This is Rietveld 408576698