зеркало из https://github.com/mozilla/gecko-dev.git
Bug 305815 - Better organize Java interfaces. Implement getGREPathWithProperties(). r=bsmedberg, r=lbustelo. Not part of default build.
Original committer: pedemont%us.ibm.com Original revision: 1.35 Original date: 2005/10/28 01:59:03
This commit is contained in:
Родитель
ac996233d0
Коммит
eb8ce8ed59
|
@ -45,7 +45,8 @@
|
|||
#include "nsCRT.h"
|
||||
#include "prmem.h"
|
||||
|
||||
#define JAVAPROXY_NATIVE(func) Java_org_mozilla_xpcom_XPCOMJavaProxy_##func
|
||||
#define JAVAPROXY_NATIVE(func) \
|
||||
Java_org_mozilla_xpcom_internal_XPCOMJavaProxy_##func
|
||||
|
||||
static nsID nullID = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
|
||||
|
@ -1379,7 +1380,7 @@ QueryMethodInfo(nsIInterfaceInfo* aIInfo, const char* aMethodName,
|
|||
}
|
||||
|
||||
/**
|
||||
* org.mozilla.xpcom.XPCOMJavaProxy.callXPCOMMethod
|
||||
* org.mozilla.xpcom.XPCOMJavaProxy.internal.callXPCOMMethod
|
||||
*/
|
||||
extern "C" JX_EXPORT jobject JNICALL
|
||||
JAVAPROXY_NATIVE(callXPCOMMethod) (JNIEnv *env, jclass that, jobject aJavaProxy,
|
||||
|
@ -1709,10 +1710,11 @@ GetXPCOMInstFromProxy(JNIEnv* env, jobject aJavaObject, void** aResult)
|
|||
}
|
||||
|
||||
/**
|
||||
* org.mozilla.xpcom.XPCOMJavaProxy.finalizeProxy
|
||||
* org.mozilla.xpcom.internal.XPCOMJavaProxy.finalizeProxyNative
|
||||
*/
|
||||
extern "C" JX_EXPORT void JNICALL
|
||||
JAVAPROXY_NATIVE(finalizeProxy) (JNIEnv *env, jclass that, jobject aJavaProxy)
|
||||
JAVAPROXY_NATIVE(finalizeProxyNative) (JNIEnv *env, jclass that,
|
||||
jobject aJavaProxy)
|
||||
{
|
||||
#ifdef DEBUG_JAVAXPCOM
|
||||
PRUint32 xpcom_addr = 0;
|
||||
|
|
|
@ -224,7 +224,7 @@ InitializeJavaGlobals(JNIEnv *env)
|
|||
goto init_error;
|
||||
}
|
||||
|
||||
if (!(clazz = env->FindClass("org/mozilla/xpcom/XPCOMJavaProxy")) ||
|
||||
if (!(clazz = env->FindClass("org/mozilla/xpcom/internal/XPCOMJavaProxy")) ||
|
||||
!(xpcomJavaProxyClass = (jclass) env->NewGlobalRef(clazz)) ||
|
||||
!(createProxyMID = env->GetStaticMethodID(clazz, "createProxy",
|
||||
"(Ljava/lang/Class;J)Ljava/lang/Object;")) ||
|
||||
|
@ -234,7 +234,7 @@ InitializeJavaGlobals(JNIEnv *env)
|
|||
"getNativeXPCOMInstance",
|
||||
"(Ljava/lang/Object;)J")))
|
||||
{
|
||||
NS_WARNING("Problem creating org.mozilla.xpcom.XPCOMJavaProxy globals");
|
||||
NS_WARNING("Problem creating org.mozilla.xpcom.internal.XPCOMJavaProxy globals");
|
||||
goto init_error;
|
||||
}
|
||||
|
||||
|
@ -283,11 +283,14 @@ init_error:
|
|||
void
|
||||
FreeJavaGlobals(JNIEnv* env)
|
||||
{
|
||||
PR_Lock(gJavaXPCOMLock);
|
||||
PRLock* tempLock = nsnull;
|
||||
if (gJavaXPCOMLock) {
|
||||
PR_Lock(gJavaXPCOMLock);
|
||||
|
||||
// null out global lock so no one else can use it
|
||||
PRLock* tempLock = gJavaXPCOMLock;
|
||||
gJavaXPCOMLock = nsnull;
|
||||
// null out global lock so no one else can use it
|
||||
tempLock = gJavaXPCOMLock;
|
||||
gJavaXPCOMLock = nsnull;
|
||||
}
|
||||
|
||||
gJavaXPCOMInitialized = PR_FALSE;
|
||||
|
||||
|
@ -354,8 +357,10 @@ FreeJavaGlobals(JNIEnv* env)
|
|||
xpcomJavaProxyClass = nsnull;
|
||||
}
|
||||
|
||||
PR_Unlock(tempLock);
|
||||
PR_DestroyLock(tempLock);
|
||||
if (tempLock) {
|
||||
PR_Unlock(tempLock);
|
||||
PR_DestroyLock(tempLock);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче