Introduce GlobalScope::constellation_chan

This commit is contained in:
Anthony Ramine 2016-10-01 04:15:47 +02:00
parent ae3763e7b3
commit f789e73fd2
14 changed files with 79 additions and 60 deletions

View file

@ -30,7 +30,7 @@ use profile_traits::time;
use script_runtime::{CommonScriptMsg, EnqueuedPromiseCallback, ScriptChan};
use script_runtime::{ScriptPort, maybe_take_panic_result};
use script_thread::{MainThreadScriptChan, RunnableWrapper, ScriptThread};
use script_traits::{MsDuration, ScriptMsg as ConstellationMsg, TimerEventRequest};
use script_traits::{MsDuration, TimerEventRequest};
use std::ffi::CString;
use std::panic;
use task_source::file_reading::FileReadingTaskSource;
@ -89,14 +89,6 @@ impl<'a> GlobalRef<'a> {
}
}
/// Get a `IpcSender` to send messages to the constellation when available.
pub fn constellation_chan(&self) -> &IpcSender<ConstellationMsg> {
match *self {
GlobalRef::Window(window) => window.constellation_chan(),
GlobalRef::Worker(worker) => worker.constellation_chan(),
}
}
/// Get the scheduler channel to request timer events.
pub fn scheduler_chan(&self) -> &IpcSender<TimerEventRequest> {
match *self {