Bug 427715 - nsCryptoHash apparently being called while NSS is in shutdown state [@ NSSRWLock_LockRead_Util], r=kaie

This commit is contained in:
Honza Bambas 2009-06-24 18:56:52 +02:00
Родитель c55b3f3890
Коммит 6f0a7bcb20
2 изменённых файлов: 18 добавлений и 5 удалений

Просмотреть файл

@ -317,7 +317,7 @@ PRBool EnsureNSSInitialized(EnsureNSSOperator op)
return PR_TRUE;
{
nsCOMPtr<nsISupports> nssComponent
nsCOMPtr<nsINSSComponent> nssComponent
= do_GetService(PSM_COMPONENT_CONTRACTID);
// Nss component failed to initialize, inform the caller of that fact.
@ -325,7 +325,9 @@ PRBool EnsureNSSInitialized(EnsureNSSOperator op)
if (!nssComponent)
return PR_FALSE;
return PR_TRUE;
PRBool isInitialized;
nsresult rv = nssComponent->IsNSSInitialized(&isInitialized);
return NS_SUCCEEDED(rv) && isInitialized;
}
default:
@ -2534,6 +2536,14 @@ nsNSSComponent::GetClientAuthRememberService(nsClientAuthRememberService **cars)
return NS_OK;
}
NS_IMETHODIMP
nsNSSComponent::IsNSSInitialized(PRBool *initialized)
{
nsAutoLock lock(mutex);
*initialized = mNSSInitialized;
return NS_OK;
}
//---------------------------------------------
// Implementing nsICryptoHash
//---------------------------------------------

Просмотреть файл

@ -80,10 +80,10 @@
//Define an interface that we can use to look up from the
//callbacks passed to NSS.
#define NS_INSSCOMPONENT_IID_STR "d4b49dd6-1dd1-11b2-b6fe-b14cfaf69cbd"
#define NS_INSSCOMPONENT_IID_STR "6ffbb526-205b-49c5-ae3f-5959c084075e"
#define NS_INSSCOMPONENT_IID \
{0xd4b49dd6, 0x1dd1, 0x11b2, \
{ 0xb6, 0xfe, 0xb1, 0x4c, 0xfa, 0xf6, 0x9c, 0xbd }}
{ 0x6ffbb526, 0x205b, 0x49c5, \
{ 0xae, 0x3f, 0x59, 0x59, 0xc0, 0x84, 0x7, 0x5e } };
#define NS_PSMCONTENTLISTEN_CID {0xc94f4a30, 0x64d7, 0x11d4, {0x99, 0x60, 0x00, 0xb0, 0xd0, 0x23, 0x54, 0xa0}}
#define NS_PSMCONTENTLISTEN_CONTRACTID "@mozilla.org/security/psmdownload;1"
@ -186,6 +186,8 @@ class NS_NO_VTABLE nsINSSComponent : public nsISupports {
NS_IMETHOD GetClientAuthRememberService(nsClientAuthRememberService **cars) = 0;
NS_IMETHOD EnsureIdentityInfoLoaded() = 0;
NS_IMETHOD IsNSSInitialized(PRBool *initialized) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsINSSComponent, NS_INSSCOMPONENT_IID)
@ -275,6 +277,7 @@ public:
NS_IMETHOD DispatchEvent(const nsAString &eventType, const nsAString &token);
NS_IMETHOD GetClientAuthRememberService(nsClientAuthRememberService **cars);
NS_IMETHOD EnsureIdentityInfoLoaded();
NS_IMETHOD IsNSSInitialized(PRBool *initialized);
private: