mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 720580 - Make the call to PostCreatePrototype optional. r=mrbkap
This commit is contained in:
parent
ea2172967e
commit
8fbe582aea
@ -89,7 +89,8 @@ XPCWrappedNativeProto::~XPCWrappedNativeProto()
|
||||
|
||||
JSBool
|
||||
XPCWrappedNativeProto::Init(XPCCallContext& ccx,
|
||||
const XPCNativeScriptableCreateInfo* scriptableCreateInfo)
|
||||
const XPCNativeScriptableCreateInfo* scriptableCreateInfo,
|
||||
bool callPostCreatePrototype)
|
||||
{
|
||||
nsIXPCScriptable *callback = scriptableCreateInfo ?
|
||||
scriptableCreateInfo->GetCallback() :
|
||||
@ -130,7 +131,8 @@ XPCWrappedNativeProto::Init(XPCCallContext& ccx,
|
||||
bool success = !!mJSProtoObject;
|
||||
if (success) {
|
||||
JS_SetPrivate(mJSProtoObject, this);
|
||||
success = CallPostCreatePrototype(ccx);
|
||||
if (callPostCreatePrototype)
|
||||
success = CallPostCreatePrototype(ccx);
|
||||
}
|
||||
|
||||
DEBUG_ReportShadowedMembers(mSet, nsnull, this);
|
||||
@ -207,7 +209,8 @@ XPCWrappedNativeProto::GetNewOrUsed(XPCCallContext& ccx,
|
||||
XPCWrappedNativeScope* scope,
|
||||
nsIClassInfo* classInfo,
|
||||
const XPCNativeScriptableCreateInfo* scriptableCreateInfo,
|
||||
QITableEntry* offsets)
|
||||
QITableEntry* offsets,
|
||||
bool callPostCreatePrototype)
|
||||
{
|
||||
NS_ASSERTION(scope, "bad param");
|
||||
NS_ASSERTION(classInfo, "bad param");
|
||||
@ -237,7 +240,7 @@ XPCWrappedNativeProto::GetNewOrUsed(XPCCallContext& ccx,
|
||||
|
||||
proto = new XPCWrappedNativeProto(scope, classInfo, ciFlags, set, offsets);
|
||||
|
||||
if (!proto || !proto->Init(ccx, scriptableCreateInfo)) {
|
||||
if (!proto || !proto->Init(ccx, scriptableCreateInfo, callPostCreatePrototype)) {
|
||||
delete proto.get();
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -2204,7 +2204,8 @@ public:
|
||||
XPCWrappedNativeScope* scope,
|
||||
nsIClassInfo* classInfo,
|
||||
const XPCNativeScriptableCreateInfo* scriptableCreateInfo,
|
||||
QITableEntry* offsets = UNKNOWN_OFFSETS);
|
||||
QITableEntry* offsets = UNKNOWN_OFFSETS,
|
||||
bool callPostCreatePrototype = true);
|
||||
|
||||
XPCWrappedNativeScope*
|
||||
GetScope() const {return mScope;}
|
||||
@ -2333,7 +2334,8 @@ protected:
|
||||
QITableEntry* offsets);
|
||||
|
||||
JSBool Init(XPCCallContext& ccx,
|
||||
const XPCNativeScriptableCreateInfo* scriptableCreateInfo);
|
||||
const XPCNativeScriptableCreateInfo* scriptableCreateInfo,
|
||||
bool callPostCreatePrototype);
|
||||
|
||||
private:
|
||||
#if defined(DEBUG_xpc_hacker) || defined(DEBUG)
|
||||
|
Loading…
Reference in New Issue
Block a user