Introduce GlobalScope::mem_profiler_chan

This commit is contained in:
Anthony Ramine 2016-10-01 03:53:20 +02:00
parent fe6fca9e1f
commit bfa7d045d0
6 changed files with 24 additions and 32 deletions

View file

@ -26,7 +26,7 @@ use js::rust::CompileOptionsWrapper;
use libc;
use msg::constellation_msg::PipelineId;
use net_traits::{CoreResourceThread, IpcSend, ResourceThreads};
use profile_traits::{mem, time};
use profile_traits::time;
use script_runtime::{CommonScriptMsg, EnqueuedPromiseCallback, ScriptChan};
use script_runtime::{ScriptPort, maybe_take_panic_result};
use script_thread::{MainThreadScriptChan, RunnableWrapper, ScriptThread};
@ -89,14 +89,6 @@ impl<'a> GlobalRef<'a> {
}
}
/// Get a `mem::ProfilerChan` to send messages to the memory profiler thread.
pub fn mem_profiler_chan(&self) -> &mem::ProfilerChan {
match *self {
GlobalRef::Window(window) => window.mem_profiler_chan(),
GlobalRef::Worker(worker) => worker.mem_profiler_chan(),
}
}
/// Get a `time::ProfilerChan` to send messages to the time profiler thread.
pub fn time_profiler_chan(&self) -> &time::ProfilerChan {
match *self {