New issue
Advanced search Search tips

Issue 893334 link

Starred by 5 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug

Blocking:
issue 884928



Sign in to add a comment

Support wrapping Mojo data pipes in a ReadableStream or WritableStream

Project Member Reported by reillyg@chromium.org, Oct 8

Issue description

The Serial API will use Mojo data pipes as the data transport between the render process and the device service. These pipes will then be exposed to the web as a ReadableStream/WritableStream pair.

The Fetch API currently has a way to wrap a data pipe in a stream however it is buried deeply inside the implementation of that particular API. The Serial API will not only need a similar wrapper but for testing we will also want to read and write to a data pipe from JavaScript and the stream abstraction is a good one.

This issue tracks writing generic wrappers around a Mojo data pipe consumer or producer handle that provide a ReadableStream or WritableStream respectively. These will be used internally by the Serial API and exposed for testing through the Mojo JS bindings.

Two new methods, toReadableStream() and toWritableStream(), will be added to the MojoHandle interface. Once this is done the existing writeData(), queryData(), discardData() and readData() methods can probably be removed. They are currently unused outside of tests.
 
Blocking: 884928
Cc: -roc...@chromium.org rockot@google.com

Sign in to add a comment