Transfer ReadableStream (#36181)

<!-- Please describe your changes on the following line: -->

Add transfer support to ReadableStream. Part of
https://github.com/servo/servo/issues/34676

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
Gregory Terzian 2025-04-15 15:39:26 +08:00 committed by GitHub
parent c9489ca04f
commit f8b6b9f7b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 983 additions and 75 deletions

View file

@ -224,6 +224,8 @@ impl Serializable {
pub enum Transferrable {
/// The `MessagePort` interface.
MessagePort,
/// The `ReadableStream` interface.
ReadableStream,
}
impl StructuredSerializedData {
@ -233,6 +235,7 @@ impl StructuredSerializedData {
}
match val {
Transferrable::MessagePort => is_field_empty(&self.ports),
Transferrable::ReadableStream => is_field_empty(&self.ports),
}
}