Use webxr IPC to get a WebXR device registry to each script thread

This commit is contained in:
Alan Jeffrey 2019-07-02 12:34:58 -05:00
parent fee1418b43
commit 9eb75d4ea6
12 changed files with 148 additions and 35 deletions

View file

@ -287,7 +287,8 @@ where
// For the moment, we enable use both the webxr crate and the rust-webvr crate,
// but we are migrating over to just using webxr.
let mut webxr_registry = webxr_api::Registry::new();
let mut webxr_registry =
webxr_api::Registry::new().expect("Failed to create WebXR device registry");
if pref!(dom.webvr.enabled) || pref!(dom.webxr.enabled) {
embedder.register_webxr(&mut webxr_registry);
}
@ -319,6 +320,7 @@ where
webrender_api_sender,
window.gl(),
webvr_services,
webxr_registry,
);
// Send the constellation's swmanager sender to service worker manager thread
@ -628,6 +630,7 @@ fn create_constellation(
webrender_api_sender: webrender_api::RenderApiSender,
window_gl: Rc<dyn gl::Gl>,
webvr_services: Option<VRServiceManager>,
webxr_registry: webxr_api::Registry,
) -> (Sender<ConstellationMsg>, SWManagerSenders) {
// Global configuration options, parsed from the command line.
let opts = opts::get();
@ -708,6 +711,7 @@ fn create_constellation(
webrender_api_sender,
webgl_threads,
webvr_chan,
webxr_registry,
};
let (constellation_chan, from_swmanager_sender) = Constellation::<
script_layout_interface::message::Msg,