diff options
Diffstat (limited to 'src/libs/xpcom18a4/java')
-rw-r--r-- | src/libs/xpcom18a4/java/Makefile.kmk | 1 | ||||
-rw-r--r-- | src/libs/xpcom18a4/java/src/nsJavaInterfaces.cpp | 14 | ||||
-rw-r--r-- | src/libs/xpcom18a4/java/src/nsJavaWrapper.cpp | 7 | ||||
-rw-r--r-- | src/libs/xpcom18a4/java/src/nsThreadUtils.h | 4 | ||||
-rw-r--r-- | src/libs/xpcom18a4/java/src/org/mozilla/xpcom/XPCOMException.java | 2 | ||||
-rw-r--r-- | src/libs/xpcom18a4/java/tools/genjifaces.xsl | 77 |
6 files changed, 79 insertions, 26 deletions
diff --git a/src/libs/xpcom18a4/java/Makefile.kmk b/src/libs/xpcom18a4/java/Makefile.kmk index 58dfd18a..51053b71 100644 --- a/src/libs/xpcom18a4/java/Makefile.kmk +++ b/src/libs/xpcom18a4/java/Makefile.kmk @@ -173,6 +173,7 @@ $(VBOX_JXPCOM_GEN)/jxpcomglue.list: \ $(call MSG_L1,Generating Java glue files from XIDL) $(QUIET)$(RM) -f $(wildcard $(VBOX_JXPCOM_GEN)/java/glue/*.java) $(QUIET)$(VBOX_XSLTPROC) \ + --stringparam filelistonly "" \ --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \ --stringparam G_vboxGlueStyle xpcom \ --stringparam G_vboxDirPrefix "" \ diff --git a/src/libs/xpcom18a4/java/src/nsJavaInterfaces.cpp b/src/libs/xpcom18a4/java/src/nsJavaInterfaces.cpp index 4b3fa5e0..5649c828 100644 --- a/src/libs/xpcom18a4/java/src/nsJavaInterfaces.cpp +++ b/src/libs/xpcom18a4/java/src/nsJavaInterfaces.cpp @@ -146,7 +146,7 @@ nsresult InitXPCOMVBox_Impl(JNIEnv* env, jobject aVBoxBinDirectory) { #if defined(VBOX_PATH_APP_PRIVATE_ARCH) && defined(VBOX_PATH_SHARED_LIBS) - rv = RTR3InitDll(0); + rv = RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE); #else const char *pszHome = nsnull; const char *jhome = nsnull; @@ -174,9 +174,9 @@ InitXPCOMVBox_Impl(JNIEnv* env, jobject aVBoxBinDirectory) char *pszExePath = (char *)alloca(cchHome + 32); memcpy(pszExePath, pszHome, cchHome); memcpy(pszExePath + cchHome, "/javafake", sizeof("/javafake")); - rv = RTR3InitEx(RTR3INIT_VER_CUR, RTR3INIT_FLAGS_DLL, 0, NULL, pszExePath); + rv = RTR3InitEx(RTR3INIT_VER_CUR, RTR3INIT_FLAGS_DLL | RTR3INIT_FLAGS_UNOBTRUSIVE, 0, NULL, pszExePath); } else { - rv = RTR3InitDll(0); + rv = RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE); } if (jhome) @@ -354,13 +354,13 @@ XPCOM_NATIVE(getComponentRegistrar) (JNIEnv *env, jobject) } #ifdef VBOX -# include <VBox/com/EventQueue.h> +# include <VBox/com/NativeEventQueue.h> # include <iprt/err.h> extern "C" NS_EXPORT jint JNICALL XPCOM_NATIVE2(waitForEvents) (JNIEnv *env, jobject, jlong aTimeout) { - com::EventQueue* aEventQ = com::EventQueue::getMainEventQueue(); + com::NativeEventQueue* aEventQ = com::NativeEventQueue::getMainEventQueue(); NS_WARN_IF_FALSE(aEventQ != nsnull, "Null main event queue"); if (!aEventQ) return -1; @@ -379,7 +379,11 @@ XPCOM_NATIVE2(waitForEvents) (JNIEnv *env, jobject, jlong aTimeout) #endif extern "C" NS_EXPORT jobject JNICALL +#ifdef VBOX +XPCOM_NATIVE2(getServiceManager) (JNIEnv *env, jobject) +#else XPCOM_NATIVE(getServiceManager) (JNIEnv *env, jobject) +#endif { // Call XPCOM method nsCOMPtr<nsIServiceManager> sm; diff --git a/src/libs/xpcom18a4/java/src/nsJavaWrapper.cpp b/src/libs/xpcom18a4/java/src/nsJavaWrapper.cpp index 35b59b6d..19436f14 100644 --- a/src/libs/xpcom18a4/java/src/nsJavaWrapper.cpp +++ b/src/libs/xpcom18a4/java/src/nsJavaWrapper.cpp @@ -1006,7 +1006,7 @@ FinalizeParams(JNIEnv *env, const nsXPTParamInfo &aParamInfo, PRUint8 aType, aVariant.val.u8; if (aParamInfo.IsRetval() && !aIsArrayElement) { *aParam = env->NewObject(shortClass, shortInitMID, value); - } else if ((aParamInfo.IsOut() || aIsArrayElement) && aParam) { + } else if ((aParamInfo.IsOut() || aIsArrayElement) && *aParam) { env->SetShortArrayRegion((jshortArray) *aParam, aIndex, 1, &value); } } @@ -1495,7 +1495,7 @@ static void makeErrorMessage(nsresult r, char* msg, size_t msgSize) if (NS_SUCCEEDED (rc)) { nsCOMPtr <nsIException> ex; - rc = em->GetExceptionFromProvider(r, NULL, getter_AddRefs (ex)); + rc = em->GetCurrentException(getter_AddRefs (ex)); if (NS_SUCCEEDED (rc) && ex) { nsXPIDLCString emsg; @@ -1753,8 +1753,9 @@ JAVAPROXY_NATIVE(callXPCOMMethod) (JNIEnv *env, jclass that, jobject aJavaProxy, } jobject* javaElement; + jobject element = nsnull; if (!paramInfo.IsRetval()) { - jobject element = env->GetObjectArrayElement(aParams, i); + element = env->GetObjectArrayElement(aParams, i); javaElement = &element; } else { javaElement = &result; diff --git a/src/libs/xpcom18a4/java/src/nsThreadUtils.h b/src/libs/xpcom18a4/java/src/nsThreadUtils.h index 9c6a0efd..53f3dbdb 100644 --- a/src/libs/xpcom18a4/java/src/nsThreadUtils.h +++ b/src/libs/xpcom18a4/java/src/nsThreadUtils.h @@ -50,11 +50,11 @@ do_GetMainThread() { return already_AddRefed<nsIThread>(thread); } -#include "VBox/com/EventQueue.h" +#include "VBox/com/NativeEventQueue.h" inline already_AddRefed<nsIEventQueue> do_GetMainThreadQueue() { - com::EventQueue* eq = com::EventQueue::getMainEventQueue(); + com::NativeEventQueue* eq = com::NativeEventQueue::getMainEventQueue(); NS_ASSERTION(eq != nsnull, "Must be valid"); return eq->getIEventQueue(); } diff --git a/src/libs/xpcom18a4/java/src/org/mozilla/xpcom/XPCOMException.java b/src/libs/xpcom18a4/java/src/org/mozilla/xpcom/XPCOMException.java index 44636d54..9eca58f6 100644 --- a/src/libs/xpcom18a4/java/src/org/mozilla/xpcom/XPCOMException.java +++ b/src/libs/xpcom18a4/java/src/org/mozilla/xpcom/XPCOMException.java @@ -87,7 +87,7 @@ public class XPCOMException extends RuntimeException { * @param message detailed message of exception */ public XPCOMException(long code, String message) { - super(message + " (0x" + Long.toHexString(code) + ")"); + super(message + " (0x" + Long.toHexString(code) + ")"); this.errorcode = code; } diff --git a/src/libs/xpcom18a4/java/tools/genjifaces.xsl b/src/libs/xpcom18a4/java/tools/genjifaces.xsl index 9dc7901b..3910de73 100644 --- a/src/libs/xpcom18a4/java/tools/genjifaces.xsl +++ b/src/libs/xpcom18a4/java/tools/genjifaces.xsl @@ -7,9 +7,9 @@ <!-- genjifaces.xsl: - XSLT stylesheet that generates Java XPCOM bridge intreface code from VirtualBox.xidl. + XSLT stylesheet that generates Java XPCOM bridge interface code from VirtualBox.xidl. - Copyright (C) 2010 Oracle Corporation + Copyright (C) 2010-2013 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; @@ -67,7 +67,7 @@ <xsl:template name="fileheader"> <xsl:param name="name" /> <xsl:text>/** - * Copyright (C) 2010 Oracle Corporation + * Copyright (C) 2010-2013 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -119,16 +119,14 @@ public interface nsISupports "{00000000-0000-0000-c000-000000000046}"; public nsISupports queryInterface(String arg1); - } - ]]></xsl:text> <xsl:call-template name="endFile"> <xsl:with-param name="file" select="'nsISupports.java'" /> </xsl:call-template> -<xsl:call-template name="startFile"> + <xsl:call-template name="startFile"> <xsl:with-param name="file" select="'nsIComponentManager.java'" /> </xsl:call-template> @@ -146,14 +144,13 @@ public interface nsIComponentManager extends nsISupports public nsISupports createInstanceByContractID(String arg1, nsISupports arg2, String arg3); } - ]]></xsl:text> <xsl:call-template name="endFile"> <xsl:with-param name="file" select="'nsIComponentManager.java'" /> </xsl:call-template> -<xsl:call-template name="startFile"> + <xsl:call-template name="startFile"> <xsl:with-param name="file" select="'nsIServiceManager.java'" /> </xsl:call-template> @@ -171,14 +168,67 @@ public interface nsIServiceManager extends nsISupports public boolean isServiceInstantiatedByContractID(String arg1, String arg2); } - ]]></xsl:text> <xsl:call-template name="endFile"> <xsl:with-param name="file" select="'nsIServiceManager.java'" /> </xsl:call-template> -<xsl:call-template name="startFile"> + <xsl:call-template name="startFile"> + <xsl:with-param name="file" select="'nsIExceptionManager.java'" /> + </xsl:call-template> + + <xsl:text><![CDATA[ +public interface nsIExceptionManager extends nsISupports +{ + public static final String NS_IEXCEPTIONMANAGER_IID = + "{efc9d00b-231c-4feb-852c-ac017266a415}"; + + public nsIException getCurrentException(); +} +]]></xsl:text> + + <xsl:call-template name="endFile"> + <xsl:with-param name="file" select="'nsISupports.java'" /> + </xsl:call-template> + + <xsl:call-template name="startFile"> + <xsl:with-param name="file" select="'nsIExceptionService.java'" /> + </xsl:call-template> + + <xsl:text><![CDATA[ +public interface nsIExceptionService extends nsIExceptionManager +{ + public static final String NS_IEXCEPTIONSERVICE_IID = + "{35a88f54-f267-4414-92a7-191f6454ab52}"; + + public nsIExceptionManager getCurrentExceptionManager(); +} +]]></xsl:text> + + <xsl:call-template name="endFile"> + <xsl:with-param name="file" select="'nsISupports.java'" /> + </xsl:call-template> + + <xsl:call-template name="startFile"> + <xsl:with-param name="file" select="'nsIException.java'" /> + </xsl:call-template> + + <xsl:text><![CDATA[ +public interface nsIException extends nsISupports +{ + public static final String NS_IEXCEPTION_IID = + "{f3a8d3b4-c424-4edc-8bf6-8974c983ba78}"; + + // No methods - placeholder +} +]]></xsl:text> + + <xsl:call-template name="endFile"> + <xsl:with-param name="file" select="'nsISupports.java'" /> + </xsl:call-template> + + <xsl:call-template name="startFile"> <xsl:with-param name="file" select="'nsIComponentRegistrar.java'" /> </xsl:call-template> @@ -190,7 +240,6 @@ public interface nsIComponentRegistrar extends nsISupports // No methods - placeholder } - ]]></xsl:text> <xsl:call-template name="endFile"> @@ -198,7 +247,7 @@ public interface nsIComponentRegistrar extends nsISupports </xsl:call-template> -<xsl:call-template name="startFile"> + <xsl:call-template name="startFile"> <xsl:with-param name="file" select="'nsIFile.java'" /> </xsl:call-template> @@ -210,14 +259,13 @@ public interface nsIFile extends nsISupports // No methods - placeholder } - ]]></xsl:text> <xsl:call-template name="endFile"> <xsl:with-param name="file" select="'nsIFile.java'" /> </xsl:call-template> -<xsl:call-template name="startFile"> + <xsl:call-template name="startFile"> <xsl:with-param name="file" select="'nsILocalFile.java'" /> </xsl:call-template> @@ -229,7 +277,6 @@ public interface nsILocalFile extends nsIFile // No methods - placeholder } - ]]></xsl:text> <xsl:call-template name="endFile"> |