Merge extensions/python/xpcom changes from DOM_AGNOSTIC2_BRANCH into the

trunk.


git-svn-id: svn://10.0.0.236/trunk@187878 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mhammond%skippinet.com.au
2006-01-20 05:50:28 +00:00
parent 28dfbf4814
commit d394dc834d
56 changed files with 1710 additions and 958 deletions

View File

@@ -81,16 +81,16 @@ static PyObject *PyCreateInstanceByContractID(PyObject *self, PyObject *args)
if (!Py_nsIID::IIDFromPyObject(obIID, &iid))
return NULL;
nsISupports *pis;
nsCOMPtr<nsISupports> pis;
nsresult r;
Py_BEGIN_ALLOW_THREADS;
r = pI->CreateInstanceByContractID(pid, NULL, iid, (void **)&pis);
r = pI->CreateInstanceByContractID(pid, NULL, iid, getter_AddRefs(pis));
Py_END_ALLOW_THREADS;
if ( NS_FAILED(r) )
return PyXPCOM_BuildPyException(r);
/* Return a type based on the IID (with no extra ref) */
return Py_nsISupports::PyObjectFromInterface(pis, iid, PR_FALSE, PR_FALSE);
return Py_nsISupports::PyObjectFromInterface(pis, iid, PR_FALSE);
}
static PyObject *PyCreateInstance(PyObject *self, PyObject *args)
@@ -117,16 +117,16 @@ static PyObject *PyCreateInstance(PyObject *self, PyObject *args)
if (!Py_nsIID::IIDFromPyObject(obIID, &iid))
return NULL;
nsISupports *pis;
nsCOMPtr<nsISupports> pis;
nsresult r;
Py_BEGIN_ALLOW_THREADS;
r = pI->CreateInstance(classID, NULL, iid, (void **)&pis);
r = pI->CreateInstance(classID, NULL, iid, getter_AddRefs(pis));
Py_END_ALLOW_THREADS;
if ( NS_FAILED(r) )
return PyXPCOM_BuildPyException(r);
/* Return a type based on the IID (with no extra ref) */
return Py_nsISupports::PyObjectFromInterface(pis, iid, PR_FALSE, PR_FALSE);
return Py_nsISupports::PyObjectFromInterface(pis, iid, PR_FALSE);
}
struct PyMethodDef