Revert "GenericChannel: Migrate compositor channels to GenericChannel (#38782)" (#38940)

This reverts commit fb1c0a4c48.

Previously in `create_compositor_channel`, the [routing callback][1] was
setup so that a message received on the Compositor's IPC receiver will
be
forwarded to the local receiver using the `CompositorProxy` which also
takes care of waking up the event loop. In #38782, this was changed so
that the routing callbacks simply forwards the message directly without
going via the `CompositorProxy`. This breaks behaviours that rely on the
event loop being woken up on message sending, e.g. updating image frames
for animated gifs.

Since the GenericChannel API doesn't allow custom routing callbacks,
revert this change until we figure out a better solution.

[1]:
d2ccce6052/components/servo/lib.rs (L1114)

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Mukilan Thiyagarajan 2025-08-26 19:46:58 +05:30 committed by GitHub
parent 26fb603d15
commit c75995ec87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 42 additions and 96 deletions

View file

@ -11,9 +11,9 @@ use std::rc::Rc;
use std::sync::Arc;
use std::time::{SystemTime, UNIX_EPOCH};
use base::Epoch;
use base::cross_process_instant::CrossProcessInstant;
use base::id::{PipelineId, WebViewId};
use base::{Epoch, generic_channel};
use bitflags::bitflags;
use compositing_traits::display_list::{CompositorDisplayListInfo, ScrollTree, ScrollType};
use compositing_traits::rendering_context::RenderingContext;
@ -22,7 +22,7 @@ use compositing_traits::{
WebViewTrait,
};
use constellation_traits::{EmbedderToConstellationMessage, PaintMetricEvent};
use crossbeam_channel::Sender;
use crossbeam_channel::{Receiver, Sender};
use dpi::PhysicalSize;
use embedder_traits::{CompositorHitTestResult, InputEvent, ShutdownState, ViewportDetails};
use euclid::{Point2D, Rect, Scale, Size2D, Transform3D};
@ -92,7 +92,7 @@ pub struct ServoRenderer {
shutdown_state: Rc<Cell<ShutdownState>>,
/// The port on which we receive messages.
compositor_receiver: generic_channel::RoutedReceiver<CompositorMsg>,
compositor_receiver: Receiver<CompositorMsg>,
/// The channel on which messages can be sent to the constellation.
pub(crate) constellation_sender: Sender<EmbedderToConstellationMessage>,
@ -1388,7 +1388,7 @@ impl IOCompositor {
}
/// Get the message receiver for this [`IOCompositor`].
pub fn receiver(&self) -> Ref<'_, generic_channel::RoutedReceiver<CompositorMsg>> {
pub fn receiver(&self) -> Ref<'_, Receiver<CompositorMsg>> {
Ref::map(self.global.borrow(), |global| &global.compositor_receiver)
}