summaryrefslogtreecommitdiffstats
path: root/dom/cache/Manager.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:03:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:03:13 +0000
commit0681b3ac9a6ab4879ca2fbfcf8aa9d00a67b8365 (patch)
tree1437375a1c16af40bb2982577c25eb9608e17566 /dom/cache/Manager.cpp
parentAdding debian version 115.11.0esr-1~deb12u1. (diff)
downloadfirefox-esr-0681b3ac9a6ab4879ca2fbfcf8aa9d00a67b8365.tar.xz
firefox-esr-0681b3ac9a6ab4879ca2fbfcf8aa9d00a67b8365.zip
Merging upstream version 115.12.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/cache/Manager.cpp')
-rw-r--r--dom/cache/Manager.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/dom/cache/Manager.cpp b/dom/cache/Manager.cpp
index ab9b878ae0..fec6637255 100644
--- a/dom/cache/Manager.cpp
+++ b/dom/cache/Manager.cpp
@@ -632,6 +632,15 @@ class Manager::CacheMatchAction final : public Manager::BaseAction {
BodyOpen(aDirectoryMetadata, *aDBDir, mResponse.mBodyId));
}
+ // If we entered shutdown on the main thread while we were doing IO,
+ // bail out now.
+ if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) {
+ if (stream) {
+ stream->Close();
+ }
+ return NS_ERROR_ABORT;
+ }
+
mStreamList->Add(mResponse.mBodyId, std::move(stream));
return NS_OK;
@@ -694,6 +703,15 @@ class Manager::CacheMatchAllAction final : public Manager::BaseAction {
mSavedResponses[i].mBodyId));
}
+ // If we entered shutdown on the main thread while we were doing IO,
+ // bail out now.
+ if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) {
+ if (stream) {
+ stream->Close();
+ }
+ return NS_ERROR_ABORT;
+ }
+
mStreamList->Add(mSavedResponses[i].mBodyId, std::move(stream));
}
@@ -1215,6 +1233,15 @@ class Manager::CacheKeysAction final : public Manager::BaseAction {
mSavedRequests[i].mBodyId));
}
+ // If we entered shutdown on the main thread while we were doing IO,
+ // bail out now.
+ if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) {
+ if (stream) {
+ stream->Close();
+ }
+ return NS_ERROR_ABORT;
+ }
+
mStreamList->Add(mSavedRequests[i].mBodyId, std::move(stream));
}
@@ -1280,6 +1307,15 @@ class Manager::StorageMatchAction final : public Manager::BaseAction {
mSavedResponse.mBodyId));
}
+ // If we entered shutdown on the main thread while we were doing IO,
+ // bail out now.
+ if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) {
+ if (stream) {
+ stream->Close();
+ }
+ return NS_ERROR_ABORT;
+ }
+
mStreamList->Add(mSavedResponse.mBodyId, std::move(stream));
return NS_OK;