mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 966766, part 3 - Rename clazz to clasp in XPCWrappedJSClass::GetNewOrUsed. r=gabor
This commit is contained in:
parent
8f6860165e
commit
e71a246ee9
@ -101,16 +101,16 @@ bool xpc_IsReportableErrorCode(nsresult code)
|
|||||||
// static
|
// static
|
||||||
nsresult
|
nsresult
|
||||||
nsXPCWrappedJSClass::GetNewOrUsed(JSContext* cx, REFNSIID aIID,
|
nsXPCWrappedJSClass::GetNewOrUsed(JSContext* cx, REFNSIID aIID,
|
||||||
nsXPCWrappedJSClass** resultClazz)
|
nsXPCWrappedJSClass** resultClasp)
|
||||||
{
|
{
|
||||||
nsXPCWrappedJSClass* clazz = nullptr;
|
nsXPCWrappedJSClass* clasp = nullptr;
|
||||||
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
||||||
|
|
||||||
IID2WrappedJSClassMap* map = rt->GetWrappedJSClassMap();
|
IID2WrappedJSClassMap* map = rt->GetWrappedJSClassMap();
|
||||||
clazz = map->Find(aIID);
|
clasp = map->Find(aIID);
|
||||||
NS_IF_ADDREF(clazz);
|
NS_IF_ADDREF(clasp);
|
||||||
|
|
||||||
if (!clazz) {
|
if (!clasp) {
|
||||||
nsCOMPtr<nsIInterfaceInfo> info;
|
nsCOMPtr<nsIInterfaceInfo> info;
|
||||||
nsXPConnect::XPConnect()->GetInfoForIID(&aIID, getter_AddRefs(info));
|
nsXPConnect::XPConnect()->GetInfoForIID(&aIID, getter_AddRefs(info));
|
||||||
if (info) {
|
if (info) {
|
||||||
@ -118,14 +118,14 @@ nsXPCWrappedJSClass::GetNewOrUsed(JSContext* cx, REFNSIID aIID,
|
|||||||
if (NS_SUCCEEDED(info->IsScriptable(&canScript)) && canScript &&
|
if (NS_SUCCEEDED(info->IsScriptable(&canScript)) && canScript &&
|
||||||
NS_SUCCEEDED(info->IsBuiltinClass(&isBuiltin)) && !isBuiltin &&
|
NS_SUCCEEDED(info->IsBuiltinClass(&isBuiltin)) && !isBuiltin &&
|
||||||
nsXPConnect::IsISupportsDescendant(info)) {
|
nsXPConnect::IsISupportsDescendant(info)) {
|
||||||
clazz = new nsXPCWrappedJSClass(cx, aIID, info);
|
clasp = new nsXPCWrappedJSClass(cx, aIID, info);
|
||||||
NS_ADDREF(clazz);
|
NS_ADDREF(clasp);
|
||||||
if (!clazz->mDescriptors)
|
if (!clasp->mDescriptors)
|
||||||
NS_RELEASE(clazz); // sets clazz to nullptr
|
NS_RELEASE(clasp); // sets clasp to nullptr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*resultClazz = clazz;
|
*resultClasp = clasp;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user