aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/filereader.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-01-07 04:36:39 +0100
committerGitHub <noreply@github.com>2025-01-07 03:36:39 +0000
commitfe8a22b72c42296ccbbd5c4f459936ea28c5dee2 (patch)
tree9749d88dc818a054c204ebbc5dc82878ced68c8d /components/script/dom/filereader.rs
parentd252a631d292afc492b337c8b32a34b86139f99d (diff)
downloadservo-fe8a22b72c42296ccbbd5c4f459936ea28c5dee2.tar.gz
servo-fe8a22b72c42296ccbbd5c4f459936ea28c5dee2.zip
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>
Diffstat (limited to 'components/script/dom/filereader.rs')
-rw-r--r--components/script/dom/filereader.rs25
1 files changed, 10 insertions, 15 deletions
diff --git a/components/script/dom/filereader.rs b/components/script/dom/filereader.rs
index 55637105058..d2b6d864d3d 100644
--- a/components/script/dom/filereader.rs
+++ b/components/script/dom/filereader.rs
@@ -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(())
}