Remove WebVR

This commit is contained in:
Alan Jeffrey 2020-04-07 16:05:36 -05:00
parent d8781c1054
commit c611e46381
74 changed files with 97 additions and 3178 deletions

View file

@ -43,7 +43,6 @@ servo_rand = {path = "../rand"}
servo_remutex = {path = "../remutex"}
servo_url = {path = "../url"}
webgpu = {path = "../webgpu"}
webvr_traits = {path = "../webvr_traits"}
webrender_api = {git = "https://github.com/servo/webrender"}
webxr-api = {git = "https://github.com/servo/webxr", features = ["ipc"]}

View file

@ -179,7 +179,6 @@ use std::thread;
use style_traits::viewport::ViewportConstraints;
use style_traits::CSSPixel;
use webgpu::{WebGPU, WebGPURequest};
use webvr_traits::{WebVREvent, WebVRMsg};
type PendingApprovalNavigations = HashMap<PipelineId, (LoadData, HistoryEntryReplacement)>;
@ -463,9 +462,6 @@ pub struct Constellation<Message, LTF, STF, SWF> {
/// Entry point to create and get channels to a WebGLThread.
webgl_threads: Option<WebGLThreads>,
/// A channel through which messages can be sent to the webvr thread.
webvr_chan: Option<IpcSender<WebVRMsg>>,
/// The XR device registry
webxr_registry: webxr_api::Registry,
@ -549,9 +545,6 @@ pub struct InitialConstellationState {
/// Entry point to create and get channels to a WebGLThread.
pub webgl_threads: Option<WebGLThreads>,
/// A channel to the webgl thread.
pub webvr_chan: Option<IpcSender<WebVRMsg>>,
/// The XR device registry
pub webxr_registry: webxr_api::Registry,
@ -1014,7 +1007,6 @@ where
(rng, prob)
}),
webgl_threads: state.webgl_threads,
webvr_chan: state.webvr_chan,
webxr_registry: state.webxr_registry,
canvas_chan,
ipc_canvas_chan,
@ -1271,7 +1263,6 @@ where
.webgl_threads
.as_ref()
.map(|threads| threads.pipeline()),
webvr_chan: self.webvr_chan.clone(),
webxr_registry: self.webxr_registry.clone(),
player_context: self.player_context.clone(),
event_loop_waker: self.event_loop_waker.as_ref().map(|w| (*w).clone_box()),
@ -1704,9 +1695,6 @@ where
FromCompositorMsg::LogEntry(top_level_browsing_context_id, thread_name, entry) => {
self.handle_log_entry(top_level_browsing_context_id, thread_name, entry);
},
FromCompositorMsg::WebVREvents(pipeline_ids, events) => {
self.handle_webvr_events(pipeline_ids, events);
},
FromCompositorMsg::ForwardEvent(destination_pipeline_id, event) => {
self.forward_event(destination_pipeline_id, event);
},
@ -2839,13 +2827,6 @@ where
}
}
if let Some(chan) = self.webvr_chan.as_ref() {
debug!("Exiting WebVR thread.");
if let Err(e) = chan.send(WebVRMsg::Exit) {
warn!("Exit WebVR thread failed ({})", e);
}
}
debug!("Exiting GLPlayer thread.");
if let Some(glplayer_threads) = self.glplayer_threads.as_ref() {
if let Err(e) = glplayer_threads.exit() {
@ -2993,20 +2974,6 @@ where
}
}
fn handle_webvr_events(&mut self, ids: Vec<PipelineId>, events: Vec<WebVREvent>) {
for id in ids {
match self.pipelines.get_mut(&id) {
Some(ref pipeline) => {
// Notify script thread
let _ = pipeline
.event_loop
.send(ConstellationControlMsg::WebVREvents(id, events.clone()));
},
None => warn!("constellation got webvr event for dead pipeline"),
}
}
}
fn forward_event(&mut self, destination_pipeline_id: PipelineId, event: CompositorEvent) {
if let MouseButtonEvent(event_type, button, ..) = &event {
match event_type {

View file

@ -46,7 +46,6 @@ use std::collections::{HashMap, HashSet};
use std::rc::Rc;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use webvr_traits::WebVRMsg;
/// A `Pipeline` is the constellation's view of a `Document`. Each pipeline has an
/// event loop (executed by a script thread) and a layout thread. A script thread
@ -191,9 +190,6 @@ pub struct InitialPipelineState {
/// A channel to the WebGL thread.
pub webgl_chan: Option<WebGLPipeline>,
/// A channel to the webvr thread.
pub webvr_chan: Option<IpcSender<WebVRMsg>>,
/// The XR device registry
pub webxr_registry: webxr_api::Registry,
@ -305,7 +301,6 @@ impl Pipeline {
webrender_image_api_sender: state.webrender_image_api_sender,
webrender_document: state.webrender_document,
webgl_chan: state.webgl_chan,
webvr_chan: state.webvr_chan,
webxr_registry: state.webxr_registry,
player_context: state.player_context,
user_agent: state.user_agent,
@ -522,7 +517,6 @@ pub struct UnprivilegedPipelineContent {
webrender_image_api_sender: net_traits::WebrenderIpcSender,
webrender_document: webrender_api::DocumentId,
webgl_chan: Option<WebGLPipeline>,
webvr_chan: Option<IpcSender<WebVRMsg>>,
webxr_registry: webxr_api::Registry,
player_context: WindowGLContext,
user_agent: Cow<'static, str>,
@ -575,7 +569,6 @@ impl UnprivilegedPipelineContent {
pipeline_namespace_id: self.pipeline_namespace_id,
content_process_shutdown_chan: content_process_shutdown_chan,
webgl_chan: self.webgl_chan,
webvr_chan: self.webvr_chan,
webxr_registry: self.webxr_registry,
webrender_document: self.webrender_document,
webrender_api_sender: self.webrender_api_sender.clone(),