diff --git a/extensions/python/xpcom/src/PyGStub.cpp b/extensions/python/xpcom/src/PyGStub.cpp index 0cfda731f517..c454ade23e9a 100644 --- a/extensions/python/xpcom/src/PyGStub.cpp +++ b/extensions/python/xpcom/src/PyGStub.cpp @@ -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 iim = XPTI_GetInterfaceInfoManager(); + nsCOMPtr 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; diff --git a/extensions/python/xpcom/src/PyIID.cpp b/extensions/python/xpcom/src/PyIID.cpp index f8e6a8684934..9614c4699783 100644 --- a/extensions/python/xpcom/src/PyIID.cpp +++ b/extensions/python/xpcom/src/PyIID.cpp @@ -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 iim = XPTI_GetInterfaceInfoManager(); + nsCOMPtr iim(do_GetService( + NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID)); if (iim!=nsnull) iim->GetNameForIID(&me->m_iid, &iid_repr); if (iid_repr==nsnull) diff --git a/extensions/python/xpcom/src/TypeObject.cpp b/extensions/python/xpcom/src/TypeObject.cpp index dbfc793592cd..3faed3e6c191 100644 --- a/extensions/python/xpcom/src/TypeObject.cpp +++ b/extensions/python/xpcom/src/TypeObject.cpp @@ -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 iim = XPTI_GetInterfaceInfoManager(); + nsCOMPtr iim(do_GetService( + NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID)); if (iim!=nsnull) iim->GetNameForIID(&pis->m_iid, &iid_repr); if (iid_repr==nsnull) diff --git a/extensions/python/xpcom/src/VariantUtils.cpp b/extensions/python/xpcom/src/VariantUtils.cpp index b9eea3e744cf..0b5be5ee7ca8 100644 --- a/extensions/python/xpcom/src/VariantUtils.cpp +++ b/extensions/python/xpcom/src/VariantUtils.cpp @@ -2083,7 +2083,8 @@ PyObject *PyXPCOM_GatewayVariantHelper::MakeSingleParam(int index, PythonTypeDes nsresult PyXPCOM_GatewayVariantHelper::GetArrayType(PRUint8 index, PRUint8 *ret) { - nsCOMPtr iim = XPTI_GetInterfaceInfoManager(); + nsCOMPtr 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 iim = - dont_AddRef(XPTI_GetInterfaceInfoManager()); + nsCOMPtr iim(do_GetService( + NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID)); if (iim) iim->GetInfoForIID(&m_gateway->m_iid, getter_AddRefs(m_interface_info)); } diff --git a/extensions/python/xpcom/src/xpcom.cpp b/extensions/python/xpcom/src/xpcom.cpp index a78637e2646b..64a7b79541cf 100644 --- a/extensions/python/xpcom/src/xpcom.cpp +++ b/extensions/python/xpcom/src/xpcom.cpp @@ -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 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 *