Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "SendStream" Web IDL interface #307

Merged
merged 7 commits into from
Jul 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ interface WebTransport {
/* a ReadableStream of BidirectionalStream objects */
readonly attribute ReadableStream incomingBidirectionalStreams;

Promise<SendStream> createUnidirectionalStream();
Promise<WritableStream> createUnidirectionalStream();
/* a ReadableStream of ReceiveStream objects */
readonly attribute ReadableStream incomingUnidirectionalStreams;
};
Expand All @@ -573,7 +573,7 @@ A {{WebTransport}} object has the following internal slots.
<tbody>
<tr>
<td><dfn>\[[SendStreams]]</dfn>
<td class="non-normative">An [=ordered set=] of {{SendStream}} objects owned by this {{WebTransport}}.
<td class="non-normative">An [=ordered set=] of {{SendStreams}} owned by this {{WebTransport}}.
</tr>
<tr>
<td><dfn>\[[ReceiveStreams]]</dfn>
Expand Down Expand Up @@ -846,7 +846,7 @@ these steps.

: <dfn for="WebTransport" method>createUnidirectionalStream()</dfn>

:: Creates a {{SendStream}} object for an outgoing unidirectional stream. Note
:: Creates a {{SendStream}} for an outgoing unidirectional stream. Note
that the mere creation of a stream is not immediately visible to the server until it is used
to send data.

Expand Down Expand Up @@ -1078,16 +1078,13 @@ The dictionary SHALL have the following attributes:
:: The number of datagrams that were dropped, due to too many datagrams buffered
between calls to {{DatagramTransport/datagrams}}' {{DatagramDuplexStream/readable}}.

# Interface `SendStream` # {#send-stream}
# `SendStream` # {#send-stream}

A <dfn interface>SendStream</dfn> is a {{WritableStream}} of {{Uint8Array}}
that can be written to, to transmit data to the server.
In this spec, we call a {{WritableStream}} providing outgoing streaming features with an [=outgoing
unidirectional=] or [=bidirectional=] [=WebTransport stream=] a <dfn interface>SendStream</dfn>.

<pre class="idl">
[Exposed=(Window,Worker), SecureContext]
interface SendStream : WritableStream /* of Uint8Array */ {
};
</pre>
Note: {{SendStream}} is not a Web IDL type. A {{SendStream}} is always created by the
[=SendStream/create=] procedure.

## Internal Slots ## {#send-stream-internal-slots}

Expand Down Expand Up @@ -1117,6 +1114,11 @@ A {{SendStream}} has the following internal slots.
<tbody>
</table>

Note: These internal slots need to be attached to {{SendStream}} (which is a kind of
{{WritableStream}}) conceptually, not physically. For example, an implementation could place them on
an object which is referenced from |writeAlgorithm|, |closeAlgorithm| and |abortAlgorithm| in the
[=SendStream/create=] procedure.

## Procedures ## {#send-stream-procedures}

<div algorithm="create a SendStream">
Expand All @@ -1125,7 +1127,7 @@ To <dfn export for="SendStream" lt="create|creating">create</dfn> a
{{SendStream}}, with an [=outgoing unidirectional=] or [=bidirectional=] [=WebTransport stream=]
|internalStream| and a {{WebTransport}} |transport|, run these steps:

1. Let |stream| be a [=new=] {{SendStream}}, with:
1. Let |stream| be a [=new=] {{WritableStream}}, with:
: [=[[InternalStream]]=]
:: |internalStream|
: [=[[PendingOperation]]=]
Expand Down Expand Up @@ -1313,7 +1315,7 @@ The {{ReceiveStream}}'s <dfn>cancelAlgorithm</dfn> is:
[Exposed=(Window,Worker), SecureContext]
interface BidirectionalStream {
readonly attribute ReceiveStream readable;
readonly attribute SendStream writable;
readonly attribute WritableStream writable;
};
</pre>

Expand Down