Reduce channel cloning.

This commit is contained in:
Ms2ger 2016-04-29 14:55:38 +02:00
parent 207be7d2e2
commit 897be5f6ee
13 changed files with 38 additions and 38 deletions

View file

@ -74,7 +74,7 @@ impl<'a> GlobalRef<'a> {
}
/// Get a `mem::ProfilerChan` to send messages to the memory profiler thread.
pub fn mem_profiler_chan(&self) -> mem::ProfilerChan {
pub fn mem_profiler_chan(&self) -> &mem::ProfilerChan {
match *self {
GlobalRef::Window(window) => window.mem_profiler_chan(),
GlobalRef::Worker(worker) => worker.mem_profiler_chan(),
@ -82,7 +82,7 @@ impl<'a> GlobalRef<'a> {
}
/// Get a `ConstellationChan` to send messages to the constellation channel when available.
pub fn constellation_chan(&self) -> ConstellationChan<ConstellationMsg> {
pub fn constellation_chan(&self) -> &ConstellationChan<ConstellationMsg> {
match *self {
GlobalRef::Window(window) => window.constellation_chan(),
GlobalRef::Worker(worker) => worker.constellation_chan(),
@ -90,7 +90,7 @@ impl<'a> GlobalRef<'a> {
}
/// Get the scheduler channel to request timer events.
pub fn scheduler_chan(&self) -> IpcSender<TimerEventRequest> {
pub fn scheduler_chan(&self) -> &IpcSender<TimerEventRequest> {
match *self {
GlobalRef::Window(window) => window.scheduler_chan(),
GlobalRef::Worker(worker) => worker.scheduler_chan(),