From d6f4dc06df4412d7fd58170914c941e34c5c799b Mon Sep 17 00:00:00 2001 From: Connor Brewster Date: Wed, 6 Jul 2016 10:46:39 -0600 Subject: Combined DOMManipulationTask runnable variants into a single variant --- components/script/script_thread.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'components/script/script_thread.rs') diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 05689baac39..788a40532aa 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -200,11 +200,8 @@ impl Runnable for CancellableRunnable { pub trait Runnable { fn is_cancelled(&self) -> bool { false } - fn handler(self: Box); -} - -pub trait MainThreadRunnable { - fn handler(self: Box, script_thread: &ScriptThread); + fn handler(self: Box) {} + fn main_thread_handler(self: Box, _script_thread: &ScriptThread) { self.handler(); } } enum MixedMessage { @@ -1223,7 +1220,7 @@ impl ScriptThread { // https://html.spec.whatwg.org/multipage/#the-end step 7 let handler = box DocumentProgressHandler::new(Trusted::new(doc)); - self.dom_manipulation_task_source.queue(DOMManipulationTask::DocumentProgress(handler)).unwrap(); + self.dom_manipulation_task_source.queue(DOMManipulationTask::Runnable(handler)).unwrap(); self.constellation_chan.send(ConstellationMsg::LoadComplete(pipeline)).unwrap(); } -- cgit v1.2.3 From 54cf3afe3022b1aa7e01ac6c33383d1bb810bb20 Mon Sep 17 00:00:00 2001 From: Connor Brewster Date: Wed, 6 Jul 2016 10:47:23 -0600 Subject: Add name method to Runnable trait --- components/script/script_thread.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'components/script/script_thread.rs') diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 788a40532aa..8a7fc82f52e 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -200,6 +200,7 @@ impl Runnable for CancellableRunnable { pub trait Runnable { fn is_cancelled(&self) -> bool { false } + fn name(&self) -> &'static str { "generic runnable" } fn handler(self: Box) {} fn main_thread_handler(self: Box, _script_thread: &ScriptThread) { self.handler(); } } -- cgit v1.2.3