mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
Refactor structured clone JSAPI to prevent mismatched scopes.
Roll-up of bugs 1442722, 1455071, 1433642, 1456604 and 1458320.
This commit is contained in:
parent
1b173ad9e4
commit
0795e50d87
15 changed files with 447 additions and 311 deletions
|
|
@ -271,10 +271,10 @@ BuildClonedMessageData(typename BlobTraits<Flavor>::ConcreteContentManagerType*
|
|||
ClonedMessageData& aClonedData)
|
||||
{
|
||||
SerializedStructuredCloneBuffer& buffer = aClonedData.data();
|
||||
auto iter = aData.Data().Iter();
|
||||
auto iter = aData.Data().Start();
|
||||
size_t size = aData.Data().Size();
|
||||
bool success;
|
||||
buffer.data = aData.Data().Borrow<js::SystemAllocPolicy>(iter, size, &success);
|
||||
buffer.data = aData.Data().Borrow(iter, size, &success);
|
||||
if (NS_WARN_IF(!success)) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1286,6 +1286,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
|||
if (aRetVal) {
|
||||
ErrorResult rv;
|
||||
StructuredCloneData* data = aRetVal->AppendElement();
|
||||
data->InitScope(JS::StructuredCloneScope::DifferentProcess);
|
||||
data->Write(cx, rval, rv);
|
||||
if (NS_WARN_IF(rv.Failed())) {
|
||||
aRetVal->RemoveElementAt(aRetVal->Length() - 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue