mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
libservo: Move EventLooperWaker
from webxr_traits
to embedder_traits
(#36420)
Now that `webxr` is integrated into the Servo directory, `webxr` can depend on `embedder_traits` instead of having it re-export this type conditionally (and sometimes duplicating it). Testing: This just moves a data type, so no tests are necessary. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
f8db2d2e86
commit
3b41a16fcf
7 changed files with 9 additions and 28 deletions
|
@ -11,9 +11,6 @@ rust-version.workspace = true
|
|||
name = "embedder_traits"
|
||||
path = "lib.rs"
|
||||
|
||||
[features]
|
||||
webxr = ["dep:webxr-api"]
|
||||
|
||||
[dependencies]
|
||||
base = { workspace = true }
|
||||
cfg-if = { workspace = true }
|
||||
|
@ -37,4 +34,3 @@ stylo_traits = { workspace = true }
|
|||
url = { workspace = true }
|
||||
webdriver = { workspace = true }
|
||||
webrender_api = { workspace = true }
|
||||
webxr-api = { workspace = true, features = ["ipc"], optional = true }
|
||||
|
|
|
@ -90,21 +90,16 @@ pub enum Cursor {
|
|||
ZoomOut,
|
||||
}
|
||||
|
||||
#[cfg(feature = "webxr")]
|
||||
pub use webxr_api::MainThreadWaker as EventLoopWaker;
|
||||
#[cfg(not(feature = "webxr"))]
|
||||
pub trait EventLoopWaker: 'static + Send {
|
||||
fn clone_box(&self) -> Box<dyn EventLoopWaker>;
|
||||
fn wake(&self);
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "webxr"))]
|
||||
impl Clone for Box<dyn EventLoopWaker> {
|
||||
fn clone(&self) -> Self {
|
||||
EventLoopWaker::clone_box(self.as_ref())
|
||||
self.clone_box()
|
||||
}
|
||||
}
|
||||
|
||||
/// Sends messages to the embedder.
|
||||
pub struct EmbedderProxy {
|
||||
pub sender: Sender<EmbedderMsg>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue