diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/workerglobalscope.rs | 6 | ||||
-rw-r--r-- | components/script/script_runtime.rs | 8 | ||||
-rw-r--r-- | components/script/script_thread.rs | 5 |
3 files changed, 10 insertions, 9 deletions
diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index 042f2b3d1e3..8cd09b3fdbe 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -9,7 +9,6 @@ use dom::bindings::codegen::Bindings::RequestBinding::RequestInit; use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods; use dom::bindings::codegen::UnionTypes::RequestOrUSVString; use dom::bindings::error::{Error, ErrorResult, Fallible, report_pending_exception}; -use dom::bindings::global::GlobalRoot; use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::bindings::refcounted::Trusted; @@ -173,8 +172,9 @@ impl WorkerGlobalScope { fn do_flush_promise_jobs(&self) { self.promise_job_queue.flush_promise_jobs(|id| { - assert_eq!(self.upcast::<GlobalScope>().pipeline_id(), id); - Some(GlobalRoot::Worker(Root::from_ref(self))) + let global = self.upcast::<GlobalScope>(); + assert_eq!(global.pipeline_id(), id); + Some(Root::from_ref(global)) }); } } diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index 145ef1ef19e..c1da1104cd4 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -8,8 +8,8 @@ use dom::bindings::callback::ExceptionHandling; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::PromiseBinding::PromiseJobCallback; -use dom::bindings::global::{GlobalRoot, global_scope_from_object}; -use dom::bindings::js::{RootCollection, RootCollectionPtr, trace_roots}; +use dom::bindings::global::global_scope_from_object; +use dom::bindings::js::{Root, RootCollection, RootCollectionPtr, trace_roots}; use dom::bindings::refcounted::{LiveDOMReferences, trace_refcounted_objects}; use dom::bindings::trace::trace_traceables; use dom::bindings::utils::DOM_CALLBACKS; @@ -150,7 +150,7 @@ impl PromiseJobQueue { /// Perform a microtask checkpoint, by invoking all of the pending promise job callbacks in /// FIFO order (#4283). pub fn flush_promise_jobs<F>(&self, target_provider: F) - where F: Fn(PipelineId) -> Option<GlobalRoot> + where F: Fn(PipelineId) -> Option<Root<GlobalScope>> { self.pending_promise_job_runnable.set(false); { @@ -162,7 +162,7 @@ impl PromiseJobQueue { // `flushing_queue` is a static snapshot during this checkpoint. for job in &*self.flushing_job_queue.borrow() { if let Some(target) = target_provider(job.pipeline) { - let _ = job.callback.Call_(&target.r(), ExceptionHandling::Report); + let _ = job.callback.Call_(&*target, ExceptionHandling::Report); } } self.flushing_job_queue.borrow_mut().clear(); diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 22ca69c78df..85f0cc2462e 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -27,7 +27,6 @@ use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, Documen use dom::bindings::codegen::Bindings::LocationBinding::LocationMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::conversions::{ConversionResult, FromJSValConvertible, StringificationBehavior}; -use dom::bindings::global::GlobalRoot; use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, MutNullableHeap, Root, RootCollection}; use dom::bindings::js::{RootCollectionPtr, RootedReference}; @@ -2190,7 +2189,9 @@ impl ScriptThread { fn do_flush_promise_jobs(&self) { self.promise_job_queue.flush_promise_jobs(|id| { - self.find_child_context(id).map(|context| GlobalRoot::Window(context.active_window())) + self.find_child_context(id).map(|context| { + Root::upcast(context.active_window()) + }) }); } } |