| 954 | } |
| 955 | } |
| 956 | |
| 957 | void AsyncTransformStream::afterProcess(Span<const char> inputAfter, Span<char> outputAfter) |
| 958 | { |
| 959 | const size_t consumedOutput = outputData.sizeInBytes() - outputAfter.sizeInBytes(); |
| 960 | if (consumedOutput > 0) |
| 961 | { |
| 962 | // Ignore whatever push returns because later on the stream is either finalizing or pausing either way |
| 963 | (void)AsyncReadableStream::push(outputBufferID, consumedOutput); |
| 964 | } |
| 965 | AsyncReadableStream::getBuffersPool().unrefBuffer(outputBufferID); |
| 966 | if (inputAfter.empty()) |
| 967 | { |
| 968 | auto cb = move(inputCallback); |
| 969 | auto bufferID = inputBufferID; |
| 970 | inputCallback = {}; |
| 971 | inputBufferID = {}; |
| 972 | inputData = {}; |
| 973 | outputBufferID = {}; |
| 974 | outputData = {}; |
| 975 | state = State::None; |
| 976 | AsyncWritableStream::finishedWriting(bufferID, move(cb), Result(true)); |
| 977 | } |
| 978 | else |
| 979 | { |
| 980 | inputData = inputAfter; |
| 981 | |
| 982 | state = State::Paused; |
| 983 | tryAsync(asyncWrite(inputBufferID, inputCallback)); |
| 984 | } |
| 985 | } |
| 986 | |
| 987 | void AsyncTransformStream::afterFinalize(Span<char> outputAfter, bool streamEnded) |
nothing calls this directly
no test coverage detected