Skip to content

Commit 981a72c

Browse files
authored
Merge pull request #567 from w3c/serial
Add spec text for serializable encoded chunks.
2 parents 2a69381 + 0913cb5 commit 981a72c

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

index.src.html

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,7 +2441,7 @@
24412441
EncodedAudioChunk Interface {#encodedaudiochunk-interface}
24422442
------------------------------------------------------------
24432443
<xmp class='idl'>
2444-
[Exposed=(Window,DedicatedWorker)]
2444+
[Exposed=(Window,DedicatedWorker), Serializable]
24452445
interface EncodedAudioChunk {
24462446
constructor(EncodedAudioChunkInit init);
24472447
readonly attribute EncodedAudioChunkType type;
@@ -2510,10 +2510,28 @@
25102510
greater than in |destination|, throw a {{TypeError}}.
25112511
2. Copy the {{EncodedAudioChunk/[[internal data]]}} into |destination|.
25122512

2513+
### Serialization ###{#encodedaudiochunk-serialization}
2514+
: The {{EncodedAudioChunk}} [=serialization steps=] (with |value|, |serialized|,
2515+
and |forStorage|) are:
2516+
:: 1. If |forStorage| is `true`, throw a {{TypeError}}.
2517+
2. For each {{EncodedAudioChunk}} internal slot in |value|, assign the value
2518+
of each internal slot to a field in |serialized| with the same name as
2519+
the internal slot.
2520+
2521+
: The {{EncodedAudioChunk}} [=deserialization steps=] (with |serialized| and
2522+
|value|) are:
2523+
:: 1. For all named fields in |serialized|, assign the value of each named field
2524+
to the {{EncodedAudioChunk}} internal slot in |value| with the same name
2525+
as the named field.
2526+
2527+
NOTE: Since {{EncodedAudioChunk}}s are immutable, User Agents may choose to
2528+
implement serialization using a reference counting model similar to
2529+
[[#audiodata-transfer-serialization]].
2530+
25132531
EncodedVideoChunk Interface{#encodedvideochunk-interface}
25142532
-----------------------------------------------------------
25152533
<xmp class='idl'>
2516-
[Exposed=(Window,DedicatedWorker)]
2534+
[Exposed=(Window,DedicatedWorker), Serializable]
25172535
interface EncodedVideoChunk {
25182536
constructor(EncodedVideoChunkInit init);
25192537
readonly attribute EncodedVideoChunkType type;
@@ -2584,6 +2602,24 @@
25842602
{{TypeError}}.
25852603
2. Copy the {{EncodedVideoChunk/[[internal data]]}} into |destination|.
25862604

2605+
### Serialization ###{#encodedvideochunk-serialization}
2606+
: The {{EncodedVideoChunk}} [=serialization steps=] (with |value|, |serialized|,
2607+
and |forStorage|) are:
2608+
:: 1. If |forStorage| is `true`, throw a {{TypeError}}.
2609+
2. For each {{EncodedVideoChunk}} internal slot in |value|, assign the value
2610+
of each internal slot to a field in |serialized| with the same name as
2611+
the internal slot.
2612+
2613+
: The {{EncodedVideoChunk}} [=deserialization steps=] (with |serialized| and
2614+
|value|) are:
2615+
:: 1. For all named fields in |serialized|, assign the value of each named field
2616+
to the {{EncodedVideoChunk}} internal slot in |value| with the same name
2617+
as the named field.
2618+
2619+
NOTE: Since {{EncodedVideoChunk}}s are immutable, User Agents may choose to
2620+
implement serialization using a reference counting model similar to
2621+
[[#videoframe-transfer-serialization]].
2622+
25872623

25882624
Raw Media Interfaces {#raw-media-interfaces}
25892625
====================================================

0 commit comments

Comments
 (0)