@@ -572,7 +572,7 @@ callback UnderlyingSourceStartCallback = any (ReadableStreamController controlle
572
572
callback UnderlyingSourcePullCallback = Promise<undefined> (ReadableStreamController controller);
573
573
callback UnderlyingSourceCancelCallback = Promise<undefined> (optional any reason);
574
574
575
- enum ReadableStreamType { "bytes", "transfer " };
575
+ enum ReadableStreamType { "bytes", "owning " };
576
576
</xmp>
577
577
578
578
<dl>
@@ -652,7 +652,7 @@ enum ReadableStreamType { "bytes", "transfer" };
652
652
controller interface, see [[#example-rbs-push]] .
653
653
654
654
<p> Can be set to "<dfn enum-value for="ReadableStreamType">transfer</dfn> " to signal that the
655
- constructed {{ReadableStream}} will transfer or serialize chunks before enqueuing them.
655
+ constructed {{ReadableStream}} will own chunks (via transfer or serialization) before enqueuing them.
656
656
This ensures that enqueued chunks are not mutable by the source.
657
657
Transferred or serialized chunks may have <dfn>closing steps</dfn> which are executed if
658
658
enqueued chunks are dequeued without being provided to the application, for instance when
@@ -810,7 +810,7 @@ option. If {{UnderlyingSource/type}} is set to undefined (including via omission
810
810
|underlyingSource|, |underlyingSourceDict|, |highWaterMark|).
811
811
1. Otherwise,
812
812
1. Assert: |underlyingSourceDict|["{{UnderlyingSource/type}}"] does not [=map/exist=] or
813
- is "{{ReadableStreamType/transfer }} ".
813
+ is "{{ReadableStreamType/owning }} ".
814
814
1. Let |sizeAlgorithm| be ! [$ExtractSizeAlgorithm$] (|strategy|).
815
815
1. Let |highWaterMark| be ? [$ExtractHighWaterMark$] (|strategy|, 1).
816
816
1. Perform ? [$SetUpReadableStreamDefaultControllerFromUnderlyingSource$] ([=this=] ,
@@ -1533,8 +1533,9 @@ the following table:
1533
1533
<td> <dfn>\[[stream]]</dfn>
1534
1534
<td class="non-normative"> The {{ReadableStream}} instance controlled
1535
1535
<tr>
1536
- <td> <dfn>\[[isTransferring]]</dfn>
1537
- <td class="non-normative"> A boolean flag indicating whether to transfer enqueued chunks
1536
+ <td> <dfn>\[[isOwning]]</dfn>
1537
+ <td class="non-normative"> A boolean flag indicating whether to take ownership of enqueued chunks
1538
+ via transfer or serialization.
1538
1539
</table>
1539
1540
1540
1541
<h4 id="rs-default-controller-prototype">Methods and properties</h4>
@@ -1583,10 +1584,10 @@ the following table:
1583
1584
The <dfn id="ref-for-rs-default-controller-enqueue" method
1584
1585
for="ReadableStreamDefaultController"> enqueue(|chunk|, |options|)</dfn> method steps are:
1585
1586
1586
- 1. Let |transfer | be |options|["transfer"] .
1587
+ 1. Let |transferList | be |options|["transfer"] .
1587
1588
1. If ! [$ReadableStreamDefaultControllerCanCloseOrEnqueue$] ([=this=] ) is false, throw a
1588
1589
{{TypeError}} exception.
1589
- 1. Perform ? [$ReadableStreamDefaultControllerEnqueue$] ([=this=] , |chunk|, |transfer |).
1590
+ 1. Perform ? [$ReadableStreamDefaultControllerEnqueue$] ([=this=] , |chunk|, |transferList |).
1590
1591
</div>
1591
1592
1592
1593
<div algorithm>
@@ -2248,7 +2249,7 @@ create them does not matter.
2248
2249
objects|transferring=] their [=chunks=] . However, it does introduce a noticeable asymmetry between
2249
2250
the two branches, and limits the possible [=chunks=] to serializable ones. [[!HTML]]
2250
2251
2251
- If |stream| is a [=readable byte stream=] , or if |stream| type is "{{ReadableStreamType/transfer }} ",
2252
+ If |stream| is a [=readable byte stream=] , or if |stream| type is "{{ReadableStreamType/owning }} ",
2252
2253
then |cloneForBranch2| is ignored and chunks are cloned unconditionally.
2253
2254
2254
2255
<p class="note"> In this standard ReadableStreamTee is always called with |cloneForBranch2| set to
@@ -2260,7 +2261,7 @@ create them does not matter.
2260
2261
1. Assert: |cloneForBranch2| is a boolean.
2261
2262
1. If |stream|.[=ReadableStream/[[controller]]=] [=implements=] {{ReadableByteStreamController}} ,
2262
2263
return ? [$ReadableByteStreamTee$] (|stream|).
2263
- 1. If |stream|.[=ReadableStream/[[controller]]=] .[=ReadableStreamDefaultController/[[isTransferring ]]=]
2264
+ 1. If |stream|.[=ReadableStream/[[controller]]=] .[=ReadableStreamDefaultController/[[isOwning ]]=]
2264
2265
is true, return ? [$ReadableStreamDefaultTee$] (|stream|, true).
2265
2266
1. Return ? [$ReadableStreamDefaultTee$] (|stream|, |cloneForBranch2|).
2266
2267
</div>
@@ -2972,7 +2973,7 @@ The following abstract operations support the implementation of the
2972
2973
1. If ! [$IsReadableStreamLocked$] (|stream|) is true and !
2973
2974
[$ReadableStreamGetNumReadRequests$] (|stream|) > 0, perform the following steps:
2974
2975
1. Let |internalChunk| be |chunk|.
2975
- 1. If |controller|.[=ReadableStreamDefaultController/[[isTransferring ]]=] is true, perform the following steps:
2976
+ 1. If |controller|.[=ReadableStreamDefaultController/[[isOwning ]]=] is true, perform the following steps:
2976
2977
1. Set |internalChunk| to [$StructuredTransferOrClone$] (|chunk|, |transferList|).
2977
2978
1. If |internalChunk| is an abrupt completion,
2978
2979
1. Perform ! [$ReadableStreamDefaultControllerError$] (|controller|, |internalChunk|.\[[Value]] ).
@@ -3050,7 +3051,7 @@ The following abstract operations support the implementation of the
3050
3051
<dfn abstract-op lt="SetUpReadableStreamDefaultController"
3051
3052
id="set-up-readable-stream-default-controller"> SetUpReadableStreamDefaultController(|stream|,
3052
3053
|controller|, |startAlgorithm|, |pullAlgorithm|, |cancelAlgorithm|, |highWaterMark|,
3053
- |sizeAlgorithm|, |isTransferring |)</dfn> performs the following steps:
3054
+ |sizeAlgorithm|, |isOwning |)</dfn> performs the following steps:
3054
3055
3055
3056
1. Assert: |stream|.[=ReadableStream/[[controller]]=] is undefined.
3056
3057
1. Set |controller|.[=ReadableStreamDefaultController/[[stream]]=] to |stream|.
@@ -3061,8 +3062,8 @@ The following abstract operations support the implementation of the
3061
3062
|controller|.[=ReadableStreamDefaultController/[[pulling]]=] to false.
3062
3063
1. Set |controller|.[=ReadableStreamDefaultController/[[strategySizeAlgorithm]]=] to
3063
3064
|sizeAlgorithm|, |controller|.[=ReadableStreamDefaultController/[[strategyHWM]]=] to
3064
- |highWaterMark| and |controller|.[=ReadableStreamDefaultController/[[isTransferring ]]=] to
3065
- |isTransferring |.
3065
+ |highWaterMark| and |controller|.[=ReadableStreamDefaultController/[[isOwning ]]=] to
3066
+ |isOwning |.
3066
3067
1. Set |controller|.[=ReadableStreamDefaultController/[[pullAlgorithm]]=] to |pullAlgorithm|.
3067
3068
1. Set |controller|.[=ReadableStreamDefaultController/[[cancelAlgorithm]]=] to |cancelAlgorithm|.
3068
3069
1. Set |stream|.[=ReadableStream/[[controller]]=] to |controller|.
@@ -3087,8 +3088,8 @@ The following abstract operations support the implementation of the
3087
3088
1. Let |startAlgorithm| be an algorithm that returns undefined.
3088
3089
1. Let |pullAlgorithm| be an algorithm that returns [=a promise resolved with=] undefined.
3089
3090
1. Let |cancelAlgorithm| be an algorithm that returns [=a promise resolved with=] undefined.
3090
- 1. Let |isTransferring | be true if |underlyingSourceDict|["{{UnderlyingSource/type}}"] is
3091
- "{{ReadableStreamType/transfer }} " and false otherwise.
3091
+ 1. Let |isOwning | be true if |underlyingSourceDict|["{{UnderlyingSource/type}}"] is
3092
+ "{{ReadableStreamType/owning }} " and false otherwise.
3092
3093
1. If |underlyingSourceDict|["{{UnderlyingSource/start}}"] [=map/exists=] , then set
3093
3094
|startAlgorithm| to an algorithm which returns the result of [=invoking=]
3094
3095
|underlyingSourceDict|["{{UnderlyingSource/start}}"] with argument list
@@ -3102,7 +3103,7 @@ The following abstract operations support the implementation of the
3102
3103
[=invoking=] |underlyingSourceDict|["{{UnderlyingSource/cancel}}"] with argument list
3103
3104
« |reason| » and [=callback this value=] |underlyingSource|.
3104
3105
1. Perform ? [$SetUpReadableStreamDefaultController$] (|stream|, |controller|, |startAlgorithm|,
3105
- |pullAlgorithm|, |cancelAlgorithm|, |highWaterMark|, |sizeAlgorithm|, |isTransferring |).
3106
+ |pullAlgorithm|, |cancelAlgorithm|, |highWaterMark|, |sizeAlgorithm|, |isOwning |).
3106
3107
</div>
3107
3108
3108
3109
<h4 id="rbs-controller-abstract-ops">Byte stream controllers</h4>
@@ -6393,7 +6394,7 @@ for="value-with-size">value</dfn> and <dfn for="value-with-size">size</dfn>.
6393
6394
1. If ! [$IsNonNegativeNumber$] (|size|) is false, throw a {{RangeError}} exception.
6394
6395
1. If |size| is +∞, throw a {{RangeError}} exception.
6395
6396
1. Let |enqueuedValue| be |value|.
6396
- 1. If |container| has a \[[isTransferring ]] internal slot whose value is true, perform the following steps:
6397
+ 1. If |container| has a \[[isOwning ]] internal slot whose value is true, perform the following steps:
6397
6398
1. Set |enqueuedValue| to [$StructuredTransferOrClone$] (|value|, |transferList|).
6398
6399
1. If |enqueuedValue| is an abrupt completion, return |enqueuedValue|.
6399
6400
1. [=list/Append=] a new [=value-with-size=] with [=value-with-size/value=] |enqueuedValue| and
@@ -6416,7 +6417,7 @@ for="value-with-size">value</dfn> and <dfn for="value-with-size">size</dfn>.
6416
6417
performs the following steps:
6417
6418
6418
6419
1. Assert: |container| has \[[queue]] and \[[queueTotalSize]] internal slots.
6419
- 1. If |container| has a \[[isTransferring ]] internal slot whose value is true, perform the following steps until |container|.\[[queue]]
6420
+ 1. If |container| has a \[[isOwning ]] internal slot whose value is true, perform the following steps until |container|.\[[queue]]
6420
6421
is [=list/is empty|empty=] :
6421
6422
1. Let |chunk| be ! [$DequeueValue$] ([=this=] ).
6422
6423
1. If |chunk| has [=closing steps=] , perform the [=closing steps=] given |chunk|.
@@ -6631,8 +6632,7 @@ The following abstract operations are a grab-bag of utilities.
6631
6632
<div algorithm>
6632
6633
<dfn abstract-op lt="StructuredTransferOrClone">StructuredTransferOrClone(|value|, |transferList|)</dfn>
6633
6634
performs the following steps:
6634
- 1. If |value| has either an \[[ArrayBufferData]] internal slot or a \[[Detached]] internal slot, perform the following steps:
6635
- 1. If |transferList| is undefined or [=list/is empty|is an empty list=] , set |transferList| to « |value| ».
6635
+ // FIXME: we might want to set |transferList| to « |value| » in case of transferable or ArrayBuffer objects.
6636
6636
1. Let |serialized| be ! [$StructuredSerializeWithTransfer$] (|value|, |transferList|).
6637
6637
1. Let |deserialized| be ! [$StructuredDeserializeWithTransfer$] (|serialized|, [=the current Realm=] ).
6638
6638
1. return |deserialized|.\[[Deserialized]] .
0 commit comments