diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-04 16:08:12 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-06 21:35:53 +0200 |
commit | 2ee073053ab4718bced82197b2af2c77fc5f47a7 (patch) | |
tree | 3981bff35d1f3a7b8fcd3043466d542d2558c81b /components/script/script_runtime.rs | |
parent | 6e3be6d894e311f2f2331d9437b4956fb5fd4752 (diff) | |
download | servo-2ee073053ab4718bced82197b2af2c77fc5f47a7.tar.gz servo-2ee073053ab4718bced82197b2af2c77fc5f47a7.zip |
Make PromiseJobQueue::enqueue take a &GlobalScope
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r-- | components/script/script_runtime.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index df9341a3777..36ae678ade7 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -8,11 +8,12 @@ use dom::bindings::callback::ExceptionHandling; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::PromiseBinding::PromiseJobCallback; -use dom::bindings::global::{global_root_from_object, GlobalRoot, GlobalRef}; +use dom::bindings::global::{global_root_from_object, GlobalRoot}; use dom::bindings::js::{RootCollection, RootCollectionPtr, trace_roots}; use dom::bindings::refcounted::{LiveDOMReferences, trace_refcounted_objects}; use dom::bindings::trace::trace_traceables; use dom::bindings::utils::DOM_CALLBACKS; +use dom::globalscope::GlobalScope; use js::glue::CollectServoSizes; use js::jsapi::{DisableIncrementalGC, GCDescription, GCProgress, HandleObject}; use js::jsapi::{JSContext, JS_GetRuntime, JSRuntime, JSTracer, SetDOMCallbacks, SetGCSliceCallback}; @@ -138,11 +139,11 @@ impl PromiseJobQueue { /// Add a new promise job callback to this queue. It will be invoked as part of the next /// microtask checkpoint. - pub fn enqueue(&self, job: EnqueuedPromiseCallback, global: GlobalRef) { + pub fn enqueue(&self, job: EnqueuedPromiseCallback, global: &GlobalScope) { self.promise_job_queue.borrow_mut().push(job); if !self.pending_promise_job_runnable.get() { self.pending_promise_job_runnable.set(true); - global.as_global_scope().flush_promise_jobs(); + global.flush_promise_jobs(); } } |