generic_channel: Preserve IPC errors (#38854)

We should not be using `route_ipc_receiver_to_new_crossbeam_receiver` or
similar methods, that `unwrap()` on the ROUTER thread if they encounter
IPC errors. Instead, we now propagate the error to the crossbeam
receiver.
In the GenericChannel::Crossbeam case this means, that we need to use a
`Result<T>` as the data type, even though the Result variant is always
okay, so that the receiver type is the same regardless of `IPC` or not.
This is required, so we have the same channel type, and can pass the
inner crossbeam channel into e.g. `select!`, without having to wrap or
re-implement select.

This also means, that as we switch towards GenericChannel, we will
gradually improve our error handling and eventually remove the existing
panics on IPC errors.

These changes were extracted out of
https://github.com/servo/servo/pull/38782

Testing: Covered by existing tests. No new panics were introduced.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2025-08-25 06:19:41 +02:00 committed by GitHub
parent 2b7186893f
commit ea5d786506
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 131 additions and 26 deletions

1
Cargo.lock generated
View file

@ -9717,6 +9717,7 @@ dependencies = [
name = "webgl"
version = "0.0.1"
dependencies = [
"base",
"bitflags 2.9.3",
"byteorder",
"canvas_traits",