aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_runtime.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2017-01-12 18:05:54 -0500
committerJosh Matthews <josh@joshmatthews.net>2017-01-13 09:59:57 -0500
commit3f35c3eee22cb52de04dea764e529517f6bfef0d (patch)
treecaa59c9b7955f2dc6730eac3289b3232ea681a89 /components/script/script_runtime.rs
parent550df86ac88ff12ad3964d08b6a678ae0d1b4436 (diff)
downloadservo-3f35c3eee22cb52de04dea764e529517f6bfef0d.tar.gz
servo-3f35c3eee22cb52de04dea764e529517f6bfef0d.zip
Add a permanent root to WebIDL callbacks, ensuring they are always safe to store.
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r--components/script/script_runtime.rs4
1 files changed, 2 insertions, 2 deletions
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