added time to interactive metrics, refactored metrics to use traits

changed task macro to take pipeline info
This commit is contained in:
ddh 2017-10-02 14:52:39 +01:00
parent 347176df25
commit 2ffbe53989
26 changed files with 730 additions and 138 deletions

View file

@ -304,6 +304,11 @@ impl Window {
}
}
/// Get a sender to the time profiler thread.
pub fn time_profiler_chan(&self) -> &TimeProfilerChan {
self.globalscope.time_profiler_chan()
}
pub fn origin(&self) -> &MutableOrigin {
self.globalscope.origin()
}
@ -1040,6 +1045,10 @@ impl Window {
}
}
pub fn get_navigation_start(&self) -> f64 {
self.navigation_start_precise.get()
}
/// Cancels all the tasks associated with that window.
///
/// This sets the current `ignore_further_async_events` sentinel value to
@ -1854,6 +1863,10 @@ impl Window {
WindowBinding::Wrap(runtime.cx(), win)
}
}
pub fn pipeline_id(&self) -> Option<PipelineId> {
Some(self.upcast::<GlobalScope>().pipeline_id())
}
}
fn should_move_clip_rect(clip_rect: Rect<Au>, new_viewport: Rect<f32>) -> bool {
@ -1962,6 +1975,7 @@ impl Window {
let _ = self.script_chan.send(CommonScriptMsg::Task(
ScriptThreadEventCategory::DomEvent,
Box::new(self.task_canceller().wrap_task(task)),
self.pipeline_id()
));
}
}