diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 09:04:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 09:04:05 +0000 |
commit | 6391fbb73e25d3f7af15213274c2a3bfe1bc7af5 (patch) | |
tree | d2c6903d55ffdba0655dc473a5ad44c2ecf59df8 /dom/cache | |
parent | Releasing progress-linux version 115.11.0esr-1~deb12u1progress7u1. (diff) | |
download | firefox-esr-6391fbb73e25d3f7af15213274c2a3bfe1bc7af5.tar.xz firefox-esr-6391fbb73e25d3f7af15213274c2a3bfe1bc7af5.zip |
Merging upstream version 115.12.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/cache')
-rw-r--r-- | dom/cache/DBAction.cpp | 3 | ||||
-rw-r--r-- | dom/cache/Manager.cpp | 36 |
2 files changed, 38 insertions, 1 deletions
diff --git a/dom/cache/DBAction.cpp b/dom/cache/DBAction.cpp index 0a51260fe5..218ceb1808 100644 --- a/dom/cache/DBAction.cpp +++ b/dom/cache/DBAction.cpp @@ -14,6 +14,7 @@ #include "mozilla/dom/quota/PersistenceType.h" #include "mozilla/dom/quota/ResultExtensions.h" #include "mozilla/net/nsFileProtocolHandler.h" +#include "mozilla/AppShutdown.h" #include "mozIStorageConnection.h" #include "mozIStorageService.h" #include "mozStorageCID.h" @@ -67,7 +68,7 @@ void DBAction::RunOnTarget( MOZ_DIAGNOSTIC_ASSERT(aDirectoryMetadata); MOZ_DIAGNOSTIC_ASSERT(aDirectoryMetadata->mDir); - if (IsCanceled()) { + if (IsCanceled() || AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) { aResolver->Resolve(NS_ERROR_ABORT); return; } 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; |