Merge for backout of changeset c8d43645a578 (bug 320954)

This commit is contained in:
Phil Ringnalda 2009-02-07 14:39:37 -08:00
Родитель 44b0b9bafd 2645386078
Коммит de24d35bdf
1 изменённых файлов: 9 добавлений и 18 удалений

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

@ -81,27 +81,22 @@
// We must ensure that the nsNSSComponent has been loaded before
// creating any other components.
static nsresult EnsureNSSInitialized(PRBool triggeredByNSSComponent)
static void EnsureNSSInitialized(PRBool triggeredByNSSComponent)
{
static PRBool haveLoaded = PR_FALSE;
if (haveLoaded)
return NS_OK;
return;
haveLoaded = PR_TRUE;
if (triggeredByNSSComponent) {
// We must prevent a recursion, as nsNSSComponent creates
// additional instances
return NS_OK;
return;
}
nsresult rv;
nsCOMPtr<nsISupports> nssComponent
= do_GetService(PSM_COMPONENT_CONTRACTID, &rv);
if (NS_FAILED(rv))
return rv;
haveLoaded = PR_TRUE;
return NS_OK;
= do_GetService(PSM_COMPONENT_CONTRACTID);
}
// These two macros are ripped off from nsIGenericFactory.h and slightly
@ -115,9 +110,7 @@ _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID, \
nsresult rv; \
_InstanceClass * inst; \
\
rv = EnsureNSSInitialized(triggeredByNSSComponent); \
if (NS_FAILED(rv)) \
return rv; \
EnsureNSSInitialized(triggeredByNSSComponent); \
\
*aResult = NULL; \
if (NULL != aOuter) { \
@ -147,9 +140,7 @@ _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID, \
nsresult rv; \
_InstanceClass * inst; \
\
rv = EnsureNSSInitialized(triggeredByNSSComponent); \
if (NS_FAILED(rv)) \
return rv; \
EnsureNSSInitialized(triggeredByNSSComponent); \
\
*aResult = NULL; \
if (NULL != aOuter) { \