diff options
author | Keith Yeung <kungfukeith11@gmail.com> | 2015-12-05 14:17:22 -0800 |
---|---|---|
committer | Keith Yeung <kungfukeith11@gmail.com> | 2015-12-06 12:12:14 -0800 |
commit | 8d90034d2917cc68a4d7e570b010fa60e8514b95 (patch) | |
tree | fb5bd9e20cbfd6c66956159ad814899c208a5979 /components/script/dom/bindings/global.rs | |
parent | 368dd1dc53cd595bbbcf6f9fb139e9ac573a351b (diff) | |
download | servo-8d90034d2917cc68a4d7e570b010fa60e8514b95.tar.gz servo-8d90034d2917cc68a4d7e570b010fa60e8514b95.zip |
Split fn script_chan into 5 different task channel fn
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(), } } |