mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
* Remove type parameter from Servo and IOCompositor (#35121) Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com> * Fix compile error in libservo example Signed-off-by: Delan Azabani <dazabani@igalia.com> * Fix compile error in servoshell Signed-off-by: Delan Azabani <dazabani@igalia.com> --------- Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
b95fa5ddd6
commit
8976f2420c
5 changed files with 28 additions and 21 deletions
|
@ -97,9 +97,9 @@ impl FrameTreeId {
|
|||
}
|
||||
|
||||
/// NB: Never block on the constellation, because sometimes the constellation blocks on us.
|
||||
pub struct IOCompositor<Window: WindowMethods + ?Sized> {
|
||||
pub struct IOCompositor {
|
||||
/// The application window.
|
||||
pub window: Rc<Window>,
|
||||
pub window: Rc<dyn WindowMethods>,
|
||||
|
||||
/// The port on which we receive messages.
|
||||
port: CompositorReceiver,
|
||||
|
@ -356,9 +356,9 @@ pub enum CompositeTarget {
|
|||
PngFile(Rc<String>),
|
||||
}
|
||||
|
||||
impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
||||
impl IOCompositor {
|
||||
pub fn new(
|
||||
window: Rc<Window>,
|
||||
window: Rc<dyn WindowMethods>,
|
||||
state: InitialCompositorState,
|
||||
composite_target: CompositeTarget,
|
||||
exit_after_load: bool,
|
||||
|
|
|
@ -44,7 +44,7 @@ enum App {
|
|||
Initial(Waker),
|
||||
Running {
|
||||
window_delegate: Rc<WindowDelegate>,
|
||||
servo: Servo<WindowDelegate>,
|
||||
servo: Servo,
|
||||
},
|
||||
Exiting,
|
||||
}
|
||||
|
|
|
@ -176,8 +176,8 @@ mod media_platform {
|
|||
/// application Servo is embedded in. Clients then create an event
|
||||
/// loop to pump messages between the embedding application and
|
||||
/// various browser components.
|
||||
pub struct Servo<Window: WindowMethods + 'static + ?Sized> {
|
||||
compositor: IOCompositor<Window>,
|
||||
pub struct Servo {
|
||||
compositor: IOCompositor,
|
||||
constellation_chan: Sender<ConstellationMsg>,
|
||||
embedder_receiver: EmbedderReceiver,
|
||||
messages_for_embedder: Vec<(Option<TopLevelBrowsingContextId>, EmbedderMsg)>,
|
||||
|
@ -221,10 +221,7 @@ impl webrender_api::RenderNotifier for RenderNotifier {
|
|||
}
|
||||
}
|
||||
|
||||
impl<Window> Servo<Window>
|
||||
where
|
||||
Window: WindowMethods + 'static + ?Sized,
|
||||
{
|
||||
impl Servo {
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(
|
||||
|
@ -233,16 +230,15 @@ where
|
|||
level = "trace",
|
||||
)
|
||||
)]
|
||||
#[allow(clippy::new_ret_no_self)]
|
||||
pub fn new(
|
||||
opts: Opts,
|
||||
preferences: Preferences,
|
||||
rendering_context: Rc<dyn RenderingContext>,
|
||||
mut embedder: Box<dyn EmbedderMethods>,
|
||||
window: Rc<Window>,
|
||||
window: Rc<dyn WindowMethods>,
|
||||
user_agent: Option<String>,
|
||||
composite_target: CompositeTarget,
|
||||
) -> Servo<Window> {
|
||||
) -> Self {
|
||||
// Global configuration options, parsed from the command line.
|
||||
opts::set_options(opts);
|
||||
let opts = opts::get();
|
||||
|
@ -982,7 +978,7 @@ where
|
|||
log::set_max_level(filter);
|
||||
}
|
||||
|
||||
pub fn window(&self) -> &Window {
|
||||
pub fn window(&self) -> &Rc<dyn WindowMethods> {
|
||||
&self.compositor.window
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue