mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Use safe JSContext in MicrotaskQueue
This commit is contained in:
parent
b18fa8b8a7
commit
6d444afd9e
4 changed files with 27 additions and 39 deletions
|
@ -172,6 +172,7 @@ unsafe extern "C" fn enqueue_promise_job(
|
|||
_allocation_site: HandleObject,
|
||||
incumbent_global: HandleObject,
|
||||
) -> bool {
|
||||
let cx = JSContext::from_ptr(cx);
|
||||
wrap_panic(
|
||||
AssertUnwindSafe(|| {
|
||||
let microtask_queue = &*(extra as *const MicrotaskQueue);
|
||||
|
@ -179,7 +180,7 @@ unsafe extern "C" fn enqueue_promise_job(
|
|||
let pipeline = global.pipeline_id();
|
||||
microtask_queue.enqueue(
|
||||
Microtask::Promise(EnqueuedPromiseCallback {
|
||||
callback: PromiseJobCallback::new(JSContext::from_ptr(cx), job.get()),
|
||||
callback: PromiseJobCallback::new(cx, job.get()),
|
||||
pipeline,
|
||||
}),
|
||||
cx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue