Implements profiler for blocked recv

This commit is contained in:
Nakul Jindal 2018-02-26 09:07:08 -08:00
parent 563f0ec824
commit 7d4e2b11e9
27 changed files with 176 additions and 58 deletions

View file

@ -31,7 +31,8 @@ use dom::vrpose::VRPose;
use dom::vrstageparameters::VRStageParameters;
use dom::webglrenderingcontext::WebGLRenderingContext;
use dom_struct::dom_struct;
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::ipc::IpcSender;
use profile_traits::ipc;
use script_runtime::CommonScriptMsg;
use script_runtime::ScriptThreadEventCategory::WebVREvent;
use std::cell::Cell;
@ -191,7 +192,7 @@ impl VRDisplayMethods for VRDisplay {
}
// If not presenting we fetch inmediante VRFrameData
let (sender, receiver) = ipc::channel().unwrap();
let (sender, receiver) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();
self.webvr_thread().send(WebVRMsg::GetFrameData(self.global().pipeline_id(),
self.DisplayId(),
self.depth_near.get(),
@ -216,7 +217,7 @@ impl VRDisplayMethods for VRDisplay {
// https://w3c.github.io/webvr/#dom-vrdisplay-resetpose
fn ResetPose(&self) {
let (sender, receiver) = ipc::channel().unwrap();
let (sender, receiver) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();
self.webvr_thread().send(WebVRMsg::ResetPose(self.global().pipeline_id(),
self.DisplayId(),
sender)).unwrap();
@ -324,7 +325,7 @@ impl VRDisplayMethods for VRDisplay {
}
// Request Present
let (sender, receiver) = ipc::channel().unwrap();
let (sender, receiver) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();
self.webvr_thread().send(WebVRMsg::RequestPresent(self.global().pipeline_id(),
self.display.borrow().display_id,
sender))
@ -357,7 +358,7 @@ impl VRDisplayMethods for VRDisplay {
}
// Exit present
let (sender, receiver) = ipc::channel().unwrap();
let (sender, receiver) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();
self.webvr_thread().send(WebVRMsg::ExitPresent(self.global().pipeline_id(),
self.display.borrow().display_id,
Some(sender)))