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

@ -502,27 +502,22 @@ impl FileReader {
let filereader = Trusted::new(self);
let global = self.global();
let task_source = global.task_manager().file_reading_task_source();
let task_manager = global.task_manager();
let task_source = task_manager.file_reading_task_source();
// Queue tasks as appropriate.
task_source
.queue(FileReadingTask::ProcessRead(filereader.clone(), gen_id))
.unwrap();
task_source.queue(FileReadingTask::ProcessRead(filereader.clone(), gen_id));
if !blob_contents.is_empty() {
task_source
.queue(FileReadingTask::ProcessReadData(filereader.clone(), gen_id))
.unwrap();
task_source.queue(FileReadingTask::ProcessReadData(filereader.clone(), gen_id));
}
task_source
.queue(FileReadingTask::ProcessReadEOF(
filereader,
gen_id,
load_data,
blob_contents,
))
.unwrap();
task_source.queue(FileReadingTask::ProcessReadEOF(
filereader,
gen_id,
load_data,
blob_contents,
));
Ok(())
}