script: Unsilence all main thread TaskQueue errors (#34849)

No longer hide errors while queueing tasks on the main thread. This
requires creating two types of `TaskSource`s: one for the main thread
and one that can be sent to other threads. This makes queueing a bit
more efficient on the main thread and more importantly, no longer hides
task queue errors.

Fixes #25688.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Martin Robinson 2025-01-07 04:36:39 +01:00 committed by GitHub
parent d252a631d2
commit fe8a22b72c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 628 additions and 571 deletions

View file

@ -238,16 +238,14 @@ impl Performance {
if !self.pending_notification_observers_task.get() {
self.pending_notification_observers_task.set(true);
let task_source = self
.global()
.task_manager()
.performance_timeline_task_source();
let global = &self.global();
let owner = Trusted::new(&*global.performance());
let task = task!(notify_performance_observers: move || {
owner.root().notify_observers();
});
let _ = task_source.queue(task);
self.global()
.task_manager()
.performance_timeline_task_source()
.queue(task!(notify_performance_observers: move || {
owner.root().notify_observers();
}));
}
}
let mut observers = self.observers.borrow_mut();
@ -324,17 +322,15 @@ impl Performance {
// Step 6.
// Queue a new notification task.
self.pending_notification_observers_task.set(true);
let task_source = self
.global()
.task_manager()
.performance_timeline_task_source();
let global = &self.global();
let owner = Trusted::new(&*global.performance());
let task = task!(notify_performance_observers: move || {
owner.root().notify_observers();
});
let _ = task_source.queue(task);
self.global()
.task_manager()
.performance_timeline_task_source()
.queue(task!(notify_performance_observers: move || {
owner.root().notify_observers();
}));
Some(entry_last_index)
}