mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -1977,7 +1977,7 @@ impl Window {
|
|||
serialize_with_transfer_result: StructuredCloneData,
|
||||
) {
|
||||
let this = Trusted::new(self);
|
||||
let task = box task!(post_serialised_message: move || {
|
||||
let task = task!(post_serialised_message: move || {
|
||||
let this = this.root();
|
||||
|
||||
// Step 7.1.
|
||||
|
@ -2012,7 +2012,7 @@ impl Window {
|
|||
// TODO(#12718): Use the "posted message task source".
|
||||
let _ = self.script_chan.send(CommonScriptMsg::Task(
|
||||
ScriptThreadEventCategory::DomEvent,
|
||||
self.task_canceller().wrap_task(task),
|
||||
box self.task_canceller().wrap_task(task),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue