mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
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:
parent
2b7186893f
commit
ea5d786506
6 changed files with 131 additions and 26 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -9717,6 +9717,7 @@ dependencies = [
|
|||
name = "webgl"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"base",
|
||||
"bitflags 2.9.3",
|
||||
"byteorder",
|
||||
"canvas_traits",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue