Backed out changeset 5a4eb6758bed (bug 1609916) for hazard bustages on a CLOSED TREE

This commit is contained in:
Andreea Pavel 2020-02-07 20:20:10 +02:00
Родитель 299cb321f2
Коммит 217f810381
4 изменённых файлов: 13 добавлений и 52 удалений

Просмотреть файл

@ -143,7 +143,7 @@ const JSStructuredCloneCallbacks StructuredCloneHolder::sCallbacks = {
StructuredCloneCallbacksRead, StructuredCloneCallbacksWrite,
StructuredCloneCallbacksError, StructuredCloneCallbacksReadTransfer,
StructuredCloneCallbacksWriteTransfer, StructuredCloneCallbacksFreeTransfer,
StructuredCloneCallbacksCanTransfer, nullptr,
StructuredCloneCallbacksCanTransfer,
};
// StructuredCloneHolderBase class

Просмотреть файл

@ -419,10 +419,13 @@ bool CopyingStructuredCloneWriteCallback(JSContext* aCx,
nsresult GetAddInfoCallback(JSContext* aCx, void* aClosure) {
static const JSStructuredCloneCallbacks kStructuredCloneCallbacks = {
nullptr /* read */, StructuredCloneWriteCallback /* write */,
nullptr /* reportError */, nullptr /* readTransfer */,
nullptr /* writeTransfer */, nullptr /* freeTransfer */,
nullptr /* canTransfer */, nullptr /* sabCloned */
nullptr /* read */,
StructuredCloneWriteCallback /* write */,
nullptr /* reportError */,
nullptr /* readTransfer */,
nullptr /* writeTransfer */,
nullptr /* freeTransfer */,
nullptr /* canTransfer */
};
MOZ_ASSERT(aCx);
@ -1059,7 +1062,6 @@ bool IDBObjectStore::DeserializeValue(JSContext* aCx,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr};
// FIXME: Consider to use StructuredCloneHolder here and in other
@ -1217,7 +1219,6 @@ class DeserializeIndexValueHelper final : public Runnable {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr};
if (!JS_ReadStructuredClone(
@ -1324,7 +1325,6 @@ class DeserializeUpgradeValueHelper final : public Runnable {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr};
if (!JS_ReadStructuredClone(
@ -2571,8 +2571,7 @@ bool IDBObjectStore::ValueWrapper::Clone(JSContext* aCx) {
nullptr /* readTransfer */,
nullptr /* writeTransfer */,
nullptr /* freeTransfer */,
nullptr /* canTransfer */,
nullptr /* sabCloned */
nullptr /* canTransfer */
};
StructuredCloneInfo cloneInfo;

Просмотреть файл

@ -329,19 +329,6 @@ typedef bool (*CanTransferStructuredCloneOp)(JSContext* cx,
bool* sameProcessScopeRequired,
void* closure);
/**
* Called when a SharedArrayBuffer (including one owned by a Wasm memory object)
* has been processed in context `cx` by structured cloning. If `receiving` is
* true then the SAB has been received from a channel and a new SAB object has
* been created; if false then an existing SAB has been serialized onto a
* channel.
*
* If the callback returns false then the clone operation (read or write) will
* signal a failure.
*/
typedef bool (*SharedArrayBufferClonedOp)(JSContext* cx, bool receiving,
void* closure);
struct JSStructuredCloneCallbacks {
ReadStructuredCloneOp read;
WriteStructuredCloneOp write;
@ -350,7 +337,6 @@ struct JSStructuredCloneCallbacks {
TransferStructuredCloneOp writeTransfer;
FreeTransferStructuredCloneOp freeTransfer;
CanTransferStructuredCloneOp canTransfer;
SharedArrayBufferClonedOp sabCloned;
};
enum OwnTransferablePolicy {

Просмотреть файл

@ -470,8 +470,6 @@ struct JSStructuredCloneWriter {
const JSStructuredCloneCallbacks* cb,
void* cbClosure, const Value& tVal)
: out(cx, scope),
callbacks(cb),
closure(cbClosure),
objs(out.context()),
counts(out.context()),
objectEntries(out.context()),
@ -529,13 +527,6 @@ struct JSStructuredCloneWriter {
SCOutput out;
// The user defined callbacks that will be used to signal cloning, in some
// cases.
const JSStructuredCloneCallbacks* callbacks;
// Any value passed to the callbacks.
void* closure;
// Vector of objects with properties remaining to be written.
//
// NB: These can span multiple compartments, so the compartment must be
@ -1304,19 +1295,10 @@ bool JSStructuredCloneWriter::writeSharedArrayBuffer(HandleObject obj) {
intptr_t p = reinterpret_cast<intptr_t>(rawbuf);
uint32_t byteLength = sharedArrayBuffer->byteLength();
if (!(out.writePair(SCTAG_SHARED_ARRAY_BUFFER_OBJECT,
static_cast<uint32_t>(sizeof(p))) &&
out.writeBytes(&byteLength, sizeof(byteLength)) &&
out.writeBytes(&p, sizeof(p)))) {
return false;
}
if (callbacks && callbacks->sabCloned &&
!callbacks->sabCloned(context(), /*receiving=*/false, closure)) {
return false;
}
return true;
return out.writePair(SCTAG_SHARED_ARRAY_BUFFER_OBJECT,
static_cast<uint32_t>(sizeof(p))) &&
out.writeBytes(&byteLength, sizeof(byteLength)) &&
out.writeBytes(&p, sizeof(p));
}
bool JSStructuredCloneWriter::writeSharedWasmMemory(HandleObject obj) {
@ -2303,12 +2285,6 @@ bool JSStructuredCloneReader::readSharedArrayBuffer(MutableHandleValue vp) {
return false;
}
if (callbacks && callbacks->sabCloned &&
!callbacks->sabCloned(context(), /*receiving=*/true, closure)) {
rawbuf->dropReference();
return false;
}
vp.setObject(*obj);
return true;
}