This commit is contained in:
dougt%netscape.com 1999-07-16 18:15:14 +00:00
Родитель ea83b0e8a2
Коммит 460e5354c1
3 изменённых файлов: 37 добавлений и 14 удалений

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

@ -176,6 +176,20 @@ typedef PRUint32 nsresult;
/* Returned when a factory already is registered */
#define NS_ERROR_FACTORY_EXISTS (NS_ERROR_BASE + 0x100)
/* Returned when a proxy could not be create a proxy for one of the IN parameters
This is returned only when the "real" meathod has NOT been invoked.
*/
#define NS_ERROR_PROXY_INVALID_IN_PARAMETER ((nsresult) 0x80010010L)
/* Returned when a proxy could not be create a proxy for one of the OUT parameters
This is returned only when the "real" meathod has ALREADY been invoked.
*/
#define NS_ERROR_PROXY_INVALID_OUT_PARAMETER ((nsresult) 0x80010011L)
/*@}*/
////////////////////////////////////////////////////////////////////////////////

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

@ -95,7 +95,7 @@ class nsProxyObject : public nsISupports
} AutoProxyConvertTypes;
void AutoProxyParameterList(nsXPTMethodInfo *methodInfo, nsXPTCMiniVariant * params,
nsresult AutoProxyParameterList(nsXPTMethodInfo *methodInfo, nsXPTCMiniVariant * params,
nsIInterfaceInfo *interfaceInfo, AutoProxyConvertTypes convertType);
nsIEventQueue *mDestQueue; /* destination queue */

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

@ -144,9 +144,11 @@ nsProxyObject::Post( PRUint32 methodIndex, nsXPTMethodInfo *methodInfo, nsXPTCMi
///////////////////////////////////////////////////////////////////////
// Auto-proxification
///////////////////////////////////////////////////////////////////////
AutoProxyParameterList(methodInfo, params, interfaceInfo, convertInParameters);
nsresult rv = AutoProxyParameterList(methodInfo, params, interfaceInfo, convertInParameters);
///////////////////////////////////////////////////////////////////////
if (NS_FAILED(rv))
return rv;
// convert the nsXPTCMiniVariant to a nsXPTCVariant
@ -187,13 +189,13 @@ nsProxyObject::Post( PRUint32 methodIndex, nsXPTMethodInfo *methodInfo, nsXPTCMi
{
mDestQueue->PostSynchronousEvent(event, nsnull);
nsresult rv = proxyInfo->GetResult();
rv = proxyInfo->GetResult();
delete proxyInfo;
///////////////////////////////////////////////////////////////////////
// Auto-proxification
///////////////////////////////////////////////////////////////////////
AutoProxyParameterList(methodInfo, params, interfaceInfo, convertOutParameters);
rv = AutoProxyParameterList(methodInfo, params, interfaceInfo, convertOutParameters);
///////////////////////////////////////////////////////////////////////
mDestQueue->ExitMonitor();
@ -212,7 +214,7 @@ nsProxyObject::Post( PRUint32 methodIndex, nsXPTMethodInfo *methodInfo, nsXPTCMi
}
void
nsresult
nsProxyObject::AutoProxyParameterList(nsXPTMethodInfo *methodInfo, nsXPTCMiniVariant * params,
nsIInterfaceInfo *interfaceInfo, AutoProxyConvertTypes convertType)
{
@ -262,20 +264,27 @@ nsProxyObject::AutoProxyParameterList(nsXPTMethodInfo *methodInfo, nsXPTCMiniVar
interfaceInfo->GetIIDForParam(&paramInfo, &iid);
manager->GetProxyObject( GetQueue(),
*iid,
anInterface,
GetProxyType(),
(void**) &aProxyObject);
rv = manager->GetProxyObject(GetQueue(),
*iid,
anInterface,
GetProxyType(),
(void**) &aProxyObject);
nsAllocator::Free((void*)iid);
NS_RELEASE(manager);
if (NS_FAILED(rv))
return rv;
if (paramInfo.IsOut())
*((void**)params[i].val.p) = ((void*)aProxyObject);
else
(params[i].val.p) = ((void*)aProxyObject);
NS_RELEASE(manager);
}
else
{
// Could not get nsIProxyObjectManager
return rv;
}
}
else