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:
Jonathan Schwender 2025-09-18 08:06:08 +08:00 committed by GitHub
parent 76645e5e26
commit 666b17a9a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 18 deletions

View file

@ -542,7 +542,7 @@ pub enum ScriptToConstellationMessage {
/// 2D canvases may use the GPU and we don't want to give untrusted content access to the GPU.)
CreateCanvasPaintThread(
UntypedSize2D<u64>,
IpcSender<Option<(IpcSender<CanvasMsg>, CanvasId, ImageKey)>>,
IpcSender<Option<(GenericSender<CanvasMsg>, CanvasId, ImageKey)>>,
),
/// Notifies the constellation that this pipeline is requesting focus.
///