From 4dbffceaccda8437c22a79d2344716b664cf9436 Mon Sep 17 00:00:00 2001 From: "pedemont%us.ibm.com" Date: Wed, 27 Sep 2006 15:18:15 +0000 Subject: [PATCH] Bug 285591 - Do not cache JNIEnv structure. Instead, query from JavaVM. Not part of default build. a=mkaply Original committer: pedemont%us.ibm.com Original revision: 1.27 Original date: 2005/05/03 20:15:35 --- extensions/java/xpcom/src/nsJavaXPCOMBindingUtils.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extensions/java/xpcom/src/nsJavaXPCOMBindingUtils.h b/extensions/java/xpcom/src/nsJavaXPCOMBindingUtils.h index c2b92584a87..4e5cd8db3d7 100644 --- a/extensions/java/xpcom/src/nsJavaXPCOMBindingUtils.h +++ b/extensions/java/xpcom/src/nsJavaXPCOMBindingUtils.h @@ -302,6 +302,15 @@ nsresult GetIIDForMethodParam(nsIInterfaceInfo *iinfo, * JNI helper functions *******************************/ +/** + * Returns a pointer to the appropriate JNIEnv structure. This function is + * useful in callbacks or other functions that are not called directly from + * Java and therefore do not have the JNIEnv structure passed in. + * + * @return pointer to JNIEnv structure for current thread + */ +JNIEnv* GetJNIEnv(); + /** * Constructs and throws an exception. Some error codes (such as * NS_ERROR_OUT_OF_MEMORY) are handled by the appropriate Java exception/error.