mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make the closure in flush_promise_jobs return a Root<GlobalScope>
This commit is contained in:
parent
996fd284e2
commit
c66cf46bee
3 changed files with 10 additions and 9 deletions
|
@ -9,7 +9,6 @@ use dom::bindings::codegen::Bindings::RequestBinding::RequestInit;
|
|||
use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods;
|
||||
use dom::bindings::codegen::UnionTypes::RequestOrUSVString;
|
||||
use dom::bindings::error::{Error, ErrorResult, Fallible, report_pending_exception};
|
||||
use dom::bindings::global::GlobalRoot;
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::js::{JS, MutNullableHeap, Root};
|
||||
use dom::bindings::refcounted::Trusted;
|
||||
|
@ -173,8 +172,9 @@ impl WorkerGlobalScope {
|
|||
|
||||
fn do_flush_promise_jobs(&self) {
|
||||
self.promise_job_queue.flush_promise_jobs(|id| {
|
||||
assert_eq!(self.upcast::<GlobalScope>().pipeline_id(), id);
|
||||
Some(GlobalRoot::Worker(Root::from_ref(self)))
|
||||
let global = self.upcast::<GlobalScope>();
|
||||
assert_eq!(global.pipeline_id(), id);
|
||||
Some(Root::from_ref(global))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue