Back out jst's patch from bug 407819 to see if it fixes qm-centos5-01's mochitest failures.

This commit is contained in:
reed@reedloden.com 2007-12-10 19:48:02 -08:00
parent 867dfb80ed
commit f09f67bea1
3 changed files with 16 additions and 29 deletions

View File

@ -251,11 +251,6 @@ extern const char XPC_XPCONNECT_CONTRACTID[];
*dest = result; \
return (result || !src) ? NS_OK : NS_ERROR_OUT_OF_MEMORY
#define IS_WRAPPER_CLASS(clazz) \
((clazz) == &XPC_WN_NoHelper_JSClass.base || \
(clazz)->getObjectOps == XPC_WN_GetObjectOpsNoCall || \
(clazz)->getObjectOps == XPC_WN_GetObjectOpsWithCall)
/***************************************************************************/
// Auto locking support class...

View File

@ -1252,6 +1252,11 @@ XPCWrappedNative::ReparentWrapperIfFound(XPCCallContext& ccx,
return NS_OK;
}
#define IS_WRAPPER_CLASS(clazz) \
((clazz) == &XPC_WN_NoHelper_JSClass.base || \
(clazz)->getObjectOps == XPC_WN_GetObjectOpsNoCall || \
(clazz)->getObjectOps == XPC_WN_GetObjectOpsWithCall)
#define IS_TEAROFF_CLASS(clazz) \
((clazz) == &XPC_WN_Tearoff_JSClass)

View File

@ -631,35 +631,22 @@ GetScopeOfObject(JSContext* cx, JSObject* obj)
nsISupports* supports;
JSClass* clazz = JS_GET_CLASS(cx, obj);
if(!IS_WRAPPER_CLASS(clazz) ||
if(!clazz ||
!(clazz->flags & JSCLASS_HAS_PRIVATE) ||
!(clazz->flags & JSCLASS_PRIVATE_IS_NSISUPPORTS) ||
!(supports = (nsISupports*) JS_GetPrivate(cx, obj)))
{
#ifdef DEBUG
{
if(clazz->flags & JSCLASS_HAS_PRIVATE &&
clazz->flags & JSCLASS_PRIVATE_IS_NSISUPPORTS)
{
nsCOMPtr<nsIXPConnectWrappedNative> iface =
do_QueryInterface((nsISupports*) JS_GetPrivate(cx, obj));
NS_ASSERTION(!iface, "Uh, how'd this happen?");
}
}
#endif
return nsnull;
}
#ifdef DEBUG
{
nsCOMPtr<nsIXPConnectWrappedNative> iface = do_QueryInterface(supports);
NS_ASSERTION(iface, "Uh, how'd this happen?");
}
#endif
// obj is one of our nsXPConnectWrappedNative objects.
if(iface)
{
// We can fairly safely assume that this is really one of our
// nsXPConnectWrappedNative objects. No other component in our
// universe should be creating objects that implement the
// nsIXPConnectWrappedNative interface!
return ((XPCWrappedNative*)supports)->GetScope();
}
return nsnull;
}