mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
parent
d252a631d2
commit
fe8a22b72c
48 changed files with 628 additions and 571 deletions
|
@ -62,31 +62,32 @@ impl TextTrackList {
|
|||
if self.find(track).is_none() {
|
||||
self.dom_tracks.borrow_mut().push(Dom::from_ref(track));
|
||||
|
||||
let this = Trusted::new(self);
|
||||
let task_source = self.global().task_manager().media_element_task_source();
|
||||
|
||||
let Some(idx) = self.find(track) else {
|
||||
return;
|
||||
};
|
||||
|
||||
let _ = task_source.queue(task!(track_event_queue: move || {
|
||||
let this = this.root();
|
||||
let this = Trusted::new(self);
|
||||
self.global()
|
||||
.task_manager()
|
||||
.media_element_task_source()
|
||||
.queue(task!(track_event_queue: move || {
|
||||
let this = this.root();
|
||||
|
||||
if let Some(track) = this.item(idx) {
|
||||
let event = TrackEvent::new(
|
||||
&this.global(),
|
||||
atom!("addtrack"),
|
||||
false,
|
||||
false,
|
||||
&Some(VideoTrackOrAudioTrackOrTextTrack::TextTrack(
|
||||
DomRoot::from_ref(&track)
|
||||
)),
|
||||
CanGc::note()
|
||||
);
|
||||
if let Some(track) = this.item(idx) {
|
||||
let event = TrackEvent::new(
|
||||
&this.global(),
|
||||
atom!("addtrack"),
|
||||
false,
|
||||
false,
|
||||
&Some(VideoTrackOrAudioTrackOrTextTrack::TextTrack(
|
||||
DomRoot::from_ref(&track)
|
||||
)),
|
||||
CanGc::note()
|
||||
);
|
||||
|
||||
event.upcast::<Event>().fire(this.upcast::<EventTarget>(), CanGc::note());
|
||||
}
|
||||
}));
|
||||
event.upcast::<Event>().fire(this.upcast::<EventTarget>(), CanGc::note());
|
||||
}
|
||||
}));
|
||||
track.add_track_list(self);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue