зеркало из https://github.com/mozilla/gecko-dev.git
Partially back out fix for bug 461563 to try to fix Txul regression on Windows.
This commit is contained in:
Родитель
63da61f52c
Коммит
88b6c463de
|
@ -467,16 +467,31 @@ XPCConvert::NativeData2JS(XPCCallContext& ccx, jsval* d, const void* s,
|
|||
// global object will not have been collected, and
|
||||
// therefore this NativeInterface2JSObject will not end up
|
||||
// creating a new XPCNativeScriptableShared.
|
||||
if(!NativeInterface2JSObject(ccx, d, nsnull, iface, iid,
|
||||
scope, PR_TRUE,
|
||||
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
||||
if(!NativeInterface2JSObject(ccx, d,
|
||||
getter_AddRefs(holder), iface,
|
||||
iid, scope, PR_TRUE,
|
||||
OBJ_IS_NOT_GLOBAL, pErr))
|
||||
return JS_FALSE;
|
||||
|
||||
#ifdef DEBUG
|
||||
JSObject* jsobj = JSVAL_TO_OBJECT(*d);
|
||||
if(jsobj && !STOBJ_GET_PARENT(jsobj))
|
||||
NS_ASSERTION(STOBJ_GET_CLASS(jsobj)->flags & JSCLASS_IS_GLOBAL,
|
||||
"Why did we recreate this wrapper?");
|
||||
if(holder)
|
||||
{
|
||||
JSObject* jsobj;
|
||||
|
||||
if(NS_SUCCEEDED(holder->GetJSObject(&jsobj)))
|
||||
{
|
||||
NS_ASSERTION(*d == OBJECT_TO_JSVAL(jsobj),
|
||||
"Returned jsval is not the jsobj?");
|
||||
if(!STOBJ_GET_PARENT(jsobj))
|
||||
NS_ASSERTION(STOBJ_GET_CLASS(jsobj)->flags & JSCLASS_IS_GLOBAL,
|
||||
"Why did we recreate this wrapper?");
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_NOTREACHED("Got a holder without an object?");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1347,10 +1347,12 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16 methodIndex,
|
|||
const_cast<nsIID*>
|
||||
(&NS_GET_IID(nsISupports));
|
||||
jsval v;
|
||||
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
||||
JSBool ok =
|
||||
XPCConvert::NativeInterface2JSObject(ccx,
|
||||
&v, nsnull, newThis, newWrapperIID, obj,
|
||||
PR_FALSE, PR_FALSE, nsnull);
|
||||
&v, getter_AddRefs(holder), newThis,
|
||||
newWrapperIID, obj, PR_FALSE, PR_FALSE,
|
||||
nsnull);
|
||||
if(newWrapperIID != &NS_GET_IID(nsISupports))
|
||||
nsMemory::Free(newWrapperIID);
|
||||
if(!ok)
|
||||
|
|
Загрузка…
Ссылка в новой задаче