aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo/lib.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-08-01 05:38:52 -0400
committerGitHub <noreply@github.com>2019-08-01 05:38:52 -0400
commit633bcf839eb11a6b48ef2777d086742ff011b709 (patch)
treecd5b9e63d02419517aadb9504f9c3d6b5cf963d5 /components/servo/lib.rs
parent45af8a34fe6cc6f304f935ababdbc90fb4c50ede (diff)
parent5ab40e991e2e5d7495d6561a064c559ee57775bd (diff)
downloadservo-633bcf839eb11a6b48ef2777d086742ff011b709.tar.gz
servo-633bcf839eb11a6b48ef2777d086742ff011b709.zip
Auto merge of #23902 - Manishearth:webxr-pref, r=asajeffrey
Do not start up webvr services when running webxr and vice versa Once we move everything over to the webxr crate we can relax the restriction around running both webxr and webvr r? @asajeffrey <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23902) <!-- Reviewable:end -->
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r--components/servo/lib.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index 75a8706ef71..9b4f108649b 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -381,16 +381,20 @@ where
// can't defer it after `create_constellation` has started.
script::init();
+ if pref!(dom.webxr.enabled) && pref!(dom.webvr.enabled) {
+ panic!("We don't currently support running both WebVR and WebXR");
+ }
+
// 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_main_thread = webxr_api::MainThreadRegistry::new(event_loop_waker)
.expect("Failed to create WebXR device registry");
- if pref!(dom.webvr.enabled) || pref!(dom.webxr.enabled) {
+ if pref!(dom.webxr.enabled) {
embedder.register_webxr(&mut webxr_main_thread);
}
let mut webvr_heartbeats = Vec::new();
- let webvr_services = if pref!(dom.webvr.enabled) || pref!(dom.webxr.enabled) {
+ let webvr_services = if pref!(dom.webvr.enabled) {
let mut services = VRServiceManager::new();
services.register_defaults();
embedder.register_vr_services(&mut services, &mut webvr_heartbeats);