From b93dfd732b99a215482967a196cd990ddedd313d Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Fri, 5 Apr 2013 21:59:06 +0200 Subject: [PATCH] Bug 854614 - Root XPCLazyCallContext. r=terrence,bholley --- js/xpconnect/src/xpcprivate.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 964dce710b1..27f63c87308 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -1309,7 +1309,7 @@ private: jsid mName; JSBool mStaticMemberIsLocal; - unsigned mArgc; + unsigned mArgc; jsval* mArgv; jsval* mRetVal; @@ -1322,15 +1322,13 @@ public: XPCLazyCallContext(XPCCallContext& ccx) : mCallBeginRequest(DONT_CALL_BEGINREQUEST), mCcx(&ccx), - mCcxToDestroy(nullptr) -#ifdef DEBUG - , mCx(nullptr) - , mCallerLanguage(JS_CALLER) - , mObj(nullptr) - , mFlattenedJSObject(nullptr) - , mWrapper(nullptr) - , mTearOff(nullptr) -#endif + mCcxToDestroy(nullptr), + mCx(nullptr), + mCallerLanguage(JS_CALLER), + mObj(ccx.GetJSContext(), nullptr), + mFlattenedJSObject(ccx.GetJSContext(), nullptr), + mWrapper(nullptr), + mTearOff(nullptr) { } XPCLazyCallContext(XPCContext::LangType callerLanguage, JSContext* cx, @@ -1344,8 +1342,8 @@ public: mCcxToDestroy(nullptr), mCx(cx), mCallerLanguage(callerLanguage), - mObj(obj), - mFlattenedJSObject(flattenedJSObject), + mObj(cx, obj), + mFlattenedJSObject(cx, flattenedJSObject), mWrapper(wrapper), mTearOff(tearoff) { @@ -1437,8 +1435,8 @@ private: XPCCallContext *mCcxToDestroy; JSContext *mCx; XPCContext::LangType mCallerLanguage; - JSObject *mObj; - JSObject *mFlattenedJSObject; + JS::RootedObject mObj; + JS::RootedObject mFlattenedJSObject; XPCWrappedNative *mWrapper; XPCWrappedNativeTearOff *mTearOff; mozilla::AlignedStorage2 mData;