mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 07:07:30 +09:00
Merge remote-tracking branch 'origin/master' into custom
This commit is contained in:
commit
8c7f5dcc57
5 changed files with 19 additions and 24 deletions
|
|
@ -2543,6 +2543,12 @@ WorkerPrivateParent<Derived>::DisableDebugger()
|
||||||
|
|
||||||
WorkerPrivate* self = ParentAsWorkerPrivate();
|
WorkerPrivate* self = ParentAsWorkerPrivate();
|
||||||
|
|
||||||
|
// RegisterDebugger might have been dispatched but not completed.
|
||||||
|
// Wait for its execution to complete before unregistering.
|
||||||
|
if (!NS_IsMainThread()) {
|
||||||
|
self->WaitForIsDebuggerRegistered(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (NS_FAILED(UnregisterWorkerDebugger(self))) {
|
if (NS_FAILED(UnregisterWorkerDebugger(self))) {
|
||||||
NS_WARNING("Failed to unregister worker debugger!");
|
NS_WARNING("Failed to unregister worker debugger!");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -530,7 +530,8 @@ public:
|
||||||
void GetFingerprint(nsAString& fingerprint)
|
void GetFingerprint(nsAString& fingerprint)
|
||||||
{
|
{
|
||||||
char *tmp;
|
char *tmp;
|
||||||
GetFingerprint(&tmp);
|
nsresult rv = GetFingerprint(&tmp);
|
||||||
|
NS_ENSURE_SUCCESS_VOID(rv);
|
||||||
fingerprint.AssignASCII(tmp);
|
fingerprint.AssignASCII(tmp);
|
||||||
delete[] tmp;
|
delete[] tmp;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2798,8 +2798,9 @@ sftk_CloseAllSessions(SFTKSlot *slot, PRBool logout)
|
||||||
} else {
|
} else {
|
||||||
SKIP_AFTER_FORK(PZ_Unlock(lock));
|
SKIP_AFTER_FORK(PZ_Unlock(lock));
|
||||||
}
|
}
|
||||||
if (session)
|
if (session) {
|
||||||
sftk_FreeSession(session);
|
sftk_DestroySession(session);
|
||||||
|
}
|
||||||
} while (session != NULL);
|
} while (session != NULL);
|
||||||
}
|
}
|
||||||
return CKR_OK;
|
return CKR_OK;
|
||||||
|
|
@ -4034,8 +4035,6 @@ NSC_CloseSession(CK_SESSION_HANDLE hSession)
|
||||||
if (sftkqueue_is_queued(session, hSession, slot->head, slot->sessHashSize)) {
|
if (sftkqueue_is_queued(session, hSession, slot->head, slot->sessHashSize)) {
|
||||||
sessionFound = PR_TRUE;
|
sessionFound = PR_TRUE;
|
||||||
sftkqueue_delete(session, hSession, slot->head, slot->sessHashSize);
|
sftkqueue_delete(session, hSession, slot->head, slot->sessHashSize);
|
||||||
session->refCount--; /* can't go to zero while we hold the reference */
|
|
||||||
PORT_Assert(session->refCount > 0);
|
|
||||||
}
|
}
|
||||||
PZ_Unlock(lock);
|
PZ_Unlock(lock);
|
||||||
|
|
||||||
|
|
@ -4056,6 +4055,8 @@ NSC_CloseSession(CK_SESSION_HANDLE hSession)
|
||||||
if (session->info.flags & CKF_RW_SESSION) {
|
if (session->info.flags & CKF_RW_SESSION) {
|
||||||
(void)PR_ATOMIC_DECREMENT(&slot->rwSessionCount);
|
(void)PR_ATOMIC_DECREMENT(&slot->rwSessionCount);
|
||||||
}
|
}
|
||||||
|
sftk_DestroySession(session);
|
||||||
|
session = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sftk_FreeSession(session);
|
sftk_FreeSession(session);
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,6 @@ struct SFTKSessionStr {
|
||||||
SFTKSession *next;
|
SFTKSession *next;
|
||||||
SFTKSession *prev;
|
SFTKSession *prev;
|
||||||
CK_SESSION_HANDLE handle;
|
CK_SESSION_HANDLE handle;
|
||||||
int refCount;
|
|
||||||
PZLock *objectLock;
|
PZLock *objectLock;
|
||||||
int objectIDCount;
|
int objectIDCount;
|
||||||
CK_SESSION_INFO info;
|
CK_SESSION_INFO info;
|
||||||
|
|
@ -683,6 +682,7 @@ extern SFTKSlot *sftk_SlotFromSessionHandle(CK_SESSION_HANDLE handle);
|
||||||
extern CK_SLOT_ID sftk_SlotIDFromSessionHandle(CK_SESSION_HANDLE handle);
|
extern CK_SLOT_ID sftk_SlotIDFromSessionHandle(CK_SESSION_HANDLE handle);
|
||||||
extern SFTKSession *sftk_SessionFromHandle(CK_SESSION_HANDLE handle);
|
extern SFTKSession *sftk_SessionFromHandle(CK_SESSION_HANDLE handle);
|
||||||
extern void sftk_FreeSession(SFTKSession *session);
|
extern void sftk_FreeSession(SFTKSession *session);
|
||||||
|
extern void sftk_DestroySession(SFTKSession *session);
|
||||||
extern SFTKSession *sftk_NewSession(CK_SLOT_ID slotID, CK_NOTIFY notify,
|
extern SFTKSession *sftk_NewSession(CK_SLOT_ID slotID, CK_NOTIFY notify,
|
||||||
CK_VOID_PTR pApplication, CK_FLAGS flags);
|
CK_VOID_PTR pApplication, CK_FLAGS flags);
|
||||||
extern void sftk_update_state(SFTKSlot *slot, SFTKSession *session);
|
extern void sftk_update_state(SFTKSlot *slot, SFTKSession *session);
|
||||||
|
|
|
||||||
|
|
@ -1813,7 +1813,6 @@ sftk_NewSession(CK_SLOT_ID slotID, CK_NOTIFY notify, CK_VOID_PTR pApplication,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
session->next = session->prev = NULL;
|
session->next = session->prev = NULL;
|
||||||
session->refCount = 1;
|
|
||||||
session->enc_context = NULL;
|
session->enc_context = NULL;
|
||||||
session->hash_context = NULL;
|
session->hash_context = NULL;
|
||||||
session->sign_context = NULL;
|
session->sign_context = NULL;
|
||||||
|
|
@ -1837,11 +1836,10 @@ sftk_NewSession(CK_SLOT_ID slotID, CK_NOTIFY notify, CK_VOID_PTR pApplication,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free all the data associated with a session. */
|
/* free all the data associated with a session. */
|
||||||
static void
|
void
|
||||||
sftk_DestroySession(SFTKSession *session)
|
sftk_DestroySession(SFTKSession *session)
|
||||||
{
|
{
|
||||||
SFTKObjectList *op, *next;
|
SFTKObjectList *op, *next;
|
||||||
PORT_Assert(session->refCount == 0);
|
|
||||||
|
|
||||||
/* clean out the attributes */
|
/* clean out the attributes */
|
||||||
/* since no one is referencing us, it's safe to walk the chain
|
/* since no one is referencing us, it's safe to walk the chain
|
||||||
|
|
@ -1885,31 +1883,20 @@ sftk_SessionFromHandle(CK_SESSION_HANDLE handle)
|
||||||
|
|
||||||
PZ_Lock(lock);
|
PZ_Lock(lock);
|
||||||
sftkqueue_find(session, handle, slot->head, slot->sessHashSize);
|
sftkqueue_find(session, handle, slot->head, slot->sessHashSize);
|
||||||
if (session)
|
|
||||||
session->refCount++;
|
|
||||||
PZ_Unlock(lock);
|
PZ_Unlock(lock);
|
||||||
|
|
||||||
return (session);
|
return (session);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* release a reference to a session handle
|
* release a reference to a session handle. This method of using SFTKSessions
|
||||||
|
* is deprecated, but the pattern should be retained until a future effort
|
||||||
|
* to refactor all SFTKSession users at once is completed.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sftk_FreeSession(SFTKSession *session)
|
sftk_FreeSession(SFTKSession *session)
|
||||||
{
|
{
|
||||||
PRBool destroy = PR_FALSE;
|
return;
|
||||||
SFTKSlot *slot = sftk_SlotFromSession(session);
|
|
||||||
PZLock *lock = SFTK_SESSION_LOCK(slot, session->handle);
|
|
||||||
|
|
||||||
PZ_Lock(lock);
|
|
||||||
if (session->refCount == 1)
|
|
||||||
destroy = PR_TRUE;
|
|
||||||
session->refCount--;
|
|
||||||
PZ_Unlock(lock);
|
|
||||||
|
|
||||||
if (destroy)
|
|
||||||
sftk_DestroySession(session);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue