Introduce GlobalScope::time_profiler_chan

This commit is contained in:
Anthony Ramine 2016-10-01 04:00:23 +02:00
parent bfa7d045d0
commit ae3763e7b3
5 changed files with 23 additions and 33 deletions

View file

@ -89,14 +89,6 @@ impl<'a> GlobalRef<'a> {
}
}
/// Get a `time::ProfilerChan` to send messages to the time profiler thread.
pub fn time_profiler_chan(&self) -> &time::ProfilerChan {
match *self {
GlobalRef::Window(window) => window.time_profiler_chan(),
GlobalRef::Worker(worker) => worker.time_profiler_chan(),
}
}
/// Get a `IpcSender` to send messages to the constellation when available.
pub fn constellation_chan(&self) -> &IpcSender<ConstellationMsg> {
match *self {
@ -214,7 +206,7 @@ impl<'a> GlobalRef<'a> {
time::profile(
time::ProfilerCategory::ScriptEvaluate,
Some(metadata),
self.time_profiler_chan().clone(),
self.as_global_scope().time_profiler_chan().clone(),
|| {
let cx = self.get_cx();
let globalhandle = self.reflector().get_jsobject();