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

@ -119,7 +119,7 @@ use style::thread_state;
use style::values::{CSSFloat, Either};
use style::values::{specified, computed};
use stylesheet_loader::StylesheetOwner;
use task::TaskBox;
use task::TaskOnce;
// TODO: Update focus state when the top-level browsing context gains or loses system focus,
// and when the element enters or leaves a browsing context container.
@ -3047,9 +3047,9 @@ impl ElementPerformFullscreenEnter {
}
}
impl TaskBox for ElementPerformFullscreenEnter {
impl TaskOnce for ElementPerformFullscreenEnter {
#[allow(unrooted_must_root)]
fn run_box(self: Box<Self>) {
fn run_once(self) {
let element = self.element.root();
let document = document_from_node(element.r());
@ -3100,9 +3100,9 @@ impl ElementPerformFullscreenExit {
}
}
impl TaskBox for ElementPerformFullscreenExit {
impl TaskOnce for ElementPerformFullscreenExit {
#[allow(unrooted_must_root)]
fn run_box(self: Box<Self>) {
fn run_once(self) {
let element = self.element.root();
let document = document_from_node(element.r());
// TODO Step 9.1-5