mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Move boxing to runnable initialization
This commit is contained in:
parent
5f7324a9a5
commit
ad30275d04
10 changed files with 20 additions and 20 deletions
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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<(), ()>;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue