From 3f35c3eee22cb52de04dea764e529517f6bfef0d Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 12 Jan 2017 18:05:54 -0500 Subject: Add a permanent root to WebIDL callbacks, ensuring they are always safe to store. --- components/script/script_runtime.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/script/script_runtime.rs') diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index 75ce94084f0..b7a0374428b 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -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 -- cgit v1.2.3