diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-01-16 10:16:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-16 10:16:44 -0800 |
commit | e891277dd5a52bc3a2b76dfd78da9b82b4c11b40 (patch) | |
tree | da47fb84567db690b8c4649619cbe89b577c708d /components/script/script_runtime.rs | |
parent | 44fa478d7bb87fea52ef4af78267738316f22587 (diff) | |
parent | 3f35c3eee22cb52de04dea764e529517f6bfef0d (diff) | |
download | servo-e891277dd5a52bc3a2b76dfd78da9b82b4c11b40.tar.gz servo-e891277dd5a52bc3a2b76dfd78da9b82b4c11b40.zip |
Auto merge of #14994 - jdm:callback_rooting, r=Manishearth,Ms2ger
Make WebIDL callbacks permanently rooted
This replicates the same model that Promise uses right now, because it requires less thinking than coming up with something else.
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14447
- [ ] There are tests for these changes
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14994)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r-- | components/script/script_runtime.rs | 4 |
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 |