mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
MessagePort: implement disentanglement (#36654)
Implement [disentangle](https://html.spec.whatwg.org/multipage/#disentangle) Remove bespoke gc logic which now becomes unnecessary. Adds a wpt test that hits the "disentangle while in transfer" logic. Updates streams code, fixing an error where disentanglement is conditional on an error. Test coverage: there are existing tests in `/webmessaging/message-channels/close-event/explicitly-closed.tentative.window.js` for the no transfer case, and the simple completed transfer case, and this PR adds a test for the more complicated transfer in progress case. Fix https://github.com/servo/servo/issues/36465 --------- Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
parent
c46402e222
commit
af5d665efa
19 changed files with 356 additions and 191 deletions
|
@ -1825,7 +1825,7 @@ impl ReadableStream {
|
|||
global.note_cross_realm_transform_readable(&cross_realm_transform_readable, port_id);
|
||||
|
||||
// Enable port’s port message queue.
|
||||
port.Start();
|
||||
port.Start(can_gc);
|
||||
|
||||
// Perform ! SetUpReadableStreamDefaultController
|
||||
controller
|
||||
|
@ -2093,7 +2093,7 @@ impl CrossRealmTransformReadable {
|
|||
self.controller.close(can_gc);
|
||||
|
||||
// Disentangle port.
|
||||
global.disentangle_port(port);
|
||||
global.disentangle_port(port, can_gc);
|
||||
}
|
||||
|
||||
// Otherwise, if type is "error",
|
||||
|
@ -2102,7 +2102,7 @@ impl CrossRealmTransformReadable {
|
|||
self.controller.error(value.handle(), can_gc);
|
||||
|
||||
// Disentangle port.
|
||||
global.disentangle_port(port);
|
||||
global.disentangle_port(port, can_gc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2129,7 +2129,7 @@ impl CrossRealmTransformReadable {
|
|||
self.controller.error(rooted_error.handle(), can_gc);
|
||||
|
||||
// Disentangle port.
|
||||
global.disentangle_port(port);
|
||||
global.disentangle_port(port, can_gc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue