diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index b6c2b254608..5cbd2ecc997 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -91,7 +91,9 @@ pub struct WorkerGlobalScope { /// `IpcSender` doesn't exist from_devtools_receiver: Receiver, - microtask_queue: MicrotaskQueue, + /// https://html.spec.whatwg.org/multipage/#microtask-queue + #[ignore_heap_size_of = "Rc is hard"] + microtask_queue: Rc, navigation_start_precise: f64, performance: MutNullableJS, diff --git a/components/script/dom/workletglobalscope.rs b/components/script/dom/workletglobalscope.rs index c01989d746c..28c8cc27e7a 100644 --- a/components/script/dom/workletglobalscope.rs +++ b/components/script/dom/workletglobalscope.rs @@ -36,6 +36,7 @@ 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; @@ -46,8 +47,9 @@ pub struct WorkletGlobalScope { globalscope: GlobalScope, /// The base URL for this worklet. base_url: ServoUrl, - /// The microtask queue for this worklet - microtask_queue: MicrotaskQueue, + /// https://html.spec.whatwg.org/multipage/#microtask-queue + #[ignore_heap_size_of = "Rc is hard"] + microtask_queue: Rc, /// Sender back to the script thread #[ignore_heap_size_of = "channels are hard"] to_script_thread_sender: Sender, diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index a29896f70f5..597d1dce11c 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -515,7 +515,8 @@ pub struct ScriptThread { content_process_shutdown_chan: IpcSender<()>, - microtask_queue: MicrotaskQueue, + /// https://html.spec.whatwg.org/multipage/#microtask-queue + microtask_queue: Rc, /// Microtask Queue for adding support for mutation observer microtasks mutation_observer_compound_microtask_queued: Cell, @@ -892,7 +893,7 @@ impl ScriptThread { content_process_shutdown_chan: state.content_process_shutdown_chan, - microtask_queue: MicrotaskQueue::default(), + microtask_queue: Default::default(), mutation_observer_compound_microtask_queued: Default::default(),