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:
Martin Robinson 2025-04-09 16:19:33 +02:00 committed by GitHub
parent f8db2d2e86
commit 3b41a16fcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 9 additions and 28 deletions

View file

@ -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 }

View file

@ -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>,