mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 751454 - Use automarker for XPCNativeScriptableInfo (r=bholley)
This commit is contained in:
parent
f4f2e1efb0
commit
1ca53de65f
@ -348,8 +348,9 @@ XPCWrappedNative::WrapNewGlobal(XPCCallContext &ccx, xpcObjectHelper &nativeHelp
|
||||
|
||||
// ...and then ScriptableInfo. We need all this stuff now because it's going
|
||||
// to tell us the JSClass of the object we're going to create.
|
||||
XPCNativeScriptableInfo *si = XPCNativeScriptableInfo::Construct(ccx, &sciWrapper);
|
||||
MOZ_ASSERT(si);
|
||||
AutoMarkingNativeScriptableInfoPtr
|
||||
si(ccx, XPCNativeScriptableInfo::Construct(ccx, &sciWrapper));
|
||||
MOZ_ASSERT(si.get());
|
||||
|
||||
// Finally, we get to the JSClass.
|
||||
JSClass *clasp = si->GetJSClass();
|
||||
|
@ -2203,7 +2203,13 @@ public:
|
||||
void
|
||||
SetScriptableShared(XPCNativeScriptableShared* shared) {mShared = shared;}
|
||||
|
||||
void Mark() {if (mShared) mShared->Mark();}
|
||||
void Mark() {
|
||||
if (mShared)
|
||||
mShared->Mark();
|
||||
}
|
||||
|
||||
void TraceJS(JSTracer *trc) {}
|
||||
void AutoTrace(JSTracer *trc) {}
|
||||
|
||||
protected:
|
||||
XPCNativeScriptableInfo(nsIXPCScriptable* scriptable = nsnull,
|
||||
@ -4229,6 +4235,7 @@ typedef TypedAutoMarkingPtr<XPCWrappedNative> AutoMarkingWrappedNativePtr;
|
||||
typedef TypedAutoMarkingPtr<XPCWrappedNativeTearOff> AutoMarkingWrappedNativeTearOffPtr;
|
||||
typedef TypedAutoMarkingPtr<XPCWrappedNativeProto> AutoMarkingWrappedNativeProtoPtr;
|
||||
typedef TypedAutoMarkingPtr<XPCMarkableJSVal> AutoMarkingJSVal;
|
||||
typedef TypedAutoMarkingPtr<XPCNativeScriptableInfo> AutoMarkingNativeScriptableInfoPtr;
|
||||
|
||||
template<class T>
|
||||
class ArrayAutoMarkingPtr : public AutoMarkingPtr
|
||||
@ -4280,12 +4287,6 @@ class ArrayAutoMarkingPtr : public AutoMarkingPtr
|
||||
|
||||
typedef ArrayAutoMarkingPtr<XPCNativeInterface> AutoMarkingNativeInterfacePtrArrayPtr;
|
||||
|
||||
// Note: It looked like I would need one of these AutoMarkingPtr types for
|
||||
// XPCNativeScriptableInfo in order to manage marking its
|
||||
// XPCNativeScriptableShared member during construction. But AFAICT we build
|
||||
// these and bind them to rooted things so immediately that this just is not
|
||||
// needed.
|
||||
|
||||
#define AUTO_MARK_JSVAL_HELPER2(tok, line) tok##line
|
||||
#define AUTO_MARK_JSVAL_HELPER(tok, line) AUTO_MARK_JSVAL_HELPER2(tok, line)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user