| 984 | } |
| 985 | } |
| 986 | |
| 987 | void AsyncTransformStream::afterFinalize(Span<char> outputAfter, bool streamEnded) |
| 988 | { |
| 989 | const size_t consumedOutput = outputData.sizeInBytes() - outputAfter.sizeInBytes(); |
| 990 | if (consumedOutput > 0) |
| 991 | { |
| 992 | // Ignore whatever push returns because later on the stream is either finalizing or pausing either way |
| 993 | (void)AsyncReadableStream::push(outputBufferID, consumedOutput); |
| 994 | } |
| 995 | AsyncReadableStream::getBuffersPool().unrefBuffer(outputBufferID); |
| 996 | if (streamEnded) |
| 997 | { |
| 998 | AsyncReadableStream::pushEnd(); |
| 999 | state = State::Finalized; // --> Transition to ENDED (all data written) |
| 1000 | } |
| 1001 | else |
| 1002 | { |
| 1003 | state = State::Paused; |
| 1004 | tryFinalize(); |
| 1005 | } |
| 1006 | } |
| 1007 | |
| 1008 | void AsyncTransformStream::tryFinalize() |
nothing calls this directly
no test coverage detected