From ef160fa4e60e28d513dcf14a63af666e287cbbd7 Mon Sep 17 00:00:00 2001 From: "reed%reedloden.com" Date: Mon, 25 Feb 2008 08:59:21 +0000 Subject: [PATCH] Bug 417710 - "Use JS_GET_CLASS, not JS_GetClass" [p=gyuyoung.kim@samsung.com (gyu-young kim) r=jorendorff r=jst sr+a1.9=brendan] git-svn-id: svn://10.0.0.236/trunk@246437 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/caps/src/nsSecurityManagerFactory.cpp | 2 +- mozilla/content/xbl/src/nsXBLBinding.cpp | 6 +++--- mozilla/dom/src/base/nsDOMClassInfo.h | 2 +- mozilla/dom/src/base/nsJSEnvironment.cpp | 2 +- .../embedding/components/windowwatcher/src/nsWWJSUtils.cpp | 6 +----- mozilla/js/src/liveconnect/jsj_JavaClass.c | 6 +----- mozilla/xpinstall/src/nsXPITriggerInfo.cpp | 6 +----- 7 files changed, 9 insertions(+), 21 deletions(-) diff --git a/mozilla/caps/src/nsSecurityManagerFactory.cpp b/mozilla/caps/src/nsSecurityManagerFactory.cpp index 982ce8ca74a..6573773315e 100644 --- a/mozilla/caps/src/nsSecurityManagerFactory.cpp +++ b/mozilla/caps/src/nsSecurityManagerFactory.cpp @@ -301,7 +301,7 @@ nsSecurityNameSet::InitializeNameSet(nsIScriptContext* aScriptContext) JSAutoRequest ar(cx); while ((proto = JS_GetPrototype(cx, obj)) != nsnull) obj = proto; - JSClass *objectClass = JS_GetClass(cx, obj); + JSClass *objectClass = JS_GET_CLASS(cx, obj); jsval v; if (!JS_GetProperty(cx, global, "netscape", &v)) diff --git a/mozilla/content/xbl/src/nsXBLBinding.cpp b/mozilla/content/xbl/src/nsXBLBinding.cpp index b1d982980c9..7a7ca8c5434 100644 --- a/mozilla/content/xbl/src/nsXBLBinding.cpp +++ b/mozilla/content/xbl/src/nsXBLBinding.cpp @@ -120,7 +120,7 @@ XBLFinalize(JSContext *cx, JSObject *obj) static_cast(::JS_GetPrivate(cx, obj)); NS_RELEASE(docInfo); - nsXBLJSClass* c = static_cast(::JS_GetClass(cx, obj)); + nsXBLJSClass* c = static_cast(::JS_GET_CLASS(cx, obj)); c->Drop(); } @@ -158,7 +158,7 @@ XBLResolve(JSContext *cx, JSObject *obj, jsval id, uintN flags, } // We have this field. Time to install it. Get our node. - JSClass* nodeClass = ::JS_GetClass(cx, origObj); + JSClass* nodeClass = ::JS_GET_CLASS(cx, origObj); if (!nodeClass) { return JS_FALSE; } @@ -1085,7 +1085,7 @@ nsXBLBinding::ChangeDocument(nsIDocument* aOldDocument, nsIDocument* aNewDocumen break; } - JSClass* clazz = ::JS_GetClass(cx, proto); + JSClass* clazz = ::JS_GET_CLASS(cx, proto); if (!clazz || (~clazz->flags & (JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS)) || diff --git a/mozilla/dom/src/base/nsDOMClassInfo.h b/mozilla/dom/src/base/nsDOMClassInfo.h index 8e187ebbaee..0d806061d76 100644 --- a/mozilla/dom/src/base/nsDOMClassInfo.h +++ b/mozilla/dom/src/base/nsDOMClassInfo.h @@ -169,7 +169,7 @@ public: #endif return sXPCNativeWrapperClass && - ::JS_GetClass(cx, obj) == sXPCNativeWrapperClass; + ::JS_GET_CLASS(cx, obj) == sXPCNativeWrapperClass; } static nsresult PreserveNodeWrapper(nsIXPConnectWrappedNative *aWrapper); diff --git a/mozilla/dom/src/base/nsJSEnvironment.cpp b/mozilla/dom/src/base/nsJSEnvironment.cpp index c4073ef97c3..22f4cb44716 100644 --- a/mozilla/dom/src/base/nsJSEnvironment.cpp +++ b/mozilla/dom/src/base/nsJSEnvironment.cpp @@ -2824,7 +2824,7 @@ nsJSContext::FindXPCNativeWrapperClass(nsIXPConnectJSObjectHolder *aHolder) NS_ASSERTION(JSVAL_IS_OBJECT(wrapper), "This should be an object!"); NS_DOMClassInfo_SetXPCNativeWrapperClass( - ::JS_GetClass(mContext, JSVAL_TO_OBJECT(wrapper))); + ::JS_GET_CLASS(mContext, JSVAL_TO_OBJECT(wrapper))); return NS_OK; } diff --git a/mozilla/embedding/components/windowwatcher/src/nsWWJSUtils.cpp b/mozilla/embedding/components/windowwatcher/src/nsWWJSUtils.cpp index 63083608986..866423fad63 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsWWJSUtils.cpp +++ b/mozilla/embedding/components/windowwatcher/src/nsWWJSUtils.cpp @@ -60,11 +60,7 @@ nsWWJSUtils::GetStaticScriptGlobal(JSContext* aContext, JSObject* aObj) while (nsnull != (parent = JS_GetParent(aContext, glob))) glob = parent; -#ifdef JS_THREADSAFE - clazz = JS_GetClass(aContext, glob); -#else - clazz = JS_GetClass(glob); -#endif + clazz = JS_GET_CLASS(aContext, glob); if (!clazz || !(clazz->flags & JSCLASS_HAS_PRIVATE) || diff --git a/mozilla/js/src/liveconnect/jsj_JavaClass.c b/mozilla/js/src/liveconnect/jsj_JavaClass.c index 715b95291f1..8ce3ce88967 100644 --- a/mozilla/js/src/liveconnect/jsj_JavaClass.c +++ b/mozilla/js/src/liveconnect/jsj_JavaClass.c @@ -512,11 +512,7 @@ JavaClass_hasInstance(JSContext *cx, JSObject *obj, jsval candidate_jsval, if (!JSVAL_IS_OBJECT(candidate_jsval)) goto done; candidate_obj = JSVAL_TO_OBJECT(candidate_jsval); -#ifdef JS_THREADSAFE - js_class = JS_GetClass(cx, candidate_obj); -#else - js_class = JS_GetClass(candidate_obj); -#endif + js_class = JS_GET_CLASS(cx, candidate_obj); if ((js_class != &JavaObject_class) && (js_class != &JavaArray_class)) goto done; diff --git a/mozilla/xpinstall/src/nsXPITriggerInfo.cpp b/mozilla/xpinstall/src/nsXPITriggerInfo.cpp index 54232fc314a..e5183a8c3af 100644 --- a/mozilla/xpinstall/src/nsXPITriggerInfo.cpp +++ b/mozilla/xpinstall/src/nsXPITriggerInfo.cpp @@ -211,11 +211,7 @@ void nsXPITriggerInfo::SaveCallback( JSContext *aCx, jsval aVal ) JSClass* clazz; -#ifdef JS_THREADSAFE - clazz = ::JS_GetClass(aCx, obj); -#else - clazz = ::JS_GetClass(obj); -#endif + clazz = ::JS_GET_CLASS(aCx, obj); if (clazz && (clazz->flags & JSCLASS_HAS_PRIVATE) &&