Backed out 2 changesets (bug 1514051) for hazard-linux64-haz bustages at Stream.cpp . CLOSED TREE

Backed out changeset 4b9bf0633280 (bug 1514051)
Backed out changeset bd071dbcecad (bug 1514051)
This commit is contained in:
Narcis Beleuzu 2019-01-15 01:19:36 +02:00
parent e781289927
commit 8b80c64ea5
2 changed files with 7 additions and 35 deletions

View File

@ -2635,12 +2635,9 @@ static JSObject* ReadableStreamDefaultControllerPullSteps(
}
// Step b: If this.[[closeRequested]] is true and this.[[queue]] is empty,
// perform ! ReadableStreamClose(stream).
if (unwrappedController->closeRequested() &&
unwrappedQueue->length() == 0) {
// Step i: Perform ! ReadableStreamDefaultControllerClearAlgorithms(this).
ReadableStreamControllerClearAlgorithms(unwrappedController);
// Step ii: Perform ! ReadableStreamClose(stream).
if (!ReadableStreamCloseInternal(cx, unwrappedStream)) {
return nullptr;
}
@ -2947,12 +2944,10 @@ static bool ReadableStreamControllerShouldCallPull(
static void ReadableStreamControllerClearAlgorithms(
ReadableStreamController* controller) {
// Step 1: Set controller.[[pullAlgorithm]] to undefined.
// Step 2: Set controller.[[cancelAlgorithm]] to undefined.
// (In this implementation, the UnderlyingSource slot is part of the
// representation of these algorithms.)
controller->setPullMethod(UndefinedHandleValue);
// Step 2: Set controller.[[cancelAlgorithm]] to undefined.
controller->setCancelMethod(UndefinedHandleValue);
controller->clearUnderlyingSource();
// Step 3 (of 3.9.4 only) : Set controller.[[strategySizeAlgorithm]] to
// undefined.
@ -2980,14 +2975,10 @@ static MOZ_MUST_USE bool ReadableStreamDefaultControllerClose(
// Step 3: Set controller.[[closeRequested]] to true.
unwrappedController->setCloseRequested();
// Step 4: If controller.[[queue]] is empty,
// Step 5: If controller.[[queue]] is empty, perform
// ! ReadableStreamClose(stream).
Rooted<ListObject*> unwrappedQueue(cx, unwrappedController->queue());
if (unwrappedQueue->length() == 0) {
// Step a: Perform
// ! ReadableStreamDefaultControllerClearAlgorithms(controller).
ReadableStreamControllerClearAlgorithms(unwrappedController);
// Step b: Perform ! ReadableStreamClose(stream).
return ReadableStreamCloseInternal(cx, unwrappedStream);
}
@ -3117,12 +3108,7 @@ static MOZ_MUST_USE bool ReadableStreamControllerError(
return false;
}
// Step 4 (or 5):
// Perform ! ReadableStreamDefaultControllerClearAlgorithms(controller)
// (or ReadableByteStreamControllerClearAlgorithms(controller)).
ReadableStreamControllerClearAlgorithms(unwrappedController);
// Step 5 (or 6): Perform ! ReadableStreamError(stream, e).
// Step 4 (or 5): Perform ! ReadableStreamError(stream, e).
return ReadableStreamErrorInternal(cx, unwrappedStream, e);
}
@ -3892,10 +3878,7 @@ static MOZ_MUST_USE bool ReadableByteStreamControllerClose(
}
}
// Step 6: Perform ! ReadableByteStreamControllerClearAlgorithms(controller).
ReadableStreamControllerClearAlgorithms(unwrappedController);
// Step 7: Perform ! ReadableStreamClose(stream).
// Step 6: Perform ! ReadableStreamClose(stream).
return ReadableStreamCloseInternal(cx, unwrappedStream);
}
@ -3924,10 +3907,6 @@ static MOZ_MUST_USE bool ReadableByteStreamControllerHandleQueueDrain(
if (unwrappedController->queueTotalSize() == 0 &&
unwrappedController->closeRequested()) {
// Step a: Perform
// ! ReadableByteStreamControllerClearAlgorithms(controller).
ReadableStreamControllerClearAlgorithms(unwrappedController);
// Step b: Perform
// ! ReadableStreamClose(controller.[[controlledReadableStream]]).
return ReadableStreamCloseInternal(cx, unwrappedStream);
}

View File

@ -316,13 +316,6 @@ class ReadableStreamController : public StreamController {
setUnderlyingSource(JS::PrivateValue(underlyingSource));
addFlags(Flag_ExternalSource);
}
void clearUnderlyingSource() {
if (hasExternalSource()) {
externalSource()->finalize();
setFlags(flags() & ~Flag_ExternalSource);
}
setUnderlyingSource(JS::UndefinedHandleValue);
}
double strategyHWM() const {
return getFixedSlot(Slot_StrategyHWM).toNumber();
}