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

@ -33,7 +33,7 @@ use js::rust::Runtime;
use net_traits::{IpcSend, load_whole_resource};
use net_traits::request::{CredentialsMode, Destination, RequestInit as NetRequestInit, Type as RequestType};
use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort, get_reports};
use script_thread::RunnableWrapper;
use script_thread::TaskCanceller;
use script_traits::{TimerEvent, TimerEventId};
use script_traits::WorkerGlobalScopeInit;
use servo_url::{MutableOrigin, ServoUrl};
@ -161,8 +161,8 @@ impl WorkerGlobalScope {
self.worker_id.clone()
}
pub fn get_runnable_wrapper(&self) -> RunnableWrapper {
RunnableWrapper {
pub fn task_canceller(&self) -> TaskCanceller {
TaskCanceller {
cancelled: self.closing.clone(),
}
}
@ -387,8 +387,8 @@ impl WorkerGlobalScope {
pub fn process_event(&self, msg: CommonScriptMsg) {
match msg {
CommonScriptMsg::RunnableMsg(_, runnable) => {
runnable.handler()
CommonScriptMsg::Task(_, task) => {
task.run()
},
CommonScriptMsg::CollectReports(reports_chan) => {
let cx = self.get_cx();