mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 860027 - lazily get the list of interfaces r=bholley
This commit is contained in:
parent
b53dcf2bff
commit
e6f2cf55d3
@ -218,7 +218,6 @@ nsXPCComponents_Interfaces::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
|
||||
|
||||
nsXPCComponents_Interfaces::nsXPCComponents_Interfaces()
|
||||
{
|
||||
XPTInterfaceInfoManager::GetSingleton()->GetScriptableInterfaces(mInterfaces);
|
||||
}
|
||||
|
||||
nsXPCComponents_Interfaces::~nsXPCComponents_Interfaces()
|
||||
@ -259,6 +258,13 @@ nsXPCComponents_Interfaces::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
|
||||
case JSENUMERATE_INIT:
|
||||
case JSENUMERATE_INIT_ALL:
|
||||
{
|
||||
// Lazily init the list of interfaces when someone tries to
|
||||
// enumerate them.
|
||||
if (mInterfaces.IsEmpty()) {
|
||||
XPTInterfaceInfoManager::GetSingleton()->
|
||||
GetScriptableInterfaces(mInterfaces);
|
||||
}
|
||||
|
||||
*statep = JSVAL_ZERO;
|
||||
if (idp)
|
||||
*idp = INT_TO_JSID(mInterfaces.Length());
|
||||
@ -500,7 +506,6 @@ nsXPCComponents_InterfacesByID::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
|
||||
|
||||
nsXPCComponents_InterfacesByID::nsXPCComponents_InterfacesByID()
|
||||
{
|
||||
XPTInterfaceInfoManager::GetSingleton()->GetScriptableInterfaces(mInterfaces);
|
||||
}
|
||||
|
||||
nsXPCComponents_InterfacesByID::~nsXPCComponents_InterfacesByID()
|
||||
@ -539,6 +544,13 @@ nsXPCComponents_InterfacesByID::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
|
||||
case JSENUMERATE_INIT:
|
||||
case JSENUMERATE_INIT_ALL:
|
||||
{
|
||||
// Lazily init the list of interfaces when someone tries to
|
||||
// enumerate them.
|
||||
if (mInterfaces.IsEmpty()) {
|
||||
XPTInterfaceInfoManager::GetSingleton()->
|
||||
GetScriptableInterfaces(mInterfaces);
|
||||
}
|
||||
|
||||
*statep = JSVAL_ZERO;
|
||||
if (idp)
|
||||
*idp = INT_TO_JSID(mInterfaces.Length());
|
||||
|
Loading…
Reference in New Issue
Block a user