mirror of
https://github.com/servo/servo.git
synced 2025-09-19 11:20:09 +01:00
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:
parent
89e1357c75
commit
66d9f957e6
20 changed files with 107 additions and 95 deletions
|
@ -704,7 +704,7 @@ impl WebViewDelegate for RunningAppState {
|
|||
&self,
|
||||
webview: servo::WebView,
|
||||
devices: Vec<String>,
|
||||
response_sender: IpcSender<Option<String>>,
|
||||
response_sender: GenericSender<Option<String>>,
|
||||
) {
|
||||
self.add_dialog(
|
||||
webview,
|
||||
|
@ -717,7 +717,7 @@ impl WebViewDelegate for RunningAppState {
|
|||
webview: servo::WebView,
|
||||
filter_pattern: Vec<FilterPattern>,
|
||||
allow_select_mutiple: bool,
|
||||
response_sender: IpcSender<Option<Vec<PathBuf>>>,
|
||||
response_sender: GenericSender<Option<Vec<PathBuf>>>,
|
||||
) {
|
||||
let file_dialog =
|
||||
Dialog::new_file_dialog(allow_select_mutiple, response_sender, filter_pattern);
|
||||
|
|
|
@ -9,7 +9,7 @@ use egui::Modal;
|
|||
use egui_file_dialog::{DialogState, FileDialog as EguiFileDialog};
|
||||
use euclid::Length;
|
||||
use log::warn;
|
||||
use servo::ipc_channel::ipc::IpcSender;
|
||||
use servo::base::generic_channel::GenericSender;
|
||||
use servo::servo_geometry::DeviceIndependentPixel;
|
||||
use servo::{
|
||||
AlertResponse, AuthenticationRequest, ColorPicker, ConfirmResponse, FilterPattern,
|
||||
|
@ -22,7 +22,7 @@ pub enum Dialog {
|
|||
File {
|
||||
dialog: EguiFileDialog,
|
||||
multiple: bool,
|
||||
response_sender: IpcSender<Option<Vec<PathBuf>>>,
|
||||
response_sender: GenericSender<Option<Vec<PathBuf>>>,
|
||||
},
|
||||
#[allow(clippy::enum_variant_names, reason = "spec terminology")]
|
||||
SimpleDialog(SimpleDialog),
|
||||
|
@ -38,7 +38,7 @@ pub enum Dialog {
|
|||
SelectDevice {
|
||||
devices: Vec<String>,
|
||||
selected_device_index: usize,
|
||||
response_sender: IpcSender<Option<String>>,
|
||||
response_sender: GenericSender<Option<String>>,
|
||||
},
|
||||
SelectElement {
|
||||
maybe_prompt: Option<SelectElement>,
|
||||
|
@ -54,7 +54,7 @@ pub enum Dialog {
|
|||
impl Dialog {
|
||||
pub fn new_file_dialog(
|
||||
multiple: bool,
|
||||
response_sender: IpcSender<Option<Vec<PathBuf>>>,
|
||||
response_sender: GenericSender<Option<Vec<PathBuf>>>,
|
||||
patterns: Vec<FilterPattern>,
|
||||
) -> Self {
|
||||
let mut dialog = EguiFileDialog::new();
|
||||
|
@ -106,7 +106,7 @@ impl Dialog {
|
|||
|
||||
pub fn new_device_selection_dialog(
|
||||
devices: Vec<String>,
|
||||
response_sender: IpcSender<Option<String>>,
|
||||
response_sender: GenericSender<Option<String>>,
|
||||
) -> Self {
|
||||
Dialog::SelectDevice {
|
||||
devices,
|
||||
|
|
|
@ -8,9 +8,9 @@ use std::rc::Rc;
|
|||
use crossbeam_channel::Receiver;
|
||||
use dpi::PhysicalSize;
|
||||
use embedder_traits::webdriver::WebDriverSenders;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use log::{debug, error, info, warn};
|
||||
use raw_window_handle::{RawWindowHandle, WindowHandle};
|
||||
use servo::base::generic_channel::GenericSender;
|
||||
use servo::base::id::WebViewId;
|
||||
use servo::euclid::{Point2D, Rect, Scale, Size2D, Vector2D};
|
||||
use servo::servo_geometry::DeviceIndependentPixel;
|
||||
|
@ -95,7 +95,7 @@ struct RunningAppStateInner {
|
|||
/// Modified by EmbedderMsg::WebViewFocused and EmbedderMsg::WebViewBlurred.
|
||||
focused_webview_id: Option<WebViewId>,
|
||||
|
||||
context_menu_sender: Option<IpcSender<ContextMenuResult>>,
|
||||
context_menu_sender: Option<GenericSender<ContextMenuResult>>,
|
||||
|
||||
/// Whether or not the animation state has changed. This is used to trigger
|
||||
/// host callbacks indicating that animation state has changed.
|
||||
|
@ -265,7 +265,7 @@ impl WebViewDelegate for RunningAppState {
|
|||
fn show_context_menu(
|
||||
&self,
|
||||
_webview: WebView,
|
||||
result_sender: IpcSender<ContextMenuResult>,
|
||||
result_sender: GenericSender<ContextMenuResult>,
|
||||
title: Option<String>,
|
||||
items: Vec<String>,
|
||||
) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue