EmbedderMsg: port reply channels to GenericChannel (#39018)

This change ports all `EmbedderMsg` reply channels that don't use the
`ROUTER` to GenericChannel.
The remaining reply channels that use the router are blocked until
#38973 is merged.
This is a breaking change in the API between libservo and embedders.

Future work: A lot of the reply channels in this PR look like they
conceptually should be oneshot ipc channels. It might make sense to
provide a `OneshotGenericChannel` abstraction that encodes this.

Testing: No functional changes - covered by existing tests. None of the
channels changed here uses the Router
Part of #38912

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2025-08-29 14:44:21 +02:00 committed by GitHub
parent 89e1357c75
commit 66d9f957e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 107 additions and 95 deletions

View file

@ -2,9 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use base::generic_channel;
use dom_struct::dom_struct;
use embedder_traits::{EmbedderMsg, ScreenMetrics};
use ipc_channel::ipc;
use crate::dom::bindings::codegen::Bindings::ScreenBinding::ScreenMethods;
use crate::dom::bindings::num::Finite;
@ -33,7 +33,7 @@ impl Screen {
/// Retrives [`ScreenMetrics`] from the embedder.
fn screen_metrics(&self) -> ScreenMetrics {
let (sender, receiver) = ipc::channel().expect("Failed to create IPC channel!");
let (sender, receiver) = generic_channel::channel().expect("Failed to create IPC channel!");
self.window.send_to_embedder(EmbedderMsg::GetScreenMetrics(
self.window.webview_id(),