mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Issue #2197 - Part 2a: Implement StructuredSerializeOptions for MessagePort
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1502802
This commit is contained in:
parent
47147d58b0
commit
fd982fd298
3 changed files with 22 additions and 1 deletions
|
|
@ -495,6 +495,14 @@ MessagePort::PostMessage(JSContext* aCx,
|
|||
mActor->SendPostMessages(messages);
|
||||
}
|
||||
|
||||
void
|
||||
MessagePort::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
||||
const StructuredSerializeOptions& aOptions,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
PostMessage(aCx, aMessage, aOptions.mTransfer, aRv);
|
||||
}
|
||||
|
||||
void
|
||||
MessagePort::Start()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class MessagePortIdentifier;
|
|||
class MessagePortMessage;
|
||||
class PostMessageRunnable;
|
||||
class SharedMessagePortMessage;
|
||||
struct StructuredSerializeOptions;
|
||||
|
||||
namespace workers {
|
||||
class WorkerHolder;
|
||||
|
|
@ -65,6 +66,11 @@ public:
|
|||
const Sequence<JSObject*>& aTransferable,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void
|
||||
PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
||||
const StructuredSerializeOptions& aOptions,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void Start();
|
||||
|
||||
void Close();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@
|
|||
[Exposed=(Window,Worker,System)]
|
||||
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 StructuredSerializeOptions options);
|
||||
|
||||
void start();
|
||||
void close();
|
||||
|
|
@ -19,3 +21,8 @@ interface MessagePort : EventTarget {
|
|||
attribute EventHandler onmessage;
|
||||
};
|
||||
// MessagePort implements Transferable;
|
||||
|
||||
// Used to declare which objects should be transferred.
|
||||
dictionary StructuredSerializeOptions {
|
||||
sequence<object> transfer = [];
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue