зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1611855 - Worklet must be part of the same parent's agentCluster - part 3 - update the scope after a writing, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D61183 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
87b1a8a547
Коммит
94658a20fe
|
@ -193,6 +193,10 @@ bool StructuredCloneHolderBase::Write(
|
|||
return false;
|
||||
}
|
||||
|
||||
// Let's update our scope to the final one. The new one could be more
|
||||
// restrictive of the current one.
|
||||
MOZ_ASSERT(mStructuredCloneScope >= mBuffer->scope());
|
||||
mStructuredCloneScope = mBuffer->scope();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -552,6 +552,11 @@ class MOZ_NON_MEMMOVABLE JS_PUBLIC_API JSStructuredCloneData {
|
|||
}
|
||||
|
||||
void discardTransferables();
|
||||
|
||||
private:
|
||||
// This internal method exposes the real value of scope_. It's meant to be
|
||||
// used only when starting the writing.
|
||||
JS::StructuredCloneScope scopeForInternalWriting() const { return scope_; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -3211,9 +3211,9 @@ bool JSAutoStructuredCloneBuffer::write(
|
|||
const JS::CloneDataPolicy& cloneDataPolicy,
|
||||
const JSStructuredCloneCallbacks* optionalCallbacks, void* closure) {
|
||||
clear();
|
||||
bool ok =
|
||||
JS_WriteStructuredClone(cx, value, &data_, data_.scope(), cloneDataPolicy,
|
||||
optionalCallbacks, closure, transferable);
|
||||
bool ok = JS_WriteStructuredClone(
|
||||
cx, value, &data_, data_.scopeForInternalWriting(), cloneDataPolicy,
|
||||
optionalCallbacks, closure, transferable);
|
||||
|
||||
if (ok) {
|
||||
data_.ownTransferables_ = OwnTransferablePolicy::OwnsTransferablesIfAny;
|
||||
|
|
Загрузка…
Ссылка в новой задаче