aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_runtime.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-10-07 07:52:09 -0500
committerGitHub <noreply@github.com>2016-10-07 07:52:09 -0500
commita6e4b5bb86ad707a0863acff87344ca4239cfd2c (patch)
treec820d9f2420c44cdfe29de97f1a710e7dc354bb7 /components/script/script_runtime.rs
parente23959a7618e8e7b7ca20300a2afeb1ac77712f3 (diff)
parentd8e92bb271a9f9dd87bf77e38cd820d01f2f0ae4 (diff)
downloadservo-a6e4b5bb86ad707a0863acff87344ca4239cfd2c.tar.gz
servo-a6e4b5bb86ad707a0863acff87344ca4239cfd2c.zip
Auto merge of #13596 - nox:inline, r=Ms2ger
Get rid of dom::bindings::global Globals in that PR are now represented by the fake IDL interface `GlobalScope`. <!-- 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/13596) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r--components/script/script_runtime.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs
index 658ace4c46a..603e24a1468 100644
--- a/components/script/script_runtime.rs
+++ b/components/script/script_runtime.rs
@@ -8,11 +8,11 @@
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::js::{RootCollection, RootCollectionPtr, trace_roots};
+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;
+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,7 +138,7 @@ 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);
@@ -149,7 +149,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);
{
@@ -161,7 +161,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();
@@ -177,9 +177,9 @@ unsafe extern "C" fn enqueue_job(_cx: *mut JSContext,
_allocation_site: HandleObject,
_data: *mut c_void) -> bool {
let result = panic::catch_unwind(AssertUnwindSafe(|| {
- let global = global_root_from_object(job.get());
- let pipeline = global.r().pipeline_id();
- global.r().enqueue_promise_job(EnqueuedPromiseCallback {
+ let global = GlobalScope::from_object(job.get());
+ let pipeline = global.pipeline_id();
+ global.enqueue_promise_job(EnqueuedPromiseCallback {
callback: PromiseJobCallback::new(job.get()),
pipeline: pipeline,
});