зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1502802 - Implement PostMessageOptions for MessagePort, r=smaug
This commit is contained in:
Родитель
588efafd5e
Коммит
4817d8d6c8
|
@ -411,6 +411,14 @@ MessagePort::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
|||
mActor->SendPostMessages(messages);
|
||||
}
|
||||
|
||||
void
|
||||
MessagePort::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
||||
const PostMessageOptions& aOptions,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
PostMessage(aCx, aMessage, aOptions.mTransfer, aRv);
|
||||
}
|
||||
|
||||
void
|
||||
MessagePort::Start()
|
||||
{
|
||||
|
|
|
@ -24,6 +24,7 @@ namespace dom {
|
|||
class ClonedMessageData;
|
||||
class MessagePortChild;
|
||||
class MessagePortIdentifier;
|
||||
struct PostMessageOptions;
|
||||
class PostMessageRunnable;
|
||||
class SharedMessagePortMessage;
|
||||
class StrongWorkerRef;
|
||||
|
@ -58,6 +59,11 @@ public:
|
|||
const Sequence<JSObject*>& aTransferable,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void
|
||||
PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
||||
const PostMessageOptions& aOptions,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void Start();
|
||||
|
||||
void Close();
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
[Exposed=(Window,Worker,AudioWorklet)]
|
||||
interface MessagePort : EventTarget {
|
||||
[Throws]
|
||||
void postMessage(any message, optional sequence<object> transferable = []);
|
||||
void postMessage(any message, sequence<object> transferable);
|
||||
[Throws]
|
||||
void postMessage(any message, optional PostMessageOptions options);
|
||||
|
||||
void start();
|
||||
void close();
|
||||
|
@ -20,3 +22,7 @@ interface MessagePort : EventTarget {
|
|||
attribute EventHandler onmessageerror;
|
||||
};
|
||||
// MessagePort implements Transferable;
|
||||
|
||||
dictionary PostMessageOptions {
|
||||
sequence<object> transfer = [];
|
||||
};
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[dictionary-transferrable.html]
|
||||
[basic messagechannel with transfer]
|
||||
expected: FAIL
|
||||
|
Загрузка…
Ссылка в новой задаче