mirror of
https://github.com/servo/servo.git
synced 2025-09-23 05:10:09 +01:00
canvas: Port CanvasMsg channel to generic channel (#39348)
Additionally also improve the warning message if the routed receiver disconnects and exit the thread. If the routed receiver disconnects, we can't receive any canvas messages anymore, and any control messages can't remedy that, so we might as well exit. Testing: Channel changes are covered by existing tests. Exiting the canvas thread if the routed thread disconnects is not tested, and needs reviewer attention. Part of https://github.com/servo/servo/issues/38912 Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
parent
76645e5e26
commit
666b17a9a1
4 changed files with 23 additions and 18 deletions
|
@ -451,7 +451,7 @@ pub struct Constellation<STF, SWF> {
|
|||
webxr_registry: Option<webxr_api::Registry>,
|
||||
|
||||
/// Lazily initialized channels for canvas paint thread.
|
||||
canvas: OnceCell<(Sender<ConstellationCanvasMsg>, IpcSender<CanvasMsg>)>,
|
||||
canvas: OnceCell<(Sender<ConstellationCanvasMsg>, GenericSender<CanvasMsg>)>,
|
||||
|
||||
/// Navigation requests from script awaiting approval from the embedder.
|
||||
pending_approval_navigations: PendingApprovalNavigations,
|
||||
|
@ -4495,7 +4495,7 @@ where
|
|||
fn handle_create_canvas_paint_thread_msg(
|
||||
&mut self,
|
||||
size: UntypedSize2D<u64>,
|
||||
response_sender: IpcSender<Option<(IpcSender<CanvasMsg>, CanvasId, ImageKey)>>,
|
||||
response_sender: IpcSender<Option<(GenericSender<CanvasMsg>, CanvasId, ImageKey)>>,
|
||||
) {
|
||||
let (canvas_data_sender, canvas_data_receiver) = unbounded();
|
||||
let (canvas_sender, canvas_ipc_sender) = self
|
||||
|
@ -5648,7 +5648,9 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn create_canvas_paint_thread(&self) -> (Sender<ConstellationCanvasMsg>, IpcSender<CanvasMsg>) {
|
||||
fn create_canvas_paint_thread(
|
||||
&self,
|
||||
) -> (Sender<ConstellationCanvasMsg>, GenericSender<CanvasMsg>) {
|
||||
CanvasPaintThread::start(self.compositor_proxy.cross_process_compositor_api.clone())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue