Port ScriptToConstellation channel to generic channel (#38990)

This change was previously part of
fb1c0a4c48, which got reverted due to an
issue
with the compositor channel.

Split this change out into a separate PR, as it probably should have
been in the first place. Presumably it was one change before, since
serialization of crossbeam generic channels in single-process mode was
not implemented yet at the time.

Testing: Covered by existing tests. No custom callbacks involved.

Part of #38912

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2025-08-29 06:22:48 +02:00 committed by GitHub
parent c4a69abe30
commit 20e955277a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 11 deletions

View file

@ -290,7 +290,7 @@ pub struct Constellation<STF, SWF> {
/// An IPC channel for script threads to send messages to the constellation.
/// This is the script threads' view of `script_receiver`.
script_sender: IpcSender<(PipelineId, ScriptToConstellationMessage)>,
script_sender: GenericSender<(PipelineId, ScriptToConstellationMessage)>,
/// A channel for the constellation to receive messages from script threads.
/// This is the constellation's view of `script_sender`.
@ -607,11 +607,8 @@ where
.name("Constellation".to_owned())
.spawn(move || {
let (script_ipc_sender, script_ipc_receiver) =
ipc::channel().expect("ipc channel failure");
let script_receiver =
route_ipc_receiver_to_new_crossbeam_receiver_preserving_errors(
script_ipc_receiver,
);
generic_channel::channel().expect("ipc channel failure");
let script_receiver = script_ipc_receiver.route_preserving_errors();
let (namespace_ipc_sender, namespace_ipc_receiver) =
generic_channel::channel().expect("ipc channel failure");