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