aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source/mod.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-09-16 02:09:26 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-09-16 15:43:26 +0200
commit56117d31856be46d7df417e659a4406305b4e258 (patch)
treec3a6b03f1bf9f3b9c8c1a2f67b0a8ac703f93d0a /components/script/task_source/mod.rs
parent52a6f63608a25e0574fd43b69f404f79a9a6c28f (diff)
downloadservo-56117d31856be46d7df417e659a4406305b4e258.tar.gz
servo-56117d31856be46d7df417e659a4406305b4e258.zip
Rename Runnable to Task
The changes are: * `*Runnable` -> `*Task`; * `RunnableMsg` -> `Task`; * `RunnableWrapper` -> `TaskCanceller`; * `MainThreadRunnable` -> `MainThreadTask`; * `wrap_runnable` -> `wrap_task`; * `get_runnable_wrapper` -> `task_canceller`; * `handler` -> `run`; * `main_thread_handler` -> `run_with_script_thread`.
Diffstat (limited to 'components/script/task_source/mod.rs')
-rw-r--r--components/script/task_source/mod.rs19
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())
}
}