mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Introduce TaskOnce
Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing from CancellableTask<T>.
This commit is contained in:
parent
52527d6f9d
commit
6c9fb5ae7a
26 changed files with 144 additions and 124 deletions
|
@ -28,7 +28,7 @@ use std::cell::Cell;
|
|||
use std::sync::{Arc, Mutex};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::mpsc::{Sender, channel};
|
||||
use task::TaskBox;
|
||||
use task::TaskOnce;
|
||||
|
||||
pub type TrustedWorkerAddress = Trusted<Worker>;
|
||||
|
||||
|
@ -175,10 +175,9 @@ impl WorkerMethods for Worker {
|
|||
event_handler!(error, GetOnerror, SetOnerror);
|
||||
}
|
||||
|
||||
impl TaskBox for SimpleWorkerErrorHandler<Worker> {
|
||||
impl TaskOnce for SimpleWorkerErrorHandler<Worker> {
|
||||
#[allow(unrooted_must_root)]
|
||||
fn run_box(self: Box<Self>) {
|
||||
let this = *self;
|
||||
Worker::dispatch_simple_error(this.addr);
|
||||
fn run_once(self) {
|
||||
Worker::dispatch_simple_error(self.addr);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue