diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-08 10:03:35 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-08 10:17:23 +0200 |
commit | 35a725225468631517b993afbcde4f58c88288c6 (patch) | |
tree | b974cda2ed97e2008cb6da59aaf054b389f4ec27 /components/script/task_source | |
parent | 9252f2b8a2b310993530b083d1ee321a34804f09 (diff) | |
download | servo-35a725225468631517b993afbcde4f58c88288c6.tar.gz servo-35a725225468631517b993afbcde4f58c88288c6.zip |
Kill UserInteractionTask
Just use a bare Runnable value.
Diffstat (limited to 'components/script/task_source')
-rw-r--r-- | components/script/task_source/user_interaction.rs | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/components/script/task_source/user_interaction.rs b/components/script/task_source/user_interaction.rs index 1969ee0a41a..753c090df9e 100644 --- a/components/script/task_source/user_interaction.rs +++ b/components/script/task_source/user_interaction.rs @@ -7,7 +7,8 @@ use dom::bindings::refcounted::Trusted; use dom::event::{EventBubbles, EventCancelable, EventRunnable}; use dom::eventtarget::EventTarget; use dom::window::Window; -use script_thread::{MainThreadScriptMsg, Runnable, RunnableWrapper, ScriptThread}; +use script_runtime::{CommonScriptMsg, ScriptThreadEventCategory}; +use script_thread::{MainThreadScriptMsg, Runnable, RunnableWrapper}; use servo_atoms::Atom; use std::fmt; use std::result::Result; @@ -29,8 +30,11 @@ impl TaskSource for UserInteractionTaskSource { wrapper: &RunnableWrapper) -> Result<(), ()> where T: Runnable + Send + 'static { - let msg = UserInteractionTask(wrapper.wrap_runnable(msg)); - self.0.send(MainThreadScriptMsg::UserInteraction(msg)).map_err(|_| ()) + let msg = MainThreadScriptMsg::Common(CommonScriptMsg::RunnableMsg( + ScriptThreadEventCategory::InputEvent, + wrapper.wrap_runnable(msg), + )); + self.0.send(msg).map_err(|_| ()) } } @@ -51,17 +55,3 @@ impl UserInteractionTaskSource { let _ = self.queue(runnable, window.upcast()); } } - -pub struct UserInteractionTask(pub Box<Runnable + Send>); - -impl fmt::Debug for UserInteractionTask { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "UserInteractionTask(...)") - } -} - -impl UserInteractionTask { - pub fn handle_task(self, script_thread: &ScriptThread) { - self.0.main_thread_handler(script_thread); - } -} |