mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add a permanent root to WebIDL callbacks, ensuring they are always safe to store.
This commit is contained in:
parent
550df86ac8
commit
3f35c3eee2
4 changed files with 75 additions and 28 deletions
|
@ -176,7 +176,7 @@ impl PromiseJobQueue {
|
|||
/// promise job queue, and enqueues a runnable to perform a microtask checkpoint if one
|
||||
/// is not already pending.
|
||||
#[allow(unsafe_code)]
|
||||
unsafe extern "C" fn enqueue_job(_cx: *mut JSContext,
|
||||
unsafe extern "C" fn enqueue_job(cx: *mut JSContext,
|
||||
job: HandleObject,
|
||||
_allocation_site: HandleObject,
|
||||
_data: *mut c_void) -> bool {
|
||||
|
@ -184,7 +184,7 @@ unsafe extern "C" fn enqueue_job(_cx: *mut JSContext,
|
|||
let global = GlobalScope::from_object(job.get());
|
||||
let pipeline = global.pipeline_id();
|
||||
global.enqueue_promise_job(EnqueuedPromiseCallback {
|
||||
callback: PromiseJobCallback::new(job.get()),
|
||||
callback: PromiseJobCallback::new(cx, job.get()),
|
||||
pipeline: pipeline,
|
||||
});
|
||||
true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue