summaryrefslogtreecommitdiffstats
path: root/toolkit/components/credentialmanagement/IdentityCredentialStorageService.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /toolkit/components/credentialmanagement/IdentityCredentialStorageService.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/credentialmanagement/IdentityCredentialStorageService.cpp')
-rw-r--r--toolkit/components/credentialmanagement/IdentityCredentialStorageService.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/toolkit/components/credentialmanagement/IdentityCredentialStorageService.cpp b/toolkit/components/credentialmanagement/IdentityCredentialStorageService.cpp
index f3994d1a86..f1549ad4f8 100644
--- a/toolkit/components/credentialmanagement/IdentityCredentialStorageService.cpp
+++ b/toolkit/components/credentialmanagement/IdentityCredentialStorageService.cpp
@@ -125,18 +125,23 @@ IdentityCredentialStorageService::GetAsyncShutdownBarrier() const {
nsresult IdentityCredentialStorageService::Init() {
AssertIsOnMainThread();
- if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) {
+ nsCOMPtr<nsIAsyncShutdownClient> asc = GetAsyncShutdownBarrier();
+ if (!asc) {
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+
+ // We should only allow this service to start before its
+ // shutdown barrier is closed, so it never leaks.
+ bool closed;
+ nsresult rv = asc->GetIsClosed(&closed);
+ if (closed || NS_WARN_IF(NS_FAILED(rv))) {
MonitorAutoLock lock(mMonitor);
mShuttingDown.Flip();
return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
}
- nsCOMPtr<nsIAsyncShutdownClient> asc = GetAsyncShutdownBarrier();
- if (!asc) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- nsresult rv = asc->AddBlocker(this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__),
- __LINE__, u""_ns);
+ rv = asc->AddBlocker(this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__), __LINE__,
+ u""_ns);
NS_ENSURE_SUCCESS(rv, rv);
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,