bug=32011

r=ashuk
a=edburns
This set of changes replaces all occurrences of

env->Func(args...)

with

::util_Func(env, args...)

Except of course, for the implementations of the above mentioned
::util_Func() functions.

This is done to allow the JNI functions to be called from a non JNI
context, such as UNO.


git-svn-id: svn://10.0.0.236/trunk@63190 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2000-03-16 23:07:03 +00:00
parent 53322f1498
commit b233b02f87
13 changed files with 337 additions and 133 deletions

View File

@@ -27,6 +27,8 @@
#include "WrapperFactoryImpl.h"
#include "jni_util.h"
#include "nsIServiceManager.h" // for NS_InitXPCOM
#include "nsAppShellCIDs.h" // for NS_SESSIONHISTORY_CID
#include "nsCRT.h" // for nsCRT::strcmp
@@ -83,7 +85,8 @@ Java_org_mozilla_webclient_wrapper_1native_WrapperFactoryImpl_nativeAppInitializ
jobject jobj = obj;
static PRBool gFirstTime = PR_TRUE;
if (gFirstTime) {
const char *nativePath = (const char *) env->GetStringUTFChars(verifiedBinDirAbsolutePath, 0);
const char *nativePath = (const char *) ::util_GetStringUTFChars(env,
verifiedBinDirAbsolutePath);
gBinDir = nativePath;
NS_InitXPCOM(nsnull, &gBinDir);
@@ -93,7 +96,7 @@ Java_org_mozilla_webclient_wrapper_1native_WrapperFactoryImpl_nativeAppInitializ
PR_FALSE, PR_FALSE);
NS_AutoregisterComponents();
gFirstTime = PR_FALSE;
env->ReleaseStringUTFChars(verifiedBinDirAbsolutePath, nativePath);
::util_ReleaseStringUTFChars(env, verifiedBinDirAbsolutePath, nativePath);
}
}
@@ -109,8 +112,8 @@ JNIEXPORT jboolean JNICALL
Java_org_mozilla_webclient_wrapper_1native_WrapperFactoryImpl_nativeDoesImplement
(JNIEnv *env, jobject obj, jstring interfaceName)
{
const char *iName = (const char *) env->GetStringUTFChars(interfaceName,
0);
const char *iName = (const char *) ::util_GetStringUTFChars(env,
interfaceName);
jboolean result = JNI_FALSE;
int i = 0;
@@ -125,7 +128,7 @@ Java_org_mozilla_webclient_wrapper_1native_WrapperFactoryImpl_nativeDoesImplemen
break;
}
}
env->ReleaseStringUTFChars(interfaceName, iName);
::util_ReleaseStringUTFChars(env, interfaceName, iName);
return result;
}