aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/workletglobalscope.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-09-13 10:48:39 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-09-13 15:02:45 +0200
commit24cf15a014d7239b7091edb38bb1f7d062556b5c (patch)
tree3a94d23f6c8c6ac511a17e06a4117fae4ef8d976 /components/script/dom/workletglobalscope.rs
parent7481ce177f4b124f869d3cf8b8f1c2fbf8b84429 (diff)
downloadservo-24cf15a014d7239b7091edb38bb1f7d062556b5c.tar.gz
servo-24cf15a014d7239b7091edb38bb1f7d062556b5c.zip
Store microtask queues in their global (fixes #18467)
Diffstat (limited to 'components/script/dom/workletglobalscope.rs')
-rw-r--r--components/script/dom/workletglobalscope.rs22
1 files changed, 1 insertions, 21 deletions
diff --git a/components/script/dom/workletglobalscope.rs b/components/script/dom/workletglobalscope.rs
index 28c8cc27e7a..64a2b3199fb 100644
--- a/components/script/dom/workletglobalscope.rs
+++ b/components/script/dom/workletglobalscope.rs
@@ -17,8 +17,6 @@ use ipc_channel::ipc::IpcSender;
use js::jsapi::JSContext;
use js::jsval::UndefinedValue;
use js::rust::Runtime;
-use microtask::Microtask;
-use microtask::MicrotaskQueue;
use msg::constellation_msg::PipelineId;
use net_traits::ResourceThreads;
use net_traits::image_cache::ImageCache;
@@ -36,7 +34,6 @@ use script_traits::TimerSchedulerMsg;
use servo_url::ImmutableOrigin;
use servo_url::MutableOrigin;
use servo_url::ServoUrl;
-use std::rc::Rc;
use std::sync::Arc;
use std::sync::mpsc::Sender;
@@ -47,9 +44,6 @@ pub struct WorkletGlobalScope {
globalscope: GlobalScope,
/// The base URL for this worklet.
base_url: ServoUrl,
- /// https://html.spec.whatwg.org/multipage/#microtask-queue
- #[ignore_heap_size_of = "Rc<T> is hard"]
- microtask_queue: Rc<MicrotaskQueue>,
/// Sender back to the script thread
#[ignore_heap_size_of = "channels are hard"]
to_script_thread_sender: Sender<MainThreadScriptMsg>,
@@ -82,9 +76,9 @@ impl WorkletGlobalScope {
init.resource_threads.clone(),
timer_event_chan,
MutableOrigin::new(ImmutableOrigin::new_opaque()),
+ Default::default(),
),
base_url,
- microtask_queue: Default::default(),
to_script_thread_sender: init.to_script_thread_sender.clone(),
executor,
}
@@ -133,20 +127,6 @@ impl WorkletGlobalScope {
self.executor.clone()
}
- /// Queue up a microtask to be executed in this global.
- pub fn enqueue_microtask(&self, job: Microtask) {
- self.microtask_queue.enqueue(job);
- }
-
- /// Perform any queued microtasks.
- pub fn perform_a_microtask_checkpoint(&self) {
- self.microtask_queue.checkpoint(|id| {
- let global = self.upcast::<GlobalScope>();
- assert_eq!(global.pipeline_id(), id);
- Some(Root::from_ref(global))
- });
- }
-
/// Perform a worklet task
pub fn perform_a_worklet_task(&self, task: WorkletTask) {
match task {