зеркало из 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;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -552,6 +552,11 @@ class MOZ_NON_MEMMOVABLE JS_PUBLIC_API JSStructuredCloneData {
|
||||||
}
|
}
|
||||||
|
|
||||||
void discardTransferables();
|
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,8 +3211,8 @@ bool JSAutoStructuredCloneBuffer::write(
|
||||||
const JS::CloneDataPolicy& cloneDataPolicy,
|
const JS::CloneDataPolicy& cloneDataPolicy,
|
||||||
const JSStructuredCloneCallbacks* optionalCallbacks, void* closure) {
|
const JSStructuredCloneCallbacks* optionalCallbacks, void* closure) {
|
||||||
clear();
|
clear();
|
||||||
bool ok =
|
bool ok = JS_WriteStructuredClone(
|
||||||
JS_WriteStructuredClone(cx, value, &data_, data_.scope(), cloneDataPolicy,
|
cx, value, &data_, data_.scopeForInternalWriting(), cloneDataPolicy,
|
||||||
optionalCallbacks, closure, transferable);
|
optionalCallbacks, closure, transferable);
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче