| 911 | AsyncTransformStream::AsyncTransformStream() {} |
| 912 | |
| 913 | Result AsyncTransformStream::asyncWrite(AsyncBufferView::ID bufferID, Function<void(AsyncBufferView::ID)> cb) |
| 914 | { |
| 915 | switch (state) |
| 916 | { |
| 917 | case State::None: { |
| 918 | SC_TRY(AsyncReadableStream::getBuffersPool().getReadableData(bufferID, inputData)); |
| 919 | return prepare(bufferID, cb); |
| 920 | } |
| 921 | case State::Paused: { |
| 922 | SC_TRY_MSG(bufferID == inputBufferID, "Logical Error") |
| 923 | return prepare(bufferID, cb); |
| 924 | } |
| 925 | case State::Finalized: { |
| 926 | return Result::Error("Transform cannot be called during Finalized State"); |
| 927 | } |
| 928 | case State::Processing: { |
| 929 | return Result::Error("Transform cannot be called during Processing State"); |
| 930 | } |
| 931 | case State::Finalizing: { |
| 932 | return Result::Error("Transform cannot be called during Finalizing State"); |
| 933 | } |
| 934 | } |
| 935 | return Result(true); |
| 936 | } |
| 937 | |
| 938 | Result AsyncTransformStream::prepare(AsyncBufferView::ID bufferID, Function<void(AsyncBufferView::ID)> cb) |
| 939 | { |
nothing calls this directly
no test coverage detected