diff options
Diffstat (limited to 'components/script/dom/bindings/global.rs')
-rw-r--r-- | components/script/dom/bindings/global.rs | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index 6580b320a97..6f5bc6c58ef 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -155,9 +155,45 @@ 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> { + pub fn dom_manipulation_task_source(&self) -> Box<ScriptChan + Send> { match *self { - GlobalRef::Window(ref window) => window.script_chan(), + GlobalRef::Window(ref window) => window.dom_manipulation_task_source(), + GlobalRef::Worker(ref worker) => worker.script_chan(), + } + } + + /// `ScriptChan` used to send messages to the event loop of this global's + /// thread. + pub fn user_interaction_task_source(&self) -> Box<ScriptChan + Send> { + match *self { + GlobalRef::Window(ref window) => window.user_interaction_task_source(), + 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> { + match *self { + GlobalRef::Window(ref window) => window.networking_task_source(), + GlobalRef::Worker(ref worker) => worker.script_chan(), + } + } + + /// `ScriptChan` used to send messages to the event loop of this global's + /// thread. + pub fn history_traversal_task_source(&self) -> Box<ScriptChan + Send> { + match *self { + GlobalRef::Window(ref window) => window.history_traversal_task_source(), + GlobalRef::Worker(ref worker) => worker.script_chan(), + } + } + + /// `ScriptChan` used to send messages to the event loop of this global's + /// thread. + pub fn file_reading_task_source(&self) -> Box<ScriptChan + Send> { + match *self { + GlobalRef::Window(ref window) => window.file_reading_task_source(), GlobalRef::Worker(ref worker) => worker.script_chan(), } } |