aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/serviceworker.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-09-20 10:37:09 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-09-20 10:37:09 +0200
commit6c9fb5ae7a4eb6cff38de3bb6446af304a32bc8a (patch)
tree63a8bd729171e5886340fe89774f2287bd11cb5b /components/script/dom/serviceworker.rs
parent52527d6f9dfaae13458059243d975f5336bdead4 (diff)
downloadservo-6c9fb5ae7a4eb6cff38de3bb6446af304a32bc8a.tar.gz
servo-6c9fb5ae7a4eb6cff38de3bb6446af304a32bc8a.zip
Introduce TaskOnce
Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing from CancellableTask<T>.
Diffstat (limited to 'components/script/dom/serviceworker.rs')
-rw-r--r--components/script/dom/serviceworker.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/components/script/dom/serviceworker.rs b/components/script/dom/serviceworker.rs
index 9a4d85caa69..51c75309050 100644
--- a/components/script/dom/serviceworker.rs
+++ b/components/script/dom/serviceworker.rs
@@ -19,7 +19,7 @@ use js::jsapi::{HandleValue, JSContext};
use script_traits::{ScriptMsg, DOMMessage};
use servo_url::ServoUrl;
use std::cell::Cell;
-use task::TaskBox;
+use task::TaskOnce;
pub type TrustedServiceWorkerAddress = Trusted<ServiceWorker>;
@@ -104,10 +104,9 @@ impl ServiceWorkerMethods for ServiceWorker {
event_handler!(statechange, GetOnstatechange, SetOnstatechange);
}
-impl TaskBox for SimpleWorkerErrorHandler<ServiceWorker> {
+impl TaskOnce for SimpleWorkerErrorHandler<ServiceWorker> {
#[allow(unrooted_must_root)]
- fn run_box(self: Box<Self>) {
- let this = *self;
- ServiceWorker::dispatch_simple_error(this.addr);
+ fn run_once(self) {
+ ServiceWorker::dispatch_simple_error(self.addr);
}
}