• Adam Rice's avatar
    Implement TransformStream behind a flag · 9dc1afc1
    Adam Rice authored
    Add an implementation of TransformStream using v8 extras. It will be
    enabled when --enable-experimental-web-platform-features is enabled.
    
    Implementation is conformant to the standard:
    https://streams.spec.whatwg.org/#ts
    
    Tests are not included in this CL, as they are due to move from the
    whatwg/streams repository to the w3c/web-platform-tests repository very
    soon. All transform stream tests pass.
    
    Some changes have been made to the existing ReadableStream and
    WritableStream extensions to enable the implementation.
    
    ReadableStream:
    - ReadableStreamDefaultControllerHasBackpressure and
      ReadableStreamDefaultControllerCanCloseOrEnqueue abstract operations
      have been implemented. These were already in the standard.
    - getReadableStreamEnqueueError has been factored out so that enqueue()
      for ReadableStreamDefaultController and
      TransformStreamDefaultController can share common error messages.
    - Internal accessors getReadableStreamController and
      getReadableStreamStoredError have been added for TransformStream to
      use.
    
    WritableStream:
    - New accessors isWritableStreamWritable, isWritableStreamErroring and
      getWritableStreamController have been added.
    - WritableStreamDefaultControllerErrorIfNeeded is newly exported on the
      binding object.
    
    Bug: 780689
    
    TBR=brettw@chromium.org
    R=domenic@chromium.org
    
    Change-Id: I3d0d5442f2ccad8350ab52caad2961374446656d
    Reviewed-on: https://chromium-review.googlesource.com/750502
    Commit-Queue: Adam Rice <ricea@chromium.org>
    Reviewed-by: 's avatarTakeshi Yoshino <tyoshino@chromium.org>
    Reviewed-by: 's avatarAdam Rice <ricea@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#515521}
    9dc1afc1