Index: Eclipse_SWT_Mozilla/common/library/xpcom_stats.cpp =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom_stats.cpp,v retrieving revision 1.15 diff -u -r1.15 xpcom_stats.cpp --- plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom_stats.cpp 9 May 2006 21:52:54 -0000 1.15 +++ plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom_stats.cpp 15 Sep 2006 19:04:09 -0000 @@ -31,15 +31,14 @@ #ifdef NATIVE_STATS -int XPCOM_nativeFunctionCount = 131; -int XPCOM_nativeFunctionCallCount[131]; +int XPCOM_nativeFunctionCount = 130; +int XPCOM_nativeFunctionCallCount[130]; char * XPCOM_nativeFunctionNames[] = { "Call", "NS_1GetComponentManager", "NS_1GetServiceManager", - "NS_1InitEmbedding", + "NS_1InitXPCOM3_FUNC", "NS_1NewLocalFile", - "NS_1TermEmbedding", "PR_1Free", "PR_1Malloc", "VtblCall__II", Index: Eclipse_SWT_Mozilla/common/library/xpcom_stats.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom_stats.h,v retrieving revision 1.14 diff -u -r1.14 xpcom_stats.h --- plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom_stats.h 9 May 2006 21:52:54 -0000 1.14 +++ plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom_stats.h 15 Sep 2006 19:04:09 -0000 @@ -41,9 +41,8 @@ Call_FUNC, NS_1GetComponentManager_FUNC, NS_1GetServiceManager_FUNC, - NS_1InitEmbedding_FUNC, + NS_1InitXPCOM3_FUNC, NS_1NewLocalFile_FUNC, - NS_1TermEmbedding_FUNC, PR_1Free_FUNC, PR_1Malloc_FUNC, VtblCall__II_FUNC, Index: Eclipse_SWT_Mozilla/common/library/xpcom.h =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom.h,v retrieving revision 1.6 diff -u -r1.6 xpcom.h --- plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom.h 9 May 2006 18:54:24 -0000 1.6 +++ plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom.h 15 Sep 2006 19:04:09 -0000 @@ -32,7 +32,6 @@ #define NDEBUG #include "nsXPCOM.h" -#include "nsEmbedAPI.h" #include "nsEmbedString.h" #include "nsIInputStream.h" #include "nsISupportsUtils.h" Index: Eclipse_SWT_Mozilla/common/library/xpcom.cpp =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom.cpp,v retrieving revision 1.29 diff -u -r1.29 xpcom.cpp --- plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom.cpp 9 May 2006 21:52:54 -0000 1.29 +++ plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/library/xpcom.cpp 15 Sep 2006 19:04:09 -0000 @@ -85,14 +85,16 @@ } #endif -#ifndef NO_NS_1InitEmbedding -JNIEXPORT jint JNICALL XPCOM_NATIVE(NS_1InitEmbedding) - (JNIEnv *env, jclass that, jint arg0, jint arg1) +#ifndef NO_NS_1InitXPCOM3 +JNIEXPORT jint JNICALL XPCOM_NATIVE(NS_1InitXPCOM3) + (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4) { jint rc = 0; - XPCOM_NATIVE_ENTER(env, that, NS_1InitEmbedding_FUNC); - rc = (jint)NS_InitEmbedding((nsILocalFile *)arg0, (nsIDirectoryServiceProvider *)arg1); - XPCOM_NATIVE_EXIT(env, that, NS_1InitEmbedding_FUNC); + XPCOM_NATIVE_ENTER(env, that, NS_1GetComponentRegistrar_FUNC); + rc = (jint)NS_InitXPCOM3((nsIServiceManager **)arg0, (nsIFile *)arg1, + (nsIDirectoryServiceProvider *)arg2, (nsStaticModuleInfo *)arg3, + (PRUint32) arg4); + XPCOM_NATIVE_EXIT(env, that, NS_1GetComponentRegistrar_FUNC); return rc; } #endif @@ -113,18 +115,6 @@ } #endif -#ifndef NO_NS_1TermEmbedding -JNIEXPORT jint JNICALL XPCOM_NATIVE(NS_1TermEmbedding) - (JNIEnv *env, jclass that) -{ - jint rc = 0; - XPCOM_NATIVE_ENTER(env, that, NS_1TermEmbedding_FUNC); - rc = (jint)NS_TermEmbedding(); - XPCOM_NATIVE_EXIT(env, that, NS_1TermEmbedding_FUNC); - return rc; -} -#endif - #ifndef NO_PR_1Free JNIEXPORT void JNICALL XPCOM_NATIVE(PR_1Free) (JNIEnv *env, jclass that, jint arg0) Index: Eclipse_SWT_Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse_SWT_Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java,v retrieving revision 1.48 diff -u -r1.48 XPCOM.java --- plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java 9 May 2006 18:54:24 -0000 1.48 +++ plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java 15 Sep 2006 19:04:09 -0000 @@ -102,9 +102,8 @@ public static final native void memmove(byte[] dest, char[] src, int nbytes); public static final native int NS_GetComponentManager(int /*long*/[] result); public static final native int NS_GetServiceManager(int /*long*/[] result); -public static final native int NS_InitEmbedding(int /*long*/ aMozBinDirectory, int /*long*/ aAppFileLocProvider); +public static final native int NS_InitXPCOM3(int /*long*/ result, int /*long*/ binDirectory, int /*long*/ appFileLocationProvider, int /*long*/ staticComponents, int componentCount); public static final native int NS_NewLocalFile(int /*long*/ path, boolean followLinks, int /*long*/[] result); -public static final native int NS_TermEmbedding(); public static final native int strlen_PRUnichar(int /*long*/ s); public static final native int /*long*/ nsEmbedCString_new(); public static final native int /*long*/ nsEmbedCString_new(byte[] aString, int length); Index: Eclipse_SWT_Mozilla/gtk/org/eclipse/swt/browser/Browser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse_SWT_Mozilla/gtk/org/eclipse/swt/browser/Browser.java,v retrieving revision 1.61 diff -u -r1.61 Browser.java --- plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/gtk/org/eclipse/swt/browser/Browser.java 9 May 2006 19:47:09 -0000 1.61 +++ plugins/org.eclipse.swt/Eclipse_SWT_Mozilla/gtk/org/eclipse/swt/browser/Browser.java 15 Sep 2006 19:04:10 -0000 @@ -175,11 +175,11 @@ if (retVal[0] == 0) error(XPCOM.NS_ERROR_NULL_POINTER); nsILocalFile localFile = new nsILocalFile(retVal[0]); - rc = XPCOM.NS_InitEmbedding(localFile.getAddress(), 0); + rc = XPCOM.NS_InitXPCOM3(0, localFile.getAddress(), 0, 0, 0); localFile.Release(); if (rc != XPCOM.NS_OK) { dispose(); - SWT.error(SWT.ERROR_NO_HANDLES, null, " [NS_InitEmbedding "+mozillaPath+" error "+rc+"]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + SWT.error(SWT.ERROR_NO_HANDLES, null, " [NS_InitXPCOM3 "+mozillaPath+" error "+rc+"]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } rc = XPCOM.NS_GetComponentManager(result); @@ -1250,27 +1250,6 @@ tip = null; BrowserCount--; - /* - * This code is intentionally commented. It is not possible to reinitialize - * Mozilla once it has been terminated. NS_InitEmbedding always fails after - * NS_TermEmbedding has been called. The workaround is to call NS_InitEmbedding - * once and never call NS_TermEmbedding. - */ -// if (BrowserCount == 0) { -// if (AppShell != null) { -// // Shutdown the appshell service. -// rc = AppShell.Spindown(); -// if (rc != XPCOM.NS_OK) error(rc); -// AppShell.Release(); -// AppShell = null; -// } -// WindowCreator.Release(); -// WindowCreator = null; -// PromptService.Release(); -// PromptService = null; -// XPCOM.NS_TermEmbedding(); -// mozilla = false; -// } } void Activate() { Index: JNI_Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt.tools/JNI_Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties,v retrieving revision 1.11 diff -u -r1.11 org.eclipse.swt.internal.mozilla.XPCOM.properties --- plugins/org.eclipse.swt.tools/JNI_Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties 9 May 2006 21:53:07 -0000 1.11 +++ plugins/org.eclipse.swt.tools/JNI_Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties 15 Sep 2006 19:04:11 -0000 @@ -24,17 +24,18 @@ XPCOM_NS_GetServiceManager= XPCOM_NS_GetServiceManager_0=cast=(nsIServiceManager**) -XPCOM_NS_InitEmbedding= -XPCOM_NS_InitEmbedding_0=cast=(nsILocalFile *) -XPCOM_NS_InitEmbedding_1=cast=(nsIDirectoryServiceProvider *) +XPCOM_NS_InitXPCOM3= +XPCOM_NS_InitXPCOM3_0=cast=(nsIServiceManager**) +XPCOM_NS_InitXPCOM3_1=cast=(nsIFile *) +XPCOM_NS_InitXPCOM3_2=cast=(nsIDirectoryServiceProvider *) +XPCOM_NS_InitXPCOM3_3=cast=(const nsStaticModuleInfo *) +XPCOM_NS_InitXPCOM3_4=cast=(PRUint32) XPCOM_NS_NewLocalFile= XPCOM_NS_NewLocalFile_0=cast=(nsAString *),flags=struct XPCOM_NS_NewLocalFile_1= XPCOM_NS_NewLocalFile_2=cast=(nsILocalFile**) -XPCOM_NS_TermEmbedding= - XPCOM_PR_Free= XPCOM_PR_Free_0=cast=(void *)