From f46a9e22a3a377cb7ebc3ff63ea8def9113d95bf Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Fri, 6 Jan 2012 17:29:02 -0800 Subject: [PATCH] Bug 622301 - Remove now-obsolete 'callee' parameter. r=mrbkap --- content/canvas/src/CustomQS_Canvas2D.h | 8 ++++---- content/canvas/src/CustomQS_WebGL.h | 18 +++++++++--------- js/xpconnect/src/XPCQuickStubs.cpp | 3 +-- js/xpconnect/src/XPCQuickStubs.h | 21 +++++---------------- js/xpconnect/src/nsDOMQS.h | 6 ++---- js/xpconnect/src/qsgen.py | 10 ++-------- 6 files changed, 23 insertions(+), 43 deletions(-) diff --git a/content/canvas/src/CustomQS_Canvas2D.h b/content/canvas/src/CustomQS_Canvas2D.h index 3643d2f25b4..c2340f1d938 100644 --- a/content/canvas/src/CustomQS_Canvas2D.h +++ b/content/canvas/src/CustomQS_Canvas2D.h @@ -56,7 +56,7 @@ Canvas2D_SetStyleHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp, nsIDOMCanvasRenderingContext2D *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; nsresult rv = NS_OK; @@ -94,7 +94,7 @@ Canvas2D_GetStyleHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp, nsIDOMCanvasRenderingContext2D *self; xpc_qsSelfRef selfref; XPCLazyCallContext lccx(JS_CALLER, cx, obj); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, vp, &lccx)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, vp, &lccx)) return JS_FALSE; nsresult rv; @@ -301,7 +301,7 @@ nsIDOMCanvasRenderingContext2D_GetImageData(JSContext *cx, uintN argc, jsval *vp nsIDOMCanvasRenderingContext2D *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 4) @@ -360,7 +360,7 @@ nsIDOMCanvasRenderingContext2D_PutImageData(JSContext *cx, uintN argc, jsval *vp nsIDOMCanvasRenderingContext2D *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 3) diff --git a/content/canvas/src/CustomQS_WebGL.h b/content/canvas/src/CustomQS_WebGL.h index a40bb3c31a8..2f6cb862444 100644 --- a/content/canvas/src/CustomQS_WebGL.h +++ b/content/canvas/src/CustomQS_WebGL.h @@ -92,7 +92,7 @@ nsIDOMWebGLRenderingContext_BufferData(JSContext *cx, uintN argc, jsval *vp) nsIDOMWebGLRenderingContext *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 3) @@ -165,7 +165,7 @@ nsIDOMWebGLRenderingContext_BufferSubData(JSContext *cx, uintN argc, jsval *vp) nsIDOMWebGLRenderingContext *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 3) @@ -239,7 +239,7 @@ nsIDOMWebGLRenderingContext_ReadPixels(JSContext *cx, uintN argc, jsval *vp) nsIDOMWebGLRenderingContext *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 7) @@ -299,7 +299,7 @@ nsIDOMWebGLRenderingContext_TexImage2D(JSContext *cx, uintN argc, jsval *vp) nsIDOMWebGLRenderingContext *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 6 || argc == 7 || argc == 8) @@ -420,7 +420,7 @@ nsIDOMWebGLRenderingContext_TexSubImage2D(JSContext *cx, uintN argc, jsval *vp) nsIDOMWebGLRenderingContext *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 7 || argc == 8) @@ -531,7 +531,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_iv(JSContext *cx, uintN argc, jsval nsIDOMWebGLRenderingContext *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 2) @@ -605,7 +605,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_fv(JSContext *cx, uintN argc, jsval nsIDOMWebGLRenderingContext *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 2) @@ -677,7 +677,7 @@ helper_nsIDOMWebGLRenderingContext_UniformMatrix_x_fv(JSContext *cx, uintN argc, nsIDOMWebGLRenderingContext *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 3) @@ -750,7 +750,7 @@ helper_nsIDOMWebGLRenderingContext_VertexAttrib_x_fv(JSContext *cx, uintN argc, nsIDOMWebGLRenderingContext *self; xpc_qsSelfRef selfref; js::AutoValueRooter tvr(cx); - if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) + if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, tvr.jsval_addr(), nsnull)) return JS_FALSE; if (argc < 2) diff --git a/js/xpconnect/src/XPCQuickStubs.cpp b/js/xpconnect/src/XPCQuickStubs.cpp index ec1fa2d803e..988a38480dd 100644 --- a/js/xpconnect/src/XPCQuickStubs.cpp +++ b/js/xpconnect/src/XPCQuickStubs.cpp @@ -778,7 +778,6 @@ getNativeFromWrapper(JSContext *cx, nsresult getWrapper(JSContext *cx, JSObject *obj, - JSObject *callee, XPCWrappedNative **wrapper, JSObject **cur, XPCWrappedNativeTearOff **tearoff) @@ -947,7 +946,7 @@ xpc_qsUnwrapArgImpl(JSContext *cx, wrapper = nsnull; obj2 = src; } else { - rv = getWrapper(cx, src, nsnull, &wrapper, &obj2, &tearoff); + rv = getWrapper(cx, src, &wrapper, &obj2, &tearoff); NS_ENSURE_SUCCESS(rv, rv); } diff --git a/js/xpconnect/src/XPCQuickStubs.h b/js/xpconnect/src/XPCQuickStubs.h index dd431a04385..a882e443d2c 100644 --- a/js/xpconnect/src/XPCQuickStubs.h +++ b/js/xpconnect/src/XPCQuickStubs.h @@ -441,7 +441,6 @@ xpc_qsStringToJsstring(JSContext *cx, nsString &str, JSString **rval); nsresult getWrapper(JSContext *cx, JSObject *obj, - JSObject *callee, XPCWrappedNative **wrapper, JSObject **cur, XPCWrappedNativeTearOff **tearoff); @@ -477,7 +476,6 @@ template inline JSBool xpc_qsUnwrapThis(JSContext *cx, JSObject *obj, - JSObject *callee, T **ppThis, nsISupports **pThisRef, jsval *pThisVal, @@ -486,7 +484,7 @@ xpc_qsUnwrapThis(JSContext *cx, { XPCWrappedNative *wrapper; XPCWrappedNativeTearOff *tearoff; - nsresult rv = getWrapper(cx, obj, callee, &wrapper, &obj, &tearoff); + nsresult rv = getWrapper(cx, obj, &wrapper, &obj, &tearoff); if (NS_SUCCEEDED(rv)) rv = castNative(cx, wrapper, obj, tearoff, NS_GET_TEMPLATE_IID(T), reinterpret_cast(ppThis), pThisRef, pThisVal, @@ -503,7 +501,6 @@ xpc_qsUnwrapThis(JSContext *cx, inline nsISupports* castNativeFromWrapper(JSContext *cx, JSObject *obj, - JSObject *callee, PRUint32 interfaceBit, nsISupports **pRef, jsval *pVal, @@ -514,17 +511,9 @@ castNativeFromWrapper(JSContext *cx, XPCWrappedNativeTearOff *tearoff; JSObject *cur; - if (!callee && IS_WRAPPER_CLASS(js::GetObjectClass(obj))) { - cur = obj; - wrapper = IS_WN_WRAPPER_OBJECT(cur) ? - (XPCWrappedNative*)xpc_GetJSPrivate(obj) : - nsnull; - tearoff = nsnull; - } else { - *rv = getWrapper(cx, obj, callee, &wrapper, &cur, &tearoff); - if (NS_FAILED(*rv)) - return nsnull; - } + *rv = getWrapper(cx, obj, &wrapper, &cur, &tearoff); + if (NS_FAILED(*rv)) + return nsnull; nsISupports *native; if (wrapper) { @@ -617,7 +606,7 @@ castNativeArgFromWrapper(JSContext *cx, if (!src) return nsnull; - return castNativeFromWrapper(cx, src, nsnull, bit, pArgRef, vp, nsnull, rv); + return castNativeFromWrapper(cx, src, bit, pArgRef, vp, nsnull, rv); } inline nsWrapperCache* diff --git a/js/xpconnect/src/nsDOMQS.h b/js/xpconnect/src/nsDOMQS.h index 10eff44f49a..fea75ff9094 100644 --- a/js/xpconnect/src/nsDOMQS.h +++ b/js/xpconnect/src/nsDOMQS.h @@ -44,7 +44,6 @@ template <> \ inline JSBool \ xpc_qsUnwrapThis<_interface>(JSContext *cx, \ JSObject *obj, \ - JSObject *callee, \ _interface **ppThis, \ nsISupports **pThisRef, \ jsval *pThisVal, \ @@ -52,7 +51,7 @@ xpc_qsUnwrapThis<_interface>(JSContext *cx, \ bool failureFatal) \ { \ nsresult rv; \ - nsISupports *native = castNativeFromWrapper(cx, obj, callee, _bit, \ + nsISupports *native = castNativeFromWrapper(cx, obj, _bit, \ pThisRef, pThisVal, lccx, \ &rv); \ *ppThis = NULL; /* avoids uninitialized warnings in callers */ \ @@ -108,7 +107,6 @@ template <> inline JSBool xpc_qsUnwrapThis(JSContext *cx, JSObject *obj, - JSObject *callee, nsGenericElement **ppThis, nsISupports **pThisRef, jsval *pThisVal, @@ -117,7 +115,7 @@ xpc_qsUnwrapThis(JSContext *cx, { nsIContent *content; jsval val; - JSBool ok = xpc_qsUnwrapThis(cx, obj, callee, &content, + JSBool ok = xpc_qsUnwrapThis(cx, obj, &content, pThisRef, &val, lccx, failureFatal); if (ok) { diff --git a/js/xpconnect/src/qsgen.py b/js/xpconnect/src/qsgen.py index 4e4f10f3d11..7348db711d9 100644 --- a/js/xpconnect/src/qsgen.py +++ b/js/xpconnect/src/qsgen.py @@ -863,12 +863,6 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False): "JSVAL_TO_OBJECT(JS_CALLEE(cx, vp)));\n") if isInterfaceType(member.realtype): f.write(" XPCLazyCallContext lccx(ccx);\n") - elif isInterfaceType(member.realtype): - if isMethod: - f.write(" JSObject *callee = " - "JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));\n") - elif isGetter: - f.write(" JSObject *callee = nsnull;\n") # Get the 'self' pointer. if customMethodCall is None or not 'thisType' in customMethodCall: @@ -900,10 +894,10 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False): if not isSetter and isInterfaceType(member.realtype): f.write(" XPCLazyCallContext lccx(JS_CALLER, cx, obj);\n") - f.write(" if (!xpc_qsUnwrapThis(cx, obj, callee, &self, " + f.write(" if (!xpc_qsUnwrapThis(cx, obj, &self, " "&selfref.ptr, %s, &lccx, %s))\n" % (pthisval, unwrapFatalArg)) else: - f.write(" if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, " + f.write(" if (!xpc_qsUnwrapThis(cx, obj, &self, " "&selfref.ptr, %s, nsnull, %s))\n" % (pthisval, unwrapFatalArg)) f.write(" return JS_FALSE;\n")