Fix breakage caused by the death of XPTI_GetInterfaceInfoManager.

Not part of the build.
This commit is contained in:
mhammond%skippinet.com.au 2005-12-08 01:05:02 +00:00
parent 81a0b0f2cc
commit 5e257f72b5
5 changed files with 13 additions and 11 deletions

View File

@ -69,7 +69,8 @@ PyXPCOM_XPTStub::GetInterfaceInfo(nsIInterfaceInfo** info)
// Simply get the XPCOM runtime to provide this
// (but there must be some reason why they don't get it themselves!?)
// Maybe because they don't know the IID?
nsCOMPtr<nsIInterfaceInfoManager> iim = XPTI_GetInterfaceInfoManager();
nsCOMPtr<nsIInterfaceInfoManager> iim(do_GetService(
NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
NS_ABORT_IF_FALSE(iim != nsnull, "Cant get interface from IIM!");
if (iim==nsnull)
return NS_ERROR_FAILURE;

View File

@ -171,7 +171,8 @@ Py_nsIID::PyTypeMethod_getattr(PyObject *self, char *name)
Py_nsIID *me = (Py_nsIID *)self;
if (strcmp(name, "name")==0) {
char *iid_repr = nsnull;
nsCOMPtr<nsIInterfaceInfoManager> iim = XPTI_GetInterfaceInfoManager();
nsCOMPtr<nsIInterfaceInfoManager> iim(do_GetService(
NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
if (iim!=nsnull)
iim->GetNameForIID(&me->m_iid, &iid_repr);
if (iid_repr==nsnull)

View File

@ -141,7 +141,8 @@ PyXPCOM_TypeObject::Py_repr(PyObject *self)
Py_nsISupports *pis = (Py_nsISupports *)self;
// Try and get the IID name.
char *iid_repr;
nsCOMPtr<nsIInterfaceInfoManager> iim = XPTI_GetInterfaceInfoManager();
nsCOMPtr<nsIInterfaceInfoManager> iim(do_GetService(
NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
if (iim!=nsnull)
iim->GetNameForIID(&pis->m_iid, &iid_repr);
if (iid_repr==nsnull)

View File

@ -2083,7 +2083,8 @@ PyObject *PyXPCOM_GatewayVariantHelper::MakeSingleParam(int index, PythonTypeDes
nsresult PyXPCOM_GatewayVariantHelper::GetArrayType(PRUint8 index, PRUint8 *ret)
{
nsCOMPtr<nsIInterfaceInfoManager> iim = XPTI_GetInterfaceInfoManager();
nsCOMPtr<nsIInterfaceInfoManager> iim(do_GetService(
NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
NS_ABORT_IF_FALSE(iim != nsnull, "Cant get interface from IIM!");
if (iim==nsnull)
return NS_ERROR_FAILURE;
@ -2136,8 +2137,8 @@ PRBool PyXPCOM_GatewayVariantHelper::GetIIDForINTERFACE_ID(int index, const nsII
nsIInterfaceInfo *PyXPCOM_GatewayVariantHelper::GetInterfaceInfo()
{
if (!m_interface_info) {
nsCOMPtr<nsIInterfaceInfoManager> iim =
dont_AddRef(XPTI_GetInterfaceInfoManager());
nsCOMPtr<nsIInterfaceInfoManager> iim(do_GetService(
NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
if (iim)
iim->GetInfoForIID(&m_gateway->m_iid, getter_AddRefs(m_interface_info));
}

View File

@ -220,17 +220,15 @@ PyXPCOMMethod_XPTI_GetInterfaceInfoManager(PyObject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
nsIInterfaceInfoManager* im;
Py_BEGIN_ALLOW_THREADS;
im = XPTI_GetInterfaceInfoManager();
Py_END_ALLOW_THREADS;
nsCOMPtr<nsIInterfaceInfoManager> im(do_GetService(
NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
if ( im == nsnull )
return PyXPCOM_BuildPyException(NS_ERROR_FAILURE);
/* Return a type based on the IID (with no extra ref) */
// Can not auto-wrap the interface info manager as it is critical to
// building the support we need for autowrap.
return Py_nsISupports::PyObjectFromInterface(im, NS_GET_IID(nsIInterfaceInfoManager), PR_FALSE, PR_FALSE);
return Py_nsISupports::PyObjectFromInterface(im, NS_GET_IID(nsIInterfaceInfoManager), PR_TRUE, PR_FALSE);
}
static PyObject *