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

@ -81,9 +81,6 @@ impl VideoTrackList {
return;
}
let this = Trusted::new(self);
let task_source = self.global().task_manager().media_element_task_source();
if let Some(current) = self.selected_index() {
self.tracks.borrow()[current].set_selected(false);
}
@ -93,10 +90,14 @@ impl VideoTrackList {
media_element.set_video_track(idx, value);
}
let _ = task_source.queue(task!(media_track_change: move || {
let this = this.root();
this.upcast::<EventTarget>().fire_event(atom!("change"), CanGc::note());
}));
let this = Trusted::new(self);
self.global()
.task_manager()
.media_element_task_source()
.queue(task!(media_track_change: move || {
let this = this.root();
this.upcast::<EventTarget>().fire_event(atom!("change"), CanGc::note());
}));
}
pub fn add(&self, track: &VideoTrack) {