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`.
This commit is contained in:
Anthony Ramine 2017-09-16 02:09:26 +02:00
parent 52a6f63608
commit 56117d3185
38 changed files with 370 additions and 332 deletions

View file

@ -20,7 +20,7 @@ use dom::node::Node;
use dom::virtualmethods::vtable_for;
use dom::window::Window;
use dom_struct::dom_struct;
use script_thread::Runnable;
use script_thread::Task;
use servo_atoms::Atom;
use std::cell::Cell;
use std::default::Default;
@ -381,15 +381,15 @@ pub enum EventStatus {
}
// https://dom.spec.whatwg.org/#concept-event-fire
pub struct EventRunnable {
pub struct EventTask {
pub target: Trusted<EventTarget>,
pub name: Atom,
pub bubbles: EventBubbles,
pub cancelable: EventCancelable,
}
impl Runnable for EventRunnable {
fn handler(self: Box<EventRunnable>) {
impl Task for EventTask {
fn run(self: Box<Self>) {
let target = self.target.root();
let bubbles = self.bubbles;
let cancelable = self.cancelable;
@ -398,13 +398,13 @@ impl Runnable for EventRunnable {
}
// https://html.spec.whatwg.org/multipage/#fire-a-simple-event
pub struct SimpleEventRunnable {
pub struct SimpleEventTask {
pub target: Trusted<EventTarget>,
pub name: Atom,
}
impl Runnable for SimpleEventRunnable {
fn handler(self: Box<SimpleEventRunnable>) {
impl Task for SimpleEventTask {
fn run(self: Box<Self>) {
let target = self.target.root();
target.fire_event(self.name);
}