mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
506dfe6ea3
In JS StructuredClone BufferList<SystemAllocPolicy> is typedef'd to JSStructuredCloneData and use everywhere in gecko that stores structured clone data. This patch changed some raw pointers to UniquePtr<JSStructuredCloneData> and some to stack allocated JSStructuredCloneData for better life time management. Some parameters or methods are deleted because of changing to the new data structure. MessagePortMessage now has the exactly same structure with ClonedMessageData. Maybe in the future they can be consolidated. MozReview-Commit-ID: 1IY9p5eKLgv
59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
include protocol PBackground;
|
|
include protocol PBlob;
|
|
|
|
include DOMTypes;
|
|
|
|
using struct mozilla::SerializedStructuredCloneBuffer
|
|
from "ipc/IPCMessageUtils.h";
|
|
|
|
namespace mozilla {
|
|
namespace dom {
|
|
|
|
|
|
struct MessagePortMessage
|
|
{
|
|
SerializedStructuredCloneBuffer data;
|
|
PBlob[] blobs;
|
|
MessagePortIdentifier[] transferredPorts;
|
|
};
|
|
|
|
// This protocol is used for the MessageChannel/MessagePort API
|
|
protocol PMessagePort
|
|
{
|
|
manager PBackground;
|
|
|
|
/* Many of these methods are used just for the shutdown sequence. The
|
|
correct sequence for the child actor is:
|
|
1. SendStopSendingData();
|
|
2. RecvStopSendingDataConfirmed();
|
|
3. SendClose();
|
|
4. Recv__delete__(); */
|
|
|
|
/* When the port is transferred the sequence is:
|
|
1. SendStopSendingData();
|
|
2. RecvStopSendingDataConfirmed();
|
|
3. SendDisentangle();
|
|
4. Recv__delete__(); */
|
|
|
|
parent:
|
|
async PostMessages(MessagePortMessage[] messages);
|
|
async Disentangle(MessagePortMessage[] messages);
|
|
async StopSendingData();
|
|
async Close();
|
|
|
|
child:
|
|
async Entangled(MessagePortMessage[] messages);
|
|
async ReceiveData(MessagePortMessage[] messages);
|
|
async StopSendingDataConfirmed();
|
|
|
|
async __delete__();
|
|
};
|
|
|
|
} // namespace dom
|
|
} // namespace mozilla
|
|
|