Make transform stream transferrable#36905
Merged
Taym95 merged 2 commits intoservo:mainfrom May 12, 2025
Merged
Conversation
cc42f23 to
a3a4763
Compare
gterzian
previously requested changes
May 7, 2025
| readable.transfer()?; | ||
|
|
||
| // Set dataHolder.[[writable]] to ! StructuredSerializeWithTransfer(writable, « writable »). | ||
| writable.transfer() |
Member
There was a problem hiding this comment.
It's going to be more complicated--because here you are losing the transfer of the readable--but not much more.
I was thinking of two ways to do it, with the first one being easier than the second, but perhaps only the second one works:
- Use one pair of ports for the transfer of both the readable and the writable. So you can't just use the existing
transfer, rather you have to unwrap those operations here and re-use the pair of ports for both.
So like:
// First do the readable transfer:
// Let writable be a new WritableStream in the current Realm.
let writable = WritableStream::new_with_proto(&global, None, can_gc);
// Perform ! SetUpCrossRealmTransformWritable(writable, port1).
writable.setup_cross_realm_transform_writable(cx, &port_1, can_gc);
// Let promise be ! ReadableStreamPipeTo(value, writable, false, false, false).
let promise = readable.pipe_to(cx, &global, &writable, false, false, false, comp, can_gc);
// and so on...
// Next, do the writable, using the same port_1.
// Then, transfer port_2, for both sides.
// Set dataHolder.[[port]] to ! StructuredSerializeWithTransfer(port2, « port2 »).
port_2.transfer()
- If that doesn't work(I can imagine using the same port could mess things up with error handling because of disentanglement), then, you need to use two pairs of ports, by way of a new
Index, and a newData, where the data would be something holding a pair ofport_2, one for each side.
Member
Author
There was a problem hiding this comment.
@gterzian I used one pair of ports for the transfer of both the readable and the writable. please review again thanks!
Signed-off-by: Taym Haddadi <[email protected]>
58ba0aa to
d3bef55
Compare
|
🔨 Triggering try run (#14956274413) for Linux (WPT) |
|
Test results for linux-wpt from try job (#14956274413): Flaky unexpected result (22)
Stable unexpected results that are known to be intermittent (10)
Stable unexpected results (4)
|
|
|
…ritable. Signed-off-by: Taym Haddadi <[email protected]>
01c76de to
e7937b0
Compare
|
🔨 Triggering try run (#14956805259) for Linux (WPT) |
|
Test results for linux-wpt from try job (#14956805259): Flaky unexpected result (24)
Stable unexpected results that are known to be intermittent (9)
|
|
✨ Try run (#14956805259) succeeded. |
jdm
reviewed
May 11, 2025
jdm
approved these changes
May 12, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 20, 2025
Part of #34676 #36905 needs to be merged first. --------- Signed-off-by: Taym Haddadi <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #34676
#36739 needs to be merged first.