aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-09-08 10:03:35 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-09-08 10:06:18 +0200
commit9252f2b8a2b310993530b083d1ee321a34804f09 (patch)
tree7f76bc3b9649fefb205a4f7e357fab2d71cba329 /components/script/task_source
parentdfc38fabdcac0e027db3dc5425899004309fc68b (diff)
downloadservo-9252f2b8a2b310993530b083d1ee321a34804f09.tar.gz
servo-9252f2b8a2b310993530b083d1ee321a34804f09.zip
Kill DOMManipulationTask
Just use a bare Runnable value.
Diffstat (limited to 'components/script/task_source')
-rw-r--r--components/script/task_source/dom_manipulation.rs24
1 files changed, 7 insertions, 17 deletions
diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs
index 2ba5e297ade..18721539693 100644
--- a/components/script/task_source/dom_manipulation.rs
+++ b/components/script/task_source/dom_manipulation.rs
@@ -7,7 +7,8 @@ use dom::bindings::refcounted::Trusted;
use dom::event::{EventBubbles, EventCancelable, EventRunnable, SimpleEventRunnable};
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 DOMManipulationTaskSource {
wrapper: &RunnableWrapper)
-> Result<(), ()>
where T: Runnable + Send + 'static {
- let msg = DOMManipulationTask(wrapper.wrap_runnable(msg));
- self.0.send(MainThreadScriptMsg::DOMManipulation(msg)).map_err(|_| ())
+ let msg = MainThreadScriptMsg::Common(CommonScriptMsg::RunnableMsg(
+ ScriptThreadEventCategory::ScriptEvent,
+ wrapper.wrap_runnable(msg),
+ ));
+ self.0.send(msg).map_err(|_| ())
}
}
@@ -60,17 +64,3 @@ impl DOMManipulationTaskSource {
let _ = self.queue(runnable, window.upcast());
}
}
-
-pub struct DOMManipulationTask(pub Box<Runnable + Send>);
-
-impl fmt::Debug for DOMManipulationTask {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "DOMManipulationTask(...)")
- }
-}
-
-impl DOMManipulationTask {
- pub fn handle_task(self, script_thread: &ScriptThread) {
- self.0.main_thread_handler(script_thread);
- }
-}