From 8b80c64ea5e54ffaff80ddbc42bb4517be4ae87a Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Tue, 15 Jan 2019 01:19:36 +0200 Subject: [PATCH] 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) --- js/src/builtin/Stream.cpp | 35 +++++++---------------------------- js/src/builtin/Stream.h | 7 ------- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/js/src/builtin/Stream.cpp b/js/src/builtin/Stream.cpp index 504a682eda82..fdaaf7697feb 100644 --- a/js/src/builtin/Stream.cpp +++ b/js/src/builtin/Stream.cpp @@ -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 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); } diff --git a/js/src/builtin/Stream.h b/js/src/builtin/Stream.h index d9f3acb1e9e9..51f47f1d9bd4 100644 --- a/js/src/builtin/Stream.h +++ b/js/src/builtin/Stream.h @@ -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(); }