GenericChannel: Migrate compositor channels to GenericChannel (#38782)

Besides migrating the channel to GenericChannel, this PR adds
`routed_channel_with_local_sender()` to `generic_channel`. This is for
existing use-cases, where we want to provide both an IPC capable
GenericSender, as well as a crossbeam Sender, for efficient sending if
the sender is in the same process.

Testing: All of our channels should send / receive at least some
messages during WPT tests.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2025-08-25 13:05:21 +02:00 committed by GitHub
parent 7441944e36
commit fb1c0a4c48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 98 additions and 43 deletions

View file

@ -4,6 +4,7 @@
use std::sync::Arc;
use base::generic_channel::GenericSender;
use base::id::PipelineId;
use constellation_traits::{ScriptToConstellationChan, ScriptToConstellationMessage};
use crossbeam_channel::Sender;
@ -199,7 +200,7 @@ pub(crate) struct WorkletGlobalScopeInit {
/// Channel to devtools
pub(crate) devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
/// Messages to send to constellation
pub(crate) to_constellation_sender: IpcSender<(PipelineId, ScriptToConstellationMessage)>,
pub(crate) to_constellation_sender: GenericSender<(PipelineId, ScriptToConstellationMessage)>,
/// The image cache
pub(crate) image_cache: Arc<dyn ImageCache>,
/// Identity manager for WebGPU resources