Reorganize bindings methods. Also, properly check error conditions in those methods.

git-svn-id: svn://10.0.0.236/trunk@167699 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pedemont%us.ibm.com
2005-01-14 00:09:49 +00:00
parent eaa00b45f3
commit 6dc662e1e6
6 changed files with 221 additions and 161 deletions

View File

@@ -70,7 +70,7 @@ nsJavaXPTCStubWeakRef::QueryReferent(const nsIID& aIID, void** aInstancePtr)
// Java object has not been garbage collected. Do we have an
// associated nsJavaXPTCStub?
void* inst = GetMatchingXPCOMObject(mJavaEnv, javaObject);
void* inst = gBindings->GetXPCOMObject(mJavaEnv, javaObject);
if (!inst) {
// No XPTCStub exists, so create one
@@ -87,7 +87,7 @@ nsJavaXPTCStubWeakRef::QueryReferent(const nsIID& aIID, void** aInstancePtr)
if (!xpcomStub)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(xpcomStub);
AddJavaXPCOMBinding(mJavaEnv, javaObject, SetAsXPTCStub(xpcomStub));
gBindings->AddBinding(mJavaEnv, javaObject, SetAsXPTCStub(xpcomStub));
// return created stub
*aInstancePtr = (void*) xpcomStub;