aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source
diff options
context:
space:
mode:
authorConnor Brewster <connor.brewster@eagles.oc.edu>2016-07-13 11:10:13 -0600
committerConnor Brewster <connor.brewster@eagles.oc.edu>2016-07-13 11:10:23 -0600
commitad30275d04d9d814da86f985d252f2b78fccfcd0 (patch)
treecde94d268b32a2b5ff9f51f93c062829c5b97bd8 /components/script/task_source
parent5f7324a9a5fbc5ecf8a348a5e9e238aacfd6f3d9 (diff)
downloadservo-ad30275d04d9d814da86f985d252f2b78fccfcd0.tar.gz
servo-ad30275d04d9d814da86f985d252f2b78fccfcd0.zip
Move boxing to runnable initialization
Diffstat (limited to 'components/script/task_source')
-rw-r--r--components/script/task_source/dom_manipulation.rs6
-rw-r--r--components/script/task_source/mod.rs2
-rw-r--r--components/script/task_source/user_interaction.rs4
3 files changed, 6 insertions, 6 deletions
diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs
index 5deef052c3e..b8bad662353 100644
--- a/components/script/task_source/dom_manipulation.rs
+++ b/components/script/task_source/dom_manipulation.rs
@@ -16,7 +16,7 @@ use task_source::TaskSource;
pub struct DOMManipulationTaskSource(pub Sender<MainThreadScriptMsg>);
impl TaskSource for DOMManipulationTaskSource {
- fn queue<T: Runnable + Send + 'static>(&self, msg: T, window: &Window) -> Result<(), ()> {
+ fn queue<T: Runnable + Send + 'static>(&self, msg: Box<T>, window: &Window) -> Result<(), ()> {
let msg = DOMManipulationTask(window.get_runnable_wrapper().wrap_runnable(msg));
self.0.send(MainThreadScriptMsg::DOMManipulation(msg)).map_err(|_| ())
}
@@ -30,7 +30,7 @@ impl DOMManipulationTaskSource {
cancelable: EventCancelable,
window: &Window) {
let target = Trusted::new(target);
- let runnable = EventRunnable {
+ let runnable = box EventRunnable {
target: target,
name: name,
bubbles: bubbles,
@@ -41,7 +41,7 @@ impl DOMManipulationTaskSource {
pub fn queue_simple_event(&self, target: &EventTarget, name: Atom, window: &Window) {
let target = Trusted::new(target);
- let runnable = SimpleEventRunnable {
+ let runnable = box SimpleEventRunnable {
target: target,
name: name,
};
diff --git a/components/script/task_source/mod.rs b/components/script/task_source/mod.rs
index 393a358fadb..48fc775d959 100644
--- a/components/script/task_source/mod.rs
+++ b/components/script/task_source/mod.rs
@@ -13,5 +13,5 @@ use script_thread::Runnable;
use std::result::Result;
pub trait TaskSource {
- fn queue<T: Runnable + Send + 'static>(&self, msg: T, window: &Window) -> Result<(), ()>;
+ fn queue<T: Runnable + Send + 'static>(&self, msg: Box<T>, window: &Window) -> Result<(), ()>;
}
diff --git a/components/script/task_source/user_interaction.rs b/components/script/task_source/user_interaction.rs
index 7bd8f58b006..2f4c0923801 100644
--- a/components/script/task_source/user_interaction.rs
+++ b/components/script/task_source/user_interaction.rs
@@ -16,7 +16,7 @@ use task_source::TaskSource;
pub struct UserInteractionTaskSource(pub Sender<MainThreadScriptMsg>);
impl TaskSource for UserInteractionTaskSource {
- fn queue<T: Runnable + Send + 'static>(&self, msg: T, window: &Window) -> Result<(), ()> {
+ fn queue<T: Runnable + Send + 'static>(&self, msg: Box<T>, window: &Window) -> Result<(), ()> {
let msg = UserInteractionTask(window.get_runnable_wrapper().wrap_runnable(msg));
self.0.send(MainThreadScriptMsg::UserInteraction(msg)).map_err(|_| ())
}
@@ -30,7 +30,7 @@ impl UserInteractionTaskSource {
cancelable: EventCancelable,
window: &Window) {
let target = Trusted::new(target);
- let runnable = EventRunnable {
+ let runnable = box EventRunnable {
target: target,
name: name,
bubbles: bubbles,