Return ScriptPromise from TransformStreamTransformer
Previously the Transform() and Flush() methods of TransformStreamTransformer returned void. This meant that there was no way for them to wait for asynchronous work to finish. Change the function signatures to return ScriptPromise. Transform() or Flush() won't be called again until the returned promise is settled. Returning v8::Local<v8::Promise> would have been slightly more efficient, but ScriptPromise was used for consistency with UnderlyingSinkBase and UnderlyingSourceBase. Add tests that Transform() and Flush() promises are actually waited for. BUG=962837 Change-Id: I2e79c6a79a457fd021eee17eca4f1502c3aa521f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865735Reviewed-by:Yutaka Hirano <yhirano@chromium.org> Commit-Queue: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/master@{#709861}
Showing
This diff is collapsed.
Please register or sign in to comment