From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../IdentityCredentialPromptService.sys.mjs | 12 ++++++------ .../IdentityCredentialStorageService.cpp | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'toolkit/components/credentialmanagement') diff --git a/toolkit/components/credentialmanagement/IdentityCredentialPromptService.sys.mjs b/toolkit/components/credentialmanagement/IdentityCredentialPromptService.sys.mjs index 3a6b43b5b1..1274cc168c 100644 --- a/toolkit/components/credentialmanagement/IdentityCredentialPromptService.sys.mjs +++ b/toolkit/components/credentialmanagement/IdentityCredentialPromptService.sys.mjs @@ -273,7 +273,7 @@ export class IdentityCredentialPromptService { let mainAction = { label: acceptLabel, accessKey: acceptKey, - callback(event) { + callback(_event) { let result = listBox.querySelector( ".identity-credential-list-item-radio:checked" ).value; @@ -284,7 +284,7 @@ export class IdentityCredentialPromptService { { label: cancelLabel, accessKey: cancelKey, - callback(event) { + callback(_event) { reject(); }, }, @@ -451,7 +451,7 @@ export class IdentityCredentialPromptService { let mainAction = { label: acceptLabel, accessKey: acceptKey, - callback(event) { + callback(_event) { resolve(true); }, }; @@ -459,7 +459,7 @@ export class IdentityCredentialPromptService { { label: cancelLabel, accessKey: cancelKey, - callback(event) { + callback(_event) { resolve(false); }, }, @@ -676,7 +676,7 @@ export class IdentityCredentialPromptService { let mainAction = { label: acceptLabel, accessKey: acceptKey, - callback(event) { + callback(_event) { let result = listBox.querySelector( ".identity-credential-list-item-radio:checked" ).value; @@ -687,7 +687,7 @@ export class IdentityCredentialPromptService { { label: cancelLabel, accessKey: cancelKey, - callback(event) { + callback(_event) { reject(); }, }, 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 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 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, -- cgit v1.2.3