diff options
Diffstat (limited to 'components/script/task_source/mod.rs')
-rw-r--r-- | components/script/task_source/mod.rs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/components/script/task_source/mod.rs b/components/script/task_source/mod.rs index ff41a63f118..3dbb753883e 100644 --- a/components/script/task_source/mod.rs +++ b/components/script/task_source/mod.rs @@ -10,16 +10,19 @@ pub mod performance_timeline; pub mod user_interaction; use dom::globalscope::GlobalScope; -use script_thread::{Runnable, RunnableWrapper}; +use script_thread::{Task, TaskCanceller}; use std::result::Result; pub trait TaskSource { - fn queue_with_wrapper<T>(&self, - msg: Box<T>, - wrapper: &RunnableWrapper) - -> Result<(), ()> - where T: Runnable + Send + 'static; - fn queue<T: Runnable + Send + 'static>(&self, msg: Box<T>, global: &GlobalScope) -> Result<(), ()> { - self.queue_with_wrapper(msg, &global.get_runnable_wrapper()) + fn queue_with_canceller<T>( + &self, + msg: Box<T>, + canceller: &TaskCanceller, + ) -> Result<(), ()> + where + T: Send + Task + 'static; + + fn queue<T: Task + Send + 'static>(&self, msg: Box<T>, global: &GlobalScope) -> Result<(), ()> { + self.queue_with_canceller(msg, &global.task_canceller()) } } |