Introduce TaskOnce

Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing
from CancellableTask<T>.
This commit is contained in:
Anthony Ramine 2017-09-20 10:37:09 +02:00
parent 52527d6f9d
commit 6c9fb5ae7a
26 changed files with 144 additions and 124 deletions

View file

@ -154,7 +154,7 @@ impl HTMLMediaElement {
let target = Trusted::new(self.upcast::<EventTarget>());
// FIXME(nox): Why are errors silenced here?
let _ = window.dom_manipulation_task_source().queue(
box task!(internal_pause_steps: move || {
task!(internal_pause_steps: move || {
let target = target.root();
// Step 2.3.1.
@ -186,7 +186,7 @@ impl HTMLMediaElement {
let window = window_from_node(self);
// FIXME(nox): Why are errors silenced here?
let _ = window.dom_manipulation_task_source().queue(
box task!(notify_about_playing: move || {
task!(notify_about_playing: move || {
let target = target.root();
// Step 2.1.
@ -495,7 +495,7 @@ impl HTMLMediaElement {
let window = window_from_node(self);
// FIXME(nox): Why are errors silenced here?
let _ = window.dom_manipulation_task_source().queue(
box task!(dedicated_media_source_failure_steps: move || {
task!(dedicated_media_source_failure_steps: move || {
let this = this.root();
// Step 1.