зеркало из https://github.com/mozilla/pjs.git
Bug 700172 - Fix XBL_DeserializeFunction's signature; r=enn
This commit is contained in:
Родитель
6a930fb717
Коммит
d13fb1e897
|
@ -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__
|
||||
|
|
Загрузка…
Ссылка в новой задаче