mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Introduce GlobalScope::script_chan
This commit is contained in:
parent
71236e168a
commit
a7305b7fc4
4 changed files with 19 additions and 14 deletions
|
@ -25,7 +25,7 @@ use libc;
|
|||
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_thread::{RunnableWrapper, ScriptThread};
|
||||
use script_traits::MsDuration;
|
||||
use std::ffi::CString;
|
||||
use std::panic;
|
||||
|
@ -67,16 +67,6 @@ impl<'a> GlobalRef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// `ScriptChan` used to send messages to the event loop of this global's
|
||||
/// thread.
|
||||
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) =>
|
||||
MainThreadScriptChan(window.main_thread_script_chan().clone()).clone(),
|
||||
GlobalRef::Worker(ref worker) => worker.script_chan(),
|
||||
}
|
||||
}
|
||||
|
||||
/// `ScriptChan` used to send messages to the event loop of this global's
|
||||
/// thread.
|
||||
pub fn networking_task_source(&self) -> Box<ScriptChan + Send> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue