aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2019-06-02 23:38:12 -0400
committerJosh Matthews <josh@joshmatthews.net>2019-06-26 18:10:46 -0400
commit63714c90fb5bbad86f28fc188120b2ecfd3337ab (patch)
treec4d8eaa4de8bcf26b6a382f450f1b194024f83c3 /components/script/script_thread.rs
parentce9f35e0e3de762d84dffadf39fc30f8377aa4b9 (diff)
downloadservo-63714c90fb5bbad86f28fc188120b2ecfd3337ab.tar.gz
servo-63714c90fb5bbad86f28fc188120b2ecfd3337ab.zip
Upgrade to Spidermonkey 67.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs32
1 files changed, 23 insertions, 9 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 90012015b1c..2aad945153c 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -845,11 +845,16 @@ impl ScriptThread {
}
// https://html.spec.whatwg.org/multipage/#await-a-stable-state
+ #[allow(unsafe_code)]
pub fn await_stable_state(task: Microtask) {
SCRIPT_THREAD_ROOT.with(|root| {
if let Some(script_thread) = root.get() {
- let script_thread = unsafe { &*script_thread };
- script_thread.microtask_queue.enqueue(task);
+ unsafe {
+ let script_thread = &*script_thread;
+ script_thread
+ .microtask_queue
+ .enqueue(task, script_thread.get_cx());
+ }
}
});
}
@@ -1123,6 +1128,8 @@ impl ScriptThread {
devtools_port: devtools_port,
devtools_sender: ipc_devtools_sender,
+ microtask_queue: runtime.microtask_queue.clone(),
+
js_runtime: Rc::new(runtime),
topmost_mouse_over_target: MutNullableDom::new(Default::default()),
closed_pipelines: DomRefCell::new(HashSet::new()),
@@ -1133,8 +1140,6 @@ impl ScriptThread {
content_process_shutdown_chan: state.content_process_shutdown_chan,
- microtask_queue: Default::default(),
-
mutation_observer_microtask_queued: Default::default(),
mutation_observers: Default::default(),
@@ -3541,13 +3546,17 @@ impl ScriptThread {
}
}
+ #[allow(unsafe_code)]
pub fn enqueue_microtask(job: Microtask) {
- SCRIPT_THREAD_ROOT.with(|root| {
- let script_thread = unsafe { &*root.get().unwrap() };
- script_thread.microtask_queue.enqueue(job);
+ SCRIPT_THREAD_ROOT.with(|root| unsafe {
+ let script_thread = &*root.get().unwrap();
+ script_thread
+ .microtask_queue
+ .enqueue(job, script_thread.get_cx());
});
}
+ #[allow(unsafe_code)]
fn perform_a_microtask_checkpoint(&self) {
let globals = self
.documents
@@ -3556,8 +3565,13 @@ impl ScriptThread {
.map(|(_id, document)| document.global())
.collect();
- self.microtask_queue
- .checkpoint(|id| self.documents.borrow().find_global(id), globals)
+ unsafe {
+ self.microtask_queue.checkpoint(
+ self.get_cx(),
+ |id| self.documents.borrow().find_global(id),
+ globals,
+ )
+ }
}
}