Bug 700172 - Fix XBL_DeserializeFunction's signature; r=enn

This commit is contained in:
Ms2ger 2011-11-16 08:50:18 +01:00
Родитель 6a930fb717
Коммит d13fb1e897
4 изменённых файлов: 11 добавлений и 21 удалений

Просмотреть файл

@ -272,9 +272,7 @@ nsresult
nsXBLProtoImplMethod::Read(nsIScriptContext* aContext,
nsIObjectInputStream* aStream)
{
void* methodCode;
nsresult rv = XBL_DeserializeFunction(aContext, aStream, this, &methodCode);
mJSMethodObject = (JSObject *)methodCode;
nsresult rv = XBL_DeserializeFunction(aContext, aStream, &mJSMethodObject);
if (NS_FAILED(rv)) {
SetUncompiledMethod(nsnull);
return rv;

Просмотреть файл

@ -360,24 +360,23 @@ nsXBLProtoImplProperty::Read(nsIScriptContext* aContext,
nsIObjectInputStream* aStream,
XBLBindingSerializeDetails aType)
{
nsresult rv;
void* scriptObject;
if (aType == XBLBinding_Serialize_GetterProperty ||
aType == XBLBinding_Serialize_GetterSetterProperty) {
rv = XBL_DeserializeFunction(aContext, aStream, this, &scriptObject);
JSObject* getterObject;
nsresult rv = XBL_DeserializeFunction(aContext, aStream, &getterObject);
NS_ENSURE_SUCCESS(rv, rv);
mJSGetterObject = (JSObject *)scriptObject;
mJSGetterObject = getterObject;
mJSAttributes |= JSPROP_GETTER | JSPROP_SHARED;
}
if (aType == XBLBinding_Serialize_SetterProperty ||
aType == XBLBinding_Serialize_GetterSetterProperty) {
rv = XBL_DeserializeFunction(aContext, aStream, this, &scriptObject);
JSObject* setterObject;
nsresult rv = XBL_DeserializeFunction(aContext, aStream, &setterObject);
NS_ENSURE_SUCCESS(rv, rv);
mJSSetterObject = (JSObject *)scriptObject;
mJSSetterObject = setterObject;
mJSAttributes |= JSPROP_SETTER | JSPROP_SHARED;
}

Просмотреть файл

@ -75,12 +75,9 @@ XBL_SerializeFunction(nsIScriptContext* aContext,
nsresult
XBL_DeserializeFunction(nsIScriptContext* aContext,
nsIObjectInputStream* aStream,
void* aHolder,
void **aScriptObject)
JSObject** aFunctionObject)
{
*aScriptObject = nsnull;
JSObject* functionObject = nsnull;
*aFunctionObject = nsnull;
PRUint32 size;
nsresult rv = aStream->Read32(&size);
@ -101,7 +98,7 @@ XBL_DeserializeFunction(nsIScriptContext* aContext,
JSAutoRequest ar(cx);
JS_XDRMemSetData(xdr, data, size);
if (!JS_XDRFunctionObject(xdr, &functionObject)) {
if (!JS_XDRFunctionObject(xdr, aFunctionObject)) {
rv = NS_ERROR_FAILURE;
}
@ -113,8 +110,5 @@ XBL_DeserializeFunction(nsIScriptContext* aContext,
nsMemory::Free(data);
NS_ENSURE_SUCCESS(rv, rv);
*aScriptObject = functionObject;
return rv;
}

Просмотреть файл

@ -113,7 +113,6 @@ XBL_SerializeFunction(nsIScriptContext* aContext,
nsresult
XBL_DeserializeFunction(nsIScriptContext* aContext,
nsIObjectInputStream* aStream,
void* aHolder,
void **aScriptObject);
JSObject** aFunctionObject);
#endif // nsXBLSerialize_h__