mirror of
https://github.com/servo/servo.git
synced 2025-06-12 18:34:39 +00:00
Add name method to Runnable trait
This commit is contained in:
parent
d6f4dc06df
commit
54cf3afe30
2 changed files with 3 additions and 0 deletions
|
@ -181,6 +181,8 @@ impl StorageEventRunnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Runnable for StorageEventRunnable {
|
impl Runnable for StorageEventRunnable {
|
||||||
|
fn name(&self) -> &'static str { "StorageEventRunnable" }
|
||||||
|
|
||||||
fn main_thread_handler(self: Box<StorageEventRunnable>, script_thread: &ScriptThread) {
|
fn main_thread_handler(self: Box<StorageEventRunnable>, script_thread: &ScriptThread) {
|
||||||
let this = *self;
|
let this = *self;
|
||||||
let storage_root = this.element.root();
|
let storage_root = this.element.root();
|
||||||
|
|
|
@ -200,6 +200,7 @@ impl<T: Runnable + Send> Runnable for CancellableRunnable<T> {
|
||||||
|
|
||||||
pub trait Runnable {
|
pub trait Runnable {
|
||||||
fn is_cancelled(&self) -> bool { false }
|
fn is_cancelled(&self) -> bool { false }
|
||||||
|
fn name(&self) -> &'static str { "generic runnable" }
|
||||||
fn handler(self: Box<Self>) {}
|
fn handler(self: Box<Self>) {}
|
||||||
fn main_thread_handler(self: Box<Self>, _script_thread: &ScriptThread) { self.handler(); }
|
fn main_thread_handler(self: Box<Self>, _script_thread: &ScriptThread) { self.handler(); }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue