summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed <ggayed>2009-04-08 18:54:52 +0000
committerGrant Gayed <ggayed>2009-04-08 18:54:52 +0000
commit2177973a521d0eada801b33df10034dd8a9f4625 (patch)
tree1bdd5eadd1bf96ab29cc6c23566c89152e4c1aa8
parenta15e74fa4fc558db41d7b6459560396680bcb2a9 (diff)
downloadeclipse.platform.swt-2177973a521d0eada801b33df10034dd8a9f4625.tar.gz
eclipse.platform.swt-2177973a521d0eada801b33df10034dd8a9f4625.tar.xz
eclipse.platform.swt-2177973a521d0eada801b33df10034dd8a9f4625.zip
259687 - Javascript executes asynchronously with xulrunner 1.9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/carbon/org/eclipse/swt/browser/MozillaDelegate.java4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h466
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h194
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp561
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.cpp50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.h18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp90
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h86
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java116
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java326
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java143
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_1_9.java159
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_1_9_1.java159
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISerializable.java51
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIXPCSecurityManager.java79
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/motif/org/eclipse/swt/browser/MozillaDelegate.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/make_macosx.mak2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak1
25 files changed, 2486 insertions, 77 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/carbon/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/carbon/org/eclipse/swt/browser/MozillaDelegate.java
index 252b786a78..d09dfe4592 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/carbon/org/eclipse/swt/browser/MozillaDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/carbon/org/eclipse/swt/browser/MozillaDelegate.java
@@ -178,6 +178,10 @@ int getHandle () {
return embedHandle;
}
+String getJSLibraryName () {
+ return "libmozjs.dylib"; //$NON-NLS-1$
+}
+
String getLibraryName () {
return "libxpcom.dylib"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
index cdf6c26a25..034f64ecc7 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
@@ -79,6 +79,10 @@ int /*long*/ getHandle () {
return browser.view.id;
}
+String getJSLibraryName () {
+ return "libmozjs.dylib"; //$NON-NLS-1$
+}
+
String getLibraryName () {
return "libxpcom.dylib"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h
new file mode 100644
index 0000000000..1bfcacd8ac
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h
@@ -0,0 +1,466 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * This file is derived from the Original Code provided by mozilla.org,
+ * whose Initial Developer is Netscape Communications Corporation. Changes
+ * to the original file were made by SWT on April 7, 2009 and are marked
+ * with trailing comment "//SWT-20090407".
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef nsIScriptContext_h__
+#define nsIScriptContext_h__
+
+#include "nscore.h"
+//#include "nsStringGlue.h" //SWT-20090407
+#include "nsISupports.h"
+#include "nsCOMPtr.h"
+#include "nsIProgrammingLanguage.h"
+
+class nsIScriptGlobalObject;
+class nsIScriptSecurityManager;
+class nsIPrincipal;
+class nsIAtom;
+class nsIArray;
+class nsIVariant;
+class nsIObjectInputStream;
+class nsIObjectOutputStream;
+class nsScriptObjectHolder;
+
+typedef void (*nsScriptTerminationFunc)(nsISupports* aRef);
+
+#define NS_ISCRIPTCONTEXT_IID \
+{ /* {e7b9871d-3adc-4bf7-850d-7fb9554886bf} */ \
+ 0xe7b9871d, 0x3adc, 0x4bf7, \
+ { 0x85, 0x0d, 0x7f, 0xb9, 0x55, 0x48, 0x86, 0xbf } }
+
+/* This MUST match JSVERSION_DEFAULT. This version stuff if we don't
+ know what language we have is a little silly... */
+#define SCRIPTVERSION_DEFAULT JSVERSION_DEFAULT
+
+/**
+ * It is used by the application to initialize a runtime and run scripts.
+ * A script runtime would implement this interface.
+ * <P><I>It does have a bit too much java script information now, that
+ * should be removed in a short time. Ideally this interface will be
+ * language neutral</I>
+ */
+class nsIScriptContext : public nsISupports
+{
+public:
+//NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTCONTEXT_IID) //SWT-20090407
+
+ /* Get the ID of this language. */
+ virtual PRUint32 GetScriptTypeID() = 0;
+
+ /**
+ * Compile and execute a script.
+ *
+ * @param aScript a string representing the script to be executed
+ * @param aScopeObject a script object for the scope to execute in, or
+ * nsnull to use a default scope
+ * @param aPrincipal the principal that produced the script
+ * @param aURL the URL or filename for error messages
+ * @param aLineNo the starting line number of the script for error messages
+ * @param aVersion the script language version to use when executing
+ * @param aRetValue the result of executing the script, or null for no result.
+ * If this is a JS context, it's the caller's responsibility to
+ * preserve aRetValue from GC across this call
+ * @param aIsUndefined true if the result of executing the script is the
+ * undefined value
+ *
+ * @return NS_OK if the script was valid and got executed
+ *
+ **/
+ virtual nsresult EvaluateString(const nsAString& aScript,
+ void *aScopeObject,
+ nsIPrincipal *aPrincipal,
+ const char *aURL,
+ PRUint32 aLineNo,
+ PRUint32 aVersion,
+ nsAString *aRetValue,
+ PRBool* aIsUndefined) = 0;
+
+ // Note JS bigotry remains here - 'void *aRetValue' is assumed to be a
+ // jsval. This must move to JSObject before it can be made agnostic.
+ virtual nsresult EvaluateStringWithValue(const nsAString& aScript,
+ void *aScopeObject,
+ nsIPrincipal *aPrincipal,
+ const char *aURL,
+ PRUint32 aLineNo,
+ PRUint32 aVersion,
+ void* aRetValue,
+ PRBool* aIsUndefined) = 0;
+
+ /**
+ * Compile a script.
+ *
+ * @param aText a PRUnichar buffer containing script source
+ * @param aTextLength number of characters in aText
+ * @param aScopeObject an object telling the scope in which to execute,
+ * or nsnull to use a default scope
+ * @param aPrincipal the principal that produced the script
+ * @param aURL the URL or filename for error messages
+ * @param aLineNo the starting line number of the script for error messages
+ * @param aVersion the script language version to use when executing
+ * @param aScriptObject an executable object that's the result of compiling
+ * the script.
+ *
+ * @return NS_OK if the script source was valid and got compiled.
+ *
+ **/
+ virtual nsresult CompileScript(const PRUnichar* aText,
+ PRInt32 aTextLength,
+ void* aScopeObject,
+ nsIPrincipal* aPrincipal,
+ const char* aURL,
+ PRUint32 aLineNo,
+ PRUint32 aVersion,
+ nsScriptObjectHolder &aScriptObject) = 0;
+
+ /**
+ * Execute a precompiled script object.
+ *
+ * @param aScriptObject an object representing the script to be executed
+ * @param aScopeObject an object telling the scope in which to execute,
+ * or nsnull to use a default scope
+ * @param aRetValue the result of executing the script, may be null in
+ * which case no result string is computed
+ * @param aIsUndefined true if the result of executing the script is the
+ * undefined value, may be null for "don't care"
+ *
+ * @return NS_OK if the script was valid and got executed
+ *
+ */
+ virtual nsresult ExecuteScript(void* aScriptObject,
+ void* aScopeObject,
+ nsAString* aRetValue,
+ PRBool* aIsUndefined) = 0;
+
+ /**
+ * Compile the event handler named by atom aName, with function body aBody
+ * into a function object returned if ok via aHandler. Does NOT bind the
+ * function to anything - BindCompiledEventHandler() should be used for that
+ * purpose. Note that this event handler is always considered 'shared' and
+ * hence is compiled without principals. Never call the returned object
+ * directly - it must be bound (and thereby cloned, and therefore have the
+ * correct principals) before use!
+ *
+ * @param aName an nsIAtom pointer naming the function; it must be lowercase
+ * and ASCII, and should not be longer than 63 chars. This bound on
+ * length is enforced only by assertions, so caveat caller!
+ * @param aEventName the name that the event object should be bound to
+ * @param aBody the event handler function's body
+ * @param aURL the URL or filename for error messages
+ * @param aLineNo the starting line number of the script for error messages
+ * @param aVersion the script language version to use when executing
+ * @param aHandler the out parameter in which a void pointer to the compiled
+ * function object is stored on success
+ *
+ * @return NS_OK if the function body was valid and got compiled
+ */
+ virtual nsresult CompileEventHandler(nsIAtom* aName,
+ PRUint32 aArgCount,
+ const char** aArgNames,
+ const nsAString& aBody,
+ const char* aURL,
+ PRUint32 aLineNo,
+ PRUint32 aVersion,
+ nsScriptObjectHolder &aHandler) = 0;
+
+ /**
+ * Call the function object with given args and return its boolean result,
+ * or true if the result isn't boolean.
+ *
+ * @param aTarget the event target
+ * @param aScript an object telling the scope in which to call the compiled
+ * event handler function.
+ * @param aHandler function object (function and static scope) to invoke.
+ * @param argv array of arguments. Note each element is assumed to
+ * be an nsIVariant.
+ * @param rval out parameter returning result
+ **/
+ virtual nsresult CallEventHandler(nsISupports* aTarget,
+ void *aScope, void* aHandler,
+ nsIArray *argv, nsIVariant **rval) = 0;
+
+ /**
+ * Bind an already-compiled event handler function to a name in the given
+ * scope object. The same restrictions on aName (lowercase ASCII, not too
+ * long) applies here as for CompileEventHandler. Scripting languages with
+ * static scoping must re-bind the scope chain for aHandler to begin (after
+ * the activation scope for aHandler itself, typically) with aTarget's scope.
+ *
+ * Logically, this 'bind' operation is more of a 'copy' - it simply
+ * stashes/associates the event handler function with the event target, so
+ * it can be fetched later with GetBoundEventHandler().
+ *
+ * @param aTarget an object telling the scope in which to bind the compiled
+ * event handler function. The context will presumably associate
+ * this nsISupports with a native script object.
+ * @param aName an nsIAtom pointer naming the function; it must be lowercase
+ * and ASCII, and should not be longer than 63 chars. This bound on
+ * length is enforced only by assertions, so caveat caller!
+ * @param aHandler the function object to name, created by an earlier call to
+ * CompileEventHandler
+ * @return NS_OK if the function was successfully bound to the name
+ *
+ * XXXmarkh - fold this in with SetProperty? Exactly the same concept!
+ */
+ virtual nsresult BindCompiledEventHandler(nsISupports* aTarget, void *aScope,
+ nsIAtom* aName,
+ void* aHandler) = 0;
+
+ /**
+ * Lookup a previously bound event handler for the specified target. This
+ * will return an object equivilent to the one passed to
+ * BindCompiledEventHandler (although the pointer may not be the same).
+ *
+ */
+ virtual nsresult GetBoundEventHandler(nsISupports* aTarget, void *aScope,
+ nsIAtom* aName,
+ nsScriptObjectHolder &aHandler) = 0;
+
+ /**
+ * Compile a function that isn't used as an event handler.
+ *
+ * NOTE: Not yet language agnostic (main problem is XBL - not yet agnostic)
+ * Caller must make sure aFunctionObject is a JS GC root.
+ *
+ **/
+ virtual nsresult CompileFunction(void* aTarget,
+ const nsACString& aName,
+ PRUint32 aArgCount,
+ const char** aArgArray,
+ const nsAString& aBody,
+ const char* aURL,
+ PRUint32 aLineNo,
+ PRUint32 aVersion,
+ PRBool aShared,
+ void **aFunctionObject) = 0;
+
+ /**
+ * Set the default scripting language version for this context, which must
+ * be a context specific to a particular scripting language.
+ *
+ **/
+ virtual void SetDefaultLanguageVersion(PRUint32 aVersion) = 0;
+
+ /**
+ * Return the global object.
+ *
+ **/
+ virtual nsIScriptGlobalObject *GetGlobalObject() = 0;
+
+ /**
+ * Return the native script context
+ *
+ **/
+ virtual void *GetNativeContext() = 0;
+
+ /**
+ * Return the native global object for this context.
+ *
+ **/
+ virtual void *GetNativeGlobal() = 0;
+
+ /**
+ * Create a new global object that will be used for an inner window.
+ * Return the native global and an nsISupports 'holder' that can be used
+ * to manage the lifetime of it.
+ */
+ virtual nsresult CreateNativeGlobalForInner(
+ nsIScriptGlobalObject *aNewInner,
+ PRBool aIsChrome,
+ void **aNativeGlobal,
+ nsISupports **aHolder) = 0;
+
+ /**
+ * Connect this context to a new inner window, to allow "prototype"
+ * chaining from the inner to the outer.
+ * Called after both the the inner and outer windows are initialized
+ **/
+ virtual nsresult ConnectToInner(nsIScriptGlobalObject *aNewInner,
+ void *aOuterGlobal) = 0;
+
+
+ /**
+ * Init this context ready for use. If aGlobalObject is not NULL, this
+ * function may initialize based on this global (for example, using the
+ * global to locate a chrome window, create a new 'scope' for this
+ * global, etc)
+ *
+ * @param aGlobalObject the gobal object, which may be nsnull.
+ *
+ * @return NS_OK if context initialization was successful
+ *
+ **/
+ virtual nsresult InitContext(nsIScriptGlobalObject *aGlobalObject) = 0;
+
+ /**
+ * Check to see if context is as yet intialized. Used to prevent
+ * reentrancy issues during the initialization process.
+ *
+ * @return PR_TRUE if initialized, PR_FALSE if not
+ *
+ */
+ virtual PRBool IsContextInitialized() = 0;
+
+ /**
+ * Called as the global object discards its reference to the context.
+ */
+ virtual void FinalizeContext() = 0;
+
+ /**
+ * For garbage collected systems, do a synchronous collection pass.
+ * May be a no-op on other systems
+ *
+ * @return NS_OK if the method is successful
+ */
+ virtual void GC() = 0;
+
+ /**
+ * Inform the context that a script was evaluated.
+ * A GC may be done if "necessary."
+ * This call is necessary if script evaluation is done
+ * without using the EvaluateScript method.
+ * @param aTerminated If true then call termination function if it was
+ * previously set. Within DOM this will always be true, but outside
+ * callers (such as xpconnect) who may do script evaluations nested
+ * inside DOM script evaluations can pass false to avoid premature
+ * calls to the termination function.
+ * @return NS_OK if the method is successful
+ */
+ virtual void ScriptEvaluated(PRBool aTerminated) = 0;
+
+ virtual nsresult Serialize(nsIObjectOutputStream* aStream,
+ void *aScriptObject) = 0;
+
+ /* Deserialize a script from a stream.
+ */
+ virtual nsresult Deserialize(nsIObjectInputStream* aStream,
+ nsScriptObjectHolder &aResult) = 0;
+
+ /**
+ * JS only - this function need not be implemented by languages other
+ * than JS (ie, this should be moved to a private interface!)
+ * Called to specify a function that should be called when the current
+ * script (if there is one) terminates. Generally used if breakdown
+ * of script state needs to happen, but should be deferred till
+ * the end of script evaluation.
+ *
+ * @throws NS_ERROR_OUT_OF_MEMORY if that happens
+ */
+ virtual nsresult SetTerminationFunction(nsScriptTerminationFunc aFunc,
+ nsISupports* aRef) = 0;
+
+ /**
+ * Called to disable/enable script execution in this context.
+ */
+ virtual PRBool GetScriptsEnabled() = 0;
+ virtual void SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts) = 0;
+
+ // SetProperty is suspect and jst believes should not be needed. Currenly
+ // used only for "arguments".
+ virtual nsresult SetProperty(void *aTarget, const char *aPropName, nsISupports *aVal) = 0;
+ /**
+ * Called to set/get information if the script context is
+ * currently processing a script tag
+ */
+ virtual PRBool GetProcessingScriptTag() = 0;
+ virtual void SetProcessingScriptTag(PRBool aResult) = 0;
+
+ /**
+ * Tell the context whether or not to GC when destroyed. An optimization
+ * used when the window is a [i]frame, so GC will happen anyway.
+ */
+ virtual void SetGCOnDestruction(PRBool aGCOnDestruction) = 0;
+
+ /**
+ * Initialize DOM classes on aGlobalObj, always call
+ * WillInitializeContext() before calling InitContext(), and always
+ * call DidInitializeContext() when a context is fully
+ * (successfully) initialized.
+ */
+ virtual nsresult InitClasses(void *aGlobalObj) = 0;
+
+ /**
+ * Clear the scope object - may be called either as we are being torn down,
+ * or before we are attached to a different document.
+ *
+ * aClearFromProtoChain is probably somewhat JavaScript specific. It
+ * indicates that the global scope polluter should be removed from the
+ * prototype chain and that the objects in the prototype chain should
+ * also have their scopes cleared. We don't do this all the time
+ * because the prototype chain is shared between inner and outer
+ * windows, and needs to stay with inner windows that we're keeping
+ * around.
+ */
+ virtual void ClearScope(void* aGlobalObj, PRBool aClearFromProtoChain) = 0;
+
+ /**
+ * Tell the context we're about to be reinitialize it.
+ */
+ virtual void WillInitializeContext() = 0;
+
+ /**
+ * Tell the context we're done reinitializing it.
+ */
+ virtual void DidInitializeContext() = 0;
+
+ /**
+ * Tell the context our global has a new document, and the scope
+ * used by it. Use nsISupports to avoid dependency issues - but expect
+ * a QI for nsIDOMDocument and/or nsIDocument.
+ */
+ virtual void DidSetDocument(nsISupports *aDoc, void *aGlobal) = 0;
+
+ /* Memory managment for script objects. Used by the implementation of
+ * nsScriptObjectHolder to manage the lifetimes of the held script objects.
+ *
+ * See also nsIScriptRuntime, which has identical methods and is useful
+ * in situations when you do not have an nsIScriptContext.
+ *
+ */
+ virtual nsresult DropScriptObject(void *object) = 0;
+ virtual nsresult HoldScriptObject(void *object) = 0;
+
+ /* Report a pending exception if there is one on the native context */
+ virtual void ReportPendingException() = 0;
+};
+
+//NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContext, NS_ISCRIPTCONTEXT_IID) //SWT-20090407
+
+#endif // nsIScriptContext_h__
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h
new file mode 100644
index 0000000000..aa0198e11b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h
@@ -0,0 +1,194 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 sw=2 et tw=80: */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * This file is derived from the Original Code provided by mozilla.org,
+ * whose Initial Developer is Netscape Communications Corporation. Changes
+ * to the original file were made by SWT on April 7, 2009 and are marked
+ * with trailing comment "//SWT-20090407".
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef nsIScriptGlobalObject_h__
+#define nsIScriptGlobalObject_h__
+
+#include "nsISupports.h"
+//#include "nsEvent.h" //SWT-20090407
+#include "nsIProgrammingLanguage.h"
+
+class nsIScriptContext;
+class nsIDOMDocument;
+class nsIDOMEvent;
+class nsPresContext;
+class nsIScriptGlobalObjectOwner;
+class nsIArray;
+class nsScriptErrorEvent;
+class nsIScriptGlobalObject;
+//enum nsEventStatus; //SWT-20090407
+struct JSObject; // until we finally remove GetGlobalJSObject...
+
+// Some helpers for working with integer "script type IDs", and specifically
+// for working with arrays of such objects. For example, it is common for
+// implementations supporting multiple script languages to keep each
+// language's nsIScriptContext in an array indexed by the language ID.
+
+// Implementation note: We always ignore nsIProgrammingLanguage::UNKNOWN and
+// nsIProgrammingLanguage::CPLUSPLUS - this gives javascript slot 0. An
+// attempted micro-optimization tried to avoid us going all the way to
+// nsIProgrammingLanguage::MAX; however:
+// * Someone is reportedly working on a PHP impl - that has value 9
+// * nsGenericElement therefore allows 4 bits for the value.
+// So there is no good reason for us to be more restrictive again...
+
+#define NS_STID_FIRST nsIProgrammingLanguage::JAVASCRIPT
+// like nsGenericElement, only 4 bits worth is valid...
+#define NS_STID_LAST (nsIProgrammingLanguage::MAX > 0x000FU ? \
+ 0x000FU : nsIProgrammingLanguage::MAX)
+
+// Use to declare the array size
+#define NS_STID_ARRAY_UBOUND (NS_STID_LAST-NS_STID_FIRST+1)
+
+// Is a language ID valid?
+#define NS_STID_VALID(langID) (langID >= NS_STID_FIRST && langID <= NS_STID_LAST)
+
+// Return an index for a given ID.
+#define NS_STID_INDEX(langID) (langID-NS_STID_FIRST)
+
+// Create a 'for' loop iterating over all possible language IDs (*not* indexes)
+#define NS_STID_FOR_ID(varName) \
+ for (varName=NS_STID_FIRST;varName<=NS_STID_LAST;varName++)
+
+// Create a 'for' loop iterating over all indexes (when you don't need to know
+// what language it is)
+#define NS_STID_FOR_INDEX(varName) \
+ for (varName=0;varName<=NS_STID_INDEX(NS_STID_LAST);varName++)
+
+// A helper function for nsIScriptGlobalObject implementations to use
+// when handling a script error. Generally called by the global when a context
+// notifies it of an error via nsIScriptGlobalObject::HandleScriptError.
+// Returns PR_TRUE if HandleDOMEvent was actually called, in which case
+// aStatus will be filled in with the status.
+//PRBool //SWT-20090407
+//NS_HandleScriptError(nsIScriptGlobalObject *aScriptGlobal, //SWT-20090407
+// nsScriptErrorEvent *aErrorEvent, //SWT-20090407
+// nsEventStatus *aStatus); //SWT-20090407
+
+
+#define NS_ISCRIPTGLOBALOBJECT_IID \
+{ /* {6afecd40-0b9a-4cfd-8c42-0f645cd91829} */ \
+ 0x6afecd40, 0x0b9a, 0x4cfd, \
+ { 0x8c, 0x42, 0x0f, 0x64, 0x5c, 0xd9, 0x18, 0x29 } }
+
+/**
++ * The global object which keeps a script context for each supported script
++ * language. This often used to store per-window global state.
+ */
+
+class nsIScriptGlobalObject : public nsISupports
+{
+public:
+//NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTGLOBALOBJECT_IID) //SWT-20090407
+
+ /**
+ * Ensure that the script global object is initialized for working with the
+ * specified script language ID. This will set up the nsIScriptContext
+ * and 'script global' for that language, allowing these to be fetched
+ * and manipulated.
+ * @return NS_OK if successful; error conditions include that the language
+ * has not been registered, as well as 'normal' errors, such as
+ * out-of-memory
+ */
+ virtual nsresult EnsureScriptEnvironment(PRUint32 aLangID) = 0;
+ /**
+ * Get a script context (WITHOUT added reference) for the specified language.
+ */
+ virtual nsIScriptContext *GetScriptContext(PRUint32 lang) = 0;
+
+ /**
+ * Get the opaque "global" object for the specified lang.
+ */
+ virtual void *GetScriptGlobal(PRUint32 lang) = 0;
+
+ // Set/GetContext deprecated methods - use GetScriptContext/Global
+ virtual JSObject *GetGlobalJSObject() {
+ return (JSObject *)GetScriptGlobal(nsIProgrammingLanguage::JAVASCRIPT);
+ }
+
+ virtual nsIScriptContext *GetContext() {
+ return GetScriptContext(nsIProgrammingLanguage::JAVASCRIPT);
+ }
+
+ /**
+ * Set a new language context for this global. The native global for the
+ * context is created by the context's GetNativeGlobal() method.
+ */
+
+ virtual nsresult SetScriptContext(PRUint32 lang, nsIScriptContext *aContext) = 0;
+
+ /**
+ * Called when the global script for a language is finalized, typically as
+ * part of its GC process. By the time this call is made, the
+ * nsIScriptContext for the language has probably already been removed.
+ * After this call, the passed object is dead - which should generally be the
+ * same object the global is using for a global for that language.
+ */
+
+ virtual void OnFinalize(PRUint32 aLangID, void *aScriptGlobal) = 0;
+
+ /**
+ * Called to enable/disable scripts.
+ */
+ virtual void SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts) = 0;
+
+ /** Set a new arguments object for this window. This will be set on
+ * the window right away (if there's an existing document) and it
+ * will also be installed on the window when the next document is
+ * loaded. Each language impl is responsible for converting to
+ * an array of args as appropriate for that language.
+ */
+ virtual nsresult SetNewArguments(nsIArray *aArguments) = 0;
+
+ /** Handle a script error. Generally called by a script context.
+ */
+//virtual nsresult HandleScriptError(nsScriptErrorEvent *aErrorEvent, //SWT-20090407
+// nsEventStatus *aEventStatus) { //SWT-20090407
+// return NS_HandleScriptError(this, aErrorEvent, aEventStatus); //SWT-20090407
+//}
+};
+
+//NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptGlobalObject, //SWT-20090407
+// NS_ISCRIPTGLOBALOBJECT_IID) //SWT-20090407
+
+#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
index 750d2d6125..6989c4a9c4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp
@@ -436,6 +436,35 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIIIIIIIIIIIIISI)(JNIEnv *env,
}
#endif
+#if (!defined(NO__1VtblCall__IIIIIIIII_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJIIIIIII_3I) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIIIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8, jintArray arg9);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIIIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8, jintArray arg9)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIIIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8, jintArray arg9);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIIIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8, jintArray arg9)
+#endif
+{
+ jint *lparg9=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIIIIIIII_3I_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJIIIIIII_3I_FUNC);
+#endif
+ if (arg9) if ((lparg9 = env->GetIntArrayElements(arg9, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, jint, jint, jint, jint, jint, jint, jint *))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, lparg9);
+fail:
+ if (arg9 && lparg9) env->ReleaseIntArrayElements(arg9, lparg9, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIIIIIIII_3I_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJIIIIIII_3I_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIIIIIII_3C_3I_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJIIIIII_3C_3I_3I) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIIIIII_3C_3I_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jcharArray arg8, jintArray arg9, jintArray arg10);
@@ -471,6 +500,35 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIIIIII_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJIIIII_3I) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jintArray arg7);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jintArray arg7)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jintArray arg7);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIIIII_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jintArray arg7)
+#endif
+{
+ jint *lparg7=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIIIIII_3I_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJIIIII_3I_FUNC);
+#endif
+ if (arg7) if ((lparg7 = env->GetIntArrayElements(arg7, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, jint, jint, jint, jint, jint *))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, arg4, arg5, arg6, lparg7);
+fail:
+ if (arg7 && lparg7) env->ReleaseIntArrayElements(arg7, lparg7, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIIIIII_3I_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJIIIII_3I_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIIIIIJII) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJIIIIJII) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIIIIJII)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jlong arg6, jint arg7, jint arg8);
@@ -809,6 +867,67 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIII_3BII) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJII_3BII) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIII_3BII)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jbyteArray arg4, jint arg5, jint arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIII_3BII)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jbyteArray arg4, jint arg5, jint arg6)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJII_3BII)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jbyteArray arg4, jint arg5, jint arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJII_3BII)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jbyteArray arg4, jint arg5, jint arg6)
+#endif
+{
+ jbyte *lparg4=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIII_3BII_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJII_3BII_FUNC);
+#endif
+ if (arg4) if ((lparg4 = env->GetByteArrayElements(arg4, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, jint, jbyte *, jint, jint))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, lparg4, arg5, arg6);
+fail:
+ if (arg4 && lparg4) env->ReleaseByteArrayElements(arg4, lparg4, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIII_3BII_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJII_3BII_FUNC);
+#endif
+ return rc;
+}
+#endif
+
+#if (!defined(NO__1VtblCall__IIII_3B_3B) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJII_3B_3B) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIII_3B_3B)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jbyteArray arg4, jbyteArray arg5);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIII_3B_3B)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jbyteArray arg4, jbyteArray arg5)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJII_3B_3B)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jbyteArray arg4, jbyteArray arg5);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJII_3B_3B)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jbyteArray arg4, jbyteArray arg5)
+#endif
+{
+ jbyte *lparg4=NULL;
+ jbyte *lparg5=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIII_3B_3B_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJII_3B_3B_FUNC);
+#endif
+ if (arg4) if ((lparg4 = env->GetByteArrayElements(arg4, NULL)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = env->GetByteArrayElements(arg5, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, jint, jbyte *, jbyte *))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, lparg4, lparg5);
+fail:
+ if (arg5 && lparg5) env->ReleaseByteArrayElements(arg5, lparg5, 0);
+ if (arg4 && lparg4) env->ReleaseByteArrayElements(arg4, lparg4, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIII_3B_3B_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJII_3B_3B_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIII_3C) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJII_3C) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIII_3C)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jint arg3, jcharArray arg4);
@@ -1014,6 +1133,35 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIJJ)(JNIEnv *env, jclass that,
}
#endif
+#if (!defined(NO__1VtblCall__IIIJJJJJJ_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJIJJJJJJ_3J) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIJJJJJJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlong arg3, jlong arg4, jlong arg5, jlong arg6, jlong arg7, jlong arg8, jlongArray arg9);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIIJJJJJJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlong arg3, jlong arg4, jlong arg5, jlong arg6, jlong arg7, jlong arg8, jlongArray arg9)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIJJJJJJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlong arg3, jlong arg4, jlong arg5, jlong arg6, jlong arg7, jlong arg8, jlongArray arg9);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJIJJJJJJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jlong arg3, jlong arg4, jlong arg5, jlong arg6, jlong arg7, jlong arg8, jlongArray arg9)
+#endif
+{
+ jlong *lparg9=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIIJJJJJJ_3J_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJIJJJJJJ_3J_FUNC);
+#endif
+ if (arg9) if ((lparg9 = env->GetLongArrayElements(arg9, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, jlong, jlong, jlong, jlong, jlong, jlong, jlong *))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, lparg9);
+fail:
+ if (arg9 && lparg9) env->ReleaseLongArrayElements(arg9, lparg9, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIIJJJJJJ_3J_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJIJJJJJJ_3J_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jobject arg3);
@@ -1043,6 +1191,38 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2II_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2II_3I) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2II_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4, jint arg5, jintArray arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2II_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4, jint arg5, jintArray arg6)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2II_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4, jint arg5, jintArray arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2II_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4, jint arg5, jintArray arg6)
+#endif
+{
+ nsID _arg3, *lparg3=NULL;
+ jint *lparg6=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2II_3I_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2II_3I_FUNC);
+#endif
+ if (arg3) if ((lparg3 = getnsIDFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = env->GetIntArrayElements(arg6, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, nsID *, jint, jint, jint *))(*(jintLong **)arg1)[arg0])(arg1, arg2, lparg3, arg4, arg5, lparg6);
+fail:
+ if (arg6 && lparg6) env->ReleaseIntArrayElements(arg6, lparg6, 0);
+ if (arg3 && lparg3) setnsIDFields(env, arg3, lparg3);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2II_3I_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2II_3I_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2_3I) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jobject arg3, jintArray arg4);
@@ -1165,6 +1345,35 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__III_3BS) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJI_3BS) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__III_3BS)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jbyteArray arg3, jshort arg4);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__III_3BS)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jbyteArray arg3, jshort arg4)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJI_3BS)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jbyteArray arg3, jshort arg4);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJI_3BS)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jbyteArray arg3, jshort arg4)
+#endif
+{
+ jbyte *lparg3=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__III_3BS_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJI_3BS_FUNC);
+#endif
+ if (arg3) if ((lparg3 = env->GetByteArrayElements(arg3, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint, jbyte *, jshort))(*(jintLong **)arg1)[arg0])(arg1, arg2, lparg3, arg4);
+fail:
+ if (arg3 && lparg3) env->ReleaseByteArrayElements(arg3, lparg3, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__III_3BS_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJI_3BS_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__III_3B_3B_3BI_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJI_3B_3B_3BI_3I) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__III_3B_3B_3BI_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2, jbyteArray arg3, jbyteArray arg4, jbyteArray arg5, jint arg6, jintArray arg7);
@@ -2339,6 +2548,35 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJJJJJJ)(JNIEnv *env, jclass t
}
#endif
+#if (!defined(NO__1VtblCall__IIJJJJJ_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJJJJJ_3J) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJJJJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jlong arg4, jlong arg5, jlong arg6, jlongArray arg7);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJJJJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jlong arg4, jlong arg5, jlong arg6, jlongArray arg7)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJJJJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jlong arg4, jlong arg5, jlong arg6, jlongArray arg7);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJJJJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jlong arg4, jlong arg5, jlong arg6, jlongArray arg7)
+#endif
+{
+ jlong *lparg7=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIJJJJJ_3J_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJJJJJJ_3J_FUNC);
+#endif
+ if (arg7) if ((lparg7 = env->GetLongArrayElements(arg7, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jlong, jlong, jlong, jlong, jlong, jlong *))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, arg4, arg5, arg6, lparg7);
+fail:
+ if (arg7 && lparg7) env->ReleaseLongArrayElements(arg7, lparg7, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIJJJJJ_3J_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJJJJJJ_3J_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIJJJ_3B_3BJ) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJJJ_3B_3BJ) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJJ_3B_3BJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jlong arg4, jbyteArray arg5, jbyteArray arg6, jlong arg7);
@@ -2458,6 +2696,67 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIJJ_3BJI) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJJ_3BJI) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJ_3BJI)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jbyteArray arg4, jlong arg5, jint arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJ_3BJI)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jbyteArray arg4, jlong arg5, jint arg6)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJ_3BJI)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jbyteArray arg4, jlong arg5, jint arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJ_3BJI)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jbyteArray arg4, jlong arg5, jint arg6)
+#endif
+{
+ jbyte *lparg4=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIJJ_3BJI_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJJJ_3BJI_FUNC);
+#endif
+ if (arg4) if ((lparg4 = env->GetByteArrayElements(arg4, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jlong, jlong, jbyte *, jlong, jint))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, lparg4, arg5, arg6);
+fail:
+ if (arg4 && lparg4) env->ReleaseByteArrayElements(arg4, lparg4, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIJJ_3BJI_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJJJ_3BJI_FUNC);
+#endif
+ return rc;
+}
+#endif
+
+#if (!defined(NO__1VtblCall__IIJJ_3B_3B) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJJ_3B_3B) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJ_3B_3B)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jbyteArray arg4, jbyteArray arg5);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJ_3B_3B)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jbyteArray arg4, jbyteArray arg5)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJ_3B_3B)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jbyteArray arg4, jbyteArray arg5);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJJ_3B_3B)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jbyteArray arg4, jbyteArray arg5)
+#endif
+{
+ jbyte *lparg4=NULL;
+ jbyte *lparg5=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIJJ_3B_3B_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJJJ_3B_3B_FUNC);
+#endif
+ if (arg4) if ((lparg4 = env->GetByteArrayElements(arg4, NULL)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = env->GetByteArrayElements(arg5, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jlong, jlong, jbyte *, jbyte *))(*(jintLong **)arg1)[arg0])(arg1, arg2, arg3, lparg4, lparg5);
+fail:
+ if (arg5 && lparg5) env->ReleaseByteArrayElements(arg5, lparg5, 0);
+ if (arg4 && lparg4) env->ReleaseByteArrayElements(arg4, lparg4, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIJJ_3B_3B_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJJJ_3B_3B_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIJJ_3CIJI) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJJ_3CIJI) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJJ_3CIJI)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jlong arg3, jcharArray arg4, jint arg5, jlong arg6, jint arg7);
@@ -2638,6 +2937,38 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jobject arg3, jlong arg4, jlong arg5, jlongArray arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jobject arg3, jlong arg4, jlong arg5, jlongArray arg6)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jobject arg3, jlong arg4, jlong arg5, jlongArray arg6);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jobject arg3, jlong arg4, jlong arg5, jlongArray arg6)
+#endif
+{
+ nsID _arg3, *lparg3=NULL;
+ jlong *lparg6=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J_FUNC);
+#endif
+ if (arg3) if ((lparg3 = getnsIDFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = env->GetLongArrayElements(arg6, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jlong, nsID *, jlong, jlong, jlong *))(*(jintLong **)arg1)[arg0])(arg1, arg2, lparg3, arg4, arg5, lparg6);
+fail:
+ if (arg6 && lparg6) env->ReleaseLongArrayElements(arg6, lparg6, 0);
+ if (arg3 && lparg3) setnsIDFields(env, arg3, lparg3);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2_3J) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jobject arg3, jlongArray arg4);
@@ -2728,6 +3059,35 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIJ_3BJ) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJ_3BJ) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJ_3BJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jlong arg4);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJ_3BJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jlong arg4)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJ_3BJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jlong arg4);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJ_3BJ)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jlong arg4)
+#endif
+{
+ jbyte *lparg3=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIJ_3BJ_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJJ_3BJ_FUNC);
+#endif
+ if (arg3) if ((lparg3 = env->GetByteArrayElements(arg3, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jlong, jbyte *, jlong))(*(jintLong **)arg1)[arg0])(arg1, arg2, lparg3, arg4);
+fail:
+ if (arg3 && lparg3) env->ReleaseByteArrayElements(arg3, lparg3, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIJ_3BJ_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJJ_3BJ_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIJ_3BJ_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJ_3BJ_3J) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJ_3BJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jlong arg4, jlongArray arg5);
@@ -2760,6 +3120,35 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__IIJ_3BS) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJ_3BS) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJ_3BS)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jshort arg4);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJ_3BS)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jshort arg4)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJ_3BS)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jshort arg4);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJJ_3BS)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jshort arg4)
+#endif
+{
+ jbyte *lparg3=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IIJ_3BS_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJJ_3BS_FUNC);
+#endif
+ if (arg3) if ((lparg3 = env->GetByteArrayElements(arg3, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jlong, jbyte *, jshort))(*(jintLong **)arg1)[arg0])(arg1, arg2, lparg3, arg4);
+fail:
+ if (arg3 && lparg3) env->ReleaseByteArrayElements(arg3, lparg3, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IIJ_3BS_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJJ_3BS_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__IIJ_3B_3B_3BJ_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJJ_3B_3B_3BJ_3J) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IIJ_3B_3B_3BJ_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlong arg2, jbyteArray arg3, jbyteArray arg4, jbyteArray arg5, jlong arg6, jlongArray arg7);
@@ -4105,6 +4494,38 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__II_3BJ_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJ_3BJ_3I) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__II_3BJ_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jbyteArray arg2, jlong arg3, jintArray arg4);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__II_3BJ_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jbyteArray arg2, jlong arg3, jintArray arg4)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJ_3BJ_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jbyteArray arg2, jlong arg3, jintArray arg4);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJ_3BJ_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jbyteArray arg2, jlong arg3, jintArray arg4)
+#endif
+{
+ jbyte *lparg2=NULL;
+ jint *lparg4=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__II_3BJ_3I_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJ_3BJ_3I_FUNC);
+#endif
+ if (arg2) if ((lparg2 = env->GetByteArrayElements(arg2, NULL)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = env->GetIntArrayElements(arg4, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jbyte *, jlong, jint *))(*(jintLong **)arg1)[arg0])(arg1, lparg2, arg3, lparg4);
+fail:
+ if (arg4 && lparg4) env->ReleaseIntArrayElements(arg4, lparg4, 0);
+ if (arg2 && lparg2) env->ReleaseByteArrayElements(arg2, lparg2, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__II_3BJ_3I_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJ_3BJ_3I_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__II_3BLorg_eclipse_swt_internal_mozilla_nsID_2I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJ_3BLorg_eclipse_swt_internal_mozilla_nsID_2I) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__II_3BLorg_eclipse_swt_internal_mozilla_nsID_2I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jbyteArray arg2, jobject arg3, jint arg4);
@@ -4964,6 +5385,50 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__II_3I_3I_3I_3I_3I_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJ_3I_3I_3I_3I_3I_3I) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__II_3I_3I_3I_3I_3I_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jintArray arg2, jintArray arg3, jintArray arg4, jintArray arg5, jintArray arg6, jintArray arg7);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__II_3I_3I_3I_3I_3I_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jintArray arg2, jintArray arg3, jintArray arg4, jintArray arg5, jintArray arg6, jintArray arg7)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJ_3I_3I_3I_3I_3I_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jintArray arg2, jintArray arg3, jintArray arg4, jintArray arg5, jintArray arg6, jintArray arg7);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJ_3I_3I_3I_3I_3I_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jintArray arg2, jintArray arg3, jintArray arg4, jintArray arg5, jintArray arg6, jintArray arg7)
+#endif
+{
+ jint *lparg2=NULL;
+ jint *lparg3=NULL;
+ jint *lparg4=NULL;
+ jint *lparg5=NULL;
+ jint *lparg6=NULL;
+ jint *lparg7=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__II_3I_3I_3I_3I_3I_3I_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJ_3I_3I_3I_3I_3I_3I_FUNC);
+#endif
+ if (arg2) if ((lparg2 = env->GetIntArrayElements(arg2, NULL)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = env->GetIntArrayElements(arg3, NULL)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = env->GetIntArrayElements(arg4, NULL)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = env->GetIntArrayElements(arg5, NULL)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = env->GetIntArrayElements(arg6, NULL)) == NULL) goto fail;
+ if (arg7) if ((lparg7 = env->GetIntArrayElements(arg7, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jint *, jint *, jint *, jint *, jint *, jint *))(*(jintLong **)arg1)[arg0])(arg1, lparg2, lparg3, lparg4, lparg5, lparg6, lparg7);
+fail:
+ if (arg7 && lparg7) env->ReleaseIntArrayElements(arg7, lparg7, 0);
+ if (arg6 && lparg6) env->ReleaseIntArrayElements(arg6, lparg6, 0);
+ if (arg5 && lparg5) env->ReleaseIntArrayElements(arg5, lparg5, 0);
+ if (arg4 && lparg4) env->ReleaseIntArrayElements(arg4, lparg4, 0);
+ if (arg3 && lparg3) env->ReleaseIntArrayElements(arg3, lparg3, 0);
+ if (arg2 && lparg2) env->ReleaseIntArrayElements(arg2, lparg2, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__II_3I_3I_3I_3I_3I_3I_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJ_3I_3I_3I_3I_3I_3I_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__II_3I_3J) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJ_3I_3J) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__II_3I_3J)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jintArray arg2, jlongArray arg3);
@@ -5162,6 +5627,50 @@ fail:
}
#endif
+#if (!defined(NO__1VtblCall__II_3J_3J_3J_3J_3J_3I) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJ_3J_3J_3J_3J_3J_3I) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__II_3J_3J_3J_3J_3J_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlongArray arg2, jlongArray arg3, jlongArray arg4, jlongArray arg5, jlongArray arg6, jintArray arg7);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__II_3J_3J_3J_3J_3J_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlongArray arg2, jlongArray arg3, jlongArray arg4, jlongArray arg5, jlongArray arg6, jintArray arg7)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJ_3J_3J_3J_3J_3J_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlongArray arg2, jlongArray arg3, jlongArray arg4, jlongArray arg5, jlongArray arg6, jintArray arg7);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__IJ_3J_3J_3J_3J_3J_3I)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jlongArray arg2, jlongArray arg3, jlongArray arg4, jlongArray arg5, jlongArray arg6, jintArray arg7)
+#endif
+{
+ jlong *lparg2=NULL;
+ jlong *lparg3=NULL;
+ jlong *lparg4=NULL;
+ jlong *lparg5=NULL;
+ jlong *lparg6=NULL;
+ jint *lparg7=NULL;
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__II_3J_3J_3J_3J_3J_3I_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1VtblCall__IJ_3J_3J_3J_3J_3J_3I_FUNC);
+#endif
+ if (arg2) if ((lparg2 = env->GetLongArrayElements(arg2, NULL)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = env->GetLongArrayElements(arg3, NULL)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = env->GetLongArrayElements(arg4, NULL)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = env->GetLongArrayElements(arg5, NULL)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = env->GetLongArrayElements(arg6, NULL)) == NULL) goto fail;
+ if (arg7) if ((lparg7 = env->GetIntArrayElements(arg7, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (STDMETHODCALLTYPE *)(jintLong, jlong *, jlong *, jlong *, jlong *, jlong *, jint *))(*(jintLong **)arg1)[arg0])(arg1, lparg2, lparg3, lparg4, lparg5, lparg6, lparg7);
+fail:
+ if (arg7 && lparg7) env->ReleaseIntArrayElements(arg7, lparg7, 0);
+ if (arg6 && lparg6) env->ReleaseLongArrayElements(arg6, lparg6, 0);
+ if (arg5 && lparg5) env->ReleaseLongArrayElements(arg5, lparg5, 0);
+ if (arg4 && lparg4) env->ReleaseLongArrayElements(arg4, lparg4, 0);
+ if (arg3 && lparg3) env->ReleaseLongArrayElements(arg3, lparg3, 0);
+ if (arg2 && lparg2) env->ReleaseLongArrayElements(arg2, lparg2, 0);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__II_3J_3J_3J_3J_3J_3I_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1VtblCall__IJ_3J_3J_3J_3J_3J_3I_FUNC);
+#endif
+ return rc;
+}
+#endif
+
#if (!defined(NO__1VtblCall__II_3S) && !defined(JNI64)) || (!defined(NO__1VtblCall__IJ_3S) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1VtblCall__II_3S)(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jshortArray arg2);
@@ -5526,6 +6035,58 @@ JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIMemory_1Realloc)
}
#endif
+#ifndef NO__1nsIScriptContext_1GetNativeContext
+extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptContext_1GetNativeContext)(JNIEnv *env, jclass that, jintLong arg0);
+JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptContext_1GetNativeContext)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ XPCOM_NATIVE_ENTER(env, that, _1nsIScriptContext_1GetNativeContext_FUNC);
+ rc = (jintLong)((nsIScriptContext *)arg0)->GetNativeContext();
+ XPCOM_NATIVE_EXIT(env, that, _1nsIScriptContext_1GetNativeContext_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO__1nsIScriptGlobalObject_1EnsureScriptEnvironment
+extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject_1EnsureScriptEnvironment)(JNIEnv *env, jclass that, jintLong arg0, jint arg1);
+JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject_1EnsureScriptEnvironment)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
+{
+ jintLong rc = 0;
+ XPCOM_NATIVE_ENTER(env, that, _1nsIScriptGlobalObject_1EnsureScriptEnvironment_FUNC);
+ rc = (jintLong)((nsIScriptGlobalObject *)arg0)->EnsureScriptEnvironment(arg1);
+ XPCOM_NATIVE_EXIT(env, that, _1nsIScriptGlobalObject_1EnsureScriptEnvironment_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO__1nsIScriptGlobalObject_1GetScriptContext
+extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject_1GetScriptContext)(JNIEnv *env, jclass that, jintLong arg0, jint arg1);
+JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject_1GetScriptContext)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
+{
+ jintLong rc = 0;
+ XPCOM_NATIVE_ENTER(env, that, _1nsIScriptGlobalObject_1GetScriptContext_FUNC);
+ rc = (jintLong)((nsIScriptGlobalObject *)arg0)->GetScriptContext(arg1);
+ XPCOM_NATIVE_EXIT(env, that, _1nsIScriptGlobalObject_1GetScriptContext_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO__1nsIScriptGlobalObject_1GetScriptGlobal
+extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject_1GetScriptGlobal)(JNIEnv *env, jclass that, jintLong arg0, jint arg1);
+JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject_1GetScriptGlobal)
+ (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
+{
+ jintLong rc = 0;
+ XPCOM_NATIVE_ENTER(env, that, _1nsIScriptGlobalObject_1GetScriptGlobal_FUNC);
+ rc = (jintLong)((nsIScriptGlobalObject *)arg0)->GetScriptGlobal(arg1);
+ XPCOM_NATIVE_EXIT(env, that, _1nsIScriptGlobalObject_1GetScriptGlobal_FUNC);
+ return rc;
+}
+#endif
+
#if (!defined(NO_memmove__ILorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2I) && !defined(JNI64)) || (!defined(NO_memmove__JLorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2J) && defined(JNI64))
#ifndef JNI64
extern "C" JNIEXPORT void JNICALL XPCOM_NATIVE(memmove__ILorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h
index 8653680f3d..04955ccd83 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h
@@ -21,15 +21,23 @@
#include "nsIMemory.h"
#include "nsISupportsUtils.h"
#include "nsXPCOMGlue.h"
+#include "xpcom_custom.h"
+
+#ifdef XULRUNNER
+#ifndef nsIScriptContext_h__
+#include "nsIScriptContext.h"
+#include "nsIScriptGlobalObject.h"
+#endif /* nsIScriptContext_h__ */
+#endif
#ifdef _WIN32
#define STDMETHODCALLTYPE __stdcall
#define NO__1NS_1InitXPCOM2
-#else
+#else /* _WIN32 */
#define STDMETHODCALLTYPE
-#ifdef _OSX
+#ifdef __APPLE__
#define NO__1NS_1InitXPCOM2
-#endif /* _OSX */
+#endif /* __APPLE__ */
#endif /* _WIN32 */
#define SWT_XREInitEmbedding nsresult (*)(nsILocalFile *,nsILocalFile *,nsIDirectoryServiceProvider *,nsStaticModuleInfo const *,PRUint32)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.cpp
index 09ef38d3a5..2042583de0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.cpp
@@ -35,4 +35,54 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(strlen_1PRUnichar)
}
#endif
+#ifndef NO__1JS_1EvaluateUCScriptForPrincipals
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1JS_1EvaluateUCScriptForPrincipals)
+ (JNIEnv *env, jclass that, jbyteArray mozillaPath, jintLong arg0, jintLong arg1, jintLong arg2, jcharArray arg3, jint arg4, jbyteArray arg5, jint arg6, jintLongArray arg7)
+{
+ jbyte *lpmozillaPath=NULL;
+ jchar *lparg3=NULL;
+ jbyte *lparg5=NULL;
+ jintLong *lparg7=NULL;
+ jint rc = 0;
+ XPCOM_NATIVE_ENTER(env, that, _1JS_1EvaluateUCScriptForPrincipals_FUNC);
+ if (mozillaPath) if ((lpmozillaPath = env->GetByteArrayElements(mozillaPath, NULL)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = env->GetCharArrayElements(arg3, NULL)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = env->GetByteArrayElements(arg5, NULL)) == NULL) goto fail;
+ if (arg7) if ((lparg7 = env->GetIntLongArrayElements(arg7, NULL)) == NULL) goto fail;
+/*
+ rc = (jint)JS_EvaluateUCScriptForPrincipals(arg0, arg1, arg2, lparg3, arg4, lparg5, arg6, lparg7);
+*/
+ {
+
+#ifdef _WIN32
+ LOAD_FUNCTION(fp, JS_EvaluateUCScriptForPrincipals)
+ if (fp) {
+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong, jintLong, jintLong, jchar *, jint, jbyte *, jint, jintLong *))fp)(arg0, arg1, arg2, lparg3, arg4, lparg5, arg6, lparg7);
+ }
+#else
+#define CALLING_CONVENTION
+ static int initialized = 0;
+ static void *fp = NULL;
+ if (!initialized) {
+ void* handle = dlopen((const char *)lpmozillaPath, RTLD_LAZY);
+ if (handle) {
+ fp = dlsym(handle, "JS_EvaluateUCScriptForPrincipals");
+ }
+ initialized = 1;
+ }
+ if (fp) {
+ rc = (jint)((jint (CALLING_CONVENTION*)(jintLong, jintLong, jintLong, jchar *, jint, jbyte *, jint, jintLong *))fp)(arg0, arg1, arg2, lparg3, arg4, lparg5, arg6, lparg7);
+ }
+#endif /* _WIN32 */
+ }
+fail:
+ if (arg7 && lparg7) env->ReleaseIntLongArrayElements(arg7, lparg7, 0);
+ if (arg5 && lparg5) env->ReleaseByteArrayElements(arg5, lparg5, 0);
+ if (arg3 && lparg3) env->ReleaseCharArrayElements(arg3, lparg3, 0);
+ if (mozillaPath && lpmozillaPath) env->ReleaseByteArrayElements(mozillaPath, lpmozillaPath, 0);
+ XPCOM_NATIVE_EXIT(env, that, _1JS_1EvaluateUCScriptForPrincipals_FUNC);
+ return rc;
+}
+#endif
+
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.h
new file mode 100644
index 0000000000..c11fe30889
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.h
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#ifdef _WIN32
+#include <windows.h>
+#define JS_EvaluateUCScriptForPrincipals_LIB "js3250.dll"
+#define XP_WIN
+#else
+#include <dlfcn.h>
+#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
index 416e46d0ce..dc7a4cc736 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
@@ -14,9 +14,10 @@
#ifdef NATIVE_STATS
-int XPCOM_nativeFunctionCount = 191;
-int XPCOM_nativeFunctionCallCount[191];
+int XPCOM_nativeFunctionCount = 213;
+int XPCOM_nativeFunctionCallCount[213];
char * XPCOM_nativeFunctionNames[] = {
+ "GetAddress",
#ifndef JNI64
"_1Call__I",
#else
@@ -32,6 +33,7 @@ char * XPCOM_nativeFunctionNames[] = {
#else
"_1Call__JJJ_3BII_3I",
#endif
+ "_1JS_1EvaluateUCScriptForPrincipals",
"_1NS_1GetComponentManager",
"_1NS_1GetServiceManager",
"_1NS_1InitXPCOM2",
@@ -92,11 +94,21 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJIIIIIIIIIIIIISI",
#endif
#ifndef JNI64
+ "_1VtblCall__IIIIIIIII_3I",
+#else
+ "_1VtblCall__IJIIIIIII_3I",
+#endif
+#ifndef JNI64
"_1VtblCall__IIIIIIII_3C_3I_3I",
#else
"_1VtblCall__IJIIIIII_3C_3I_3I",
#endif
#ifndef JNI64
+ "_1VtblCall__IIIIIII_3I",
+#else
+ "_1VtblCall__IJIIIII_3I",
+#endif
+#ifndef JNI64
"_1VtblCall__IIIIIIJII",
#else
"_1VtblCall__IJIIIIJII",
@@ -152,6 +164,16 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJII_3BI",
#endif
#ifndef JNI64
+ "_1VtblCall__IIII_3BII",
+#else
+ "_1VtblCall__IJII_3BII",
+#endif
+#ifndef JNI64
+ "_1VtblCall__IIII_3B_3B",
+#else
+ "_1VtblCall__IJII_3B_3B",
+#endif
+#ifndef JNI64
"_1VtblCall__IIII_3C",
#else
"_1VtblCall__IJII_3C",
@@ -187,11 +209,21 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJIJJ",
#endif
#ifndef JNI64
+ "_1VtblCall__IIIJJJJJJ_3J",
+#else
+ "_1VtblCall__IJIJJJJJJ_3J",
+#endif
+#ifndef JNI64
"_1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2",
#else
"_1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2",
#endif
#ifndef JNI64
+ "_1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2II_3I",
+#else
+ "_1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2II_3I",
+#endif
+#ifndef JNI64
"_1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2_3I",
#else
"_1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2_3I",
@@ -212,6 +244,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJI_3BI_3I",
#endif
#ifndef JNI64
+ "_1VtblCall__III_3BS",
+#else
+ "_1VtblCall__IJI_3BS",
+#endif
+#ifndef JNI64
"_1VtblCall__III_3B_3B_3BI_3I",
#else
"_1VtblCall__IJI_3B_3B_3BI_3I",
@@ -397,6 +434,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJJJJJJJJ",
#endif
#ifndef JNI64
+ "_1VtblCall__IIJJJJJ_3J",
+#else
+ "_1VtblCall__IJJJJJJ_3J",
+#endif
+#ifndef JNI64
"_1VtblCall__IIJJJ_3B_3BJ",
#else
"_1VtblCall__IJJJJ_3B_3BJ",
@@ -417,6 +459,16 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJJJ_3BJ",
#endif
#ifndef JNI64
+ "_1VtblCall__IIJJ_3BJI",
+#else
+ "_1VtblCall__IJJJ_3BJI",
+#endif
+#ifndef JNI64
+ "_1VtblCall__IIJJ_3B_3B",
+#else
+ "_1VtblCall__IJJJ_3B_3B",
+#endif
+#ifndef JNI64
"_1VtblCall__IIJJ_3CIJI",
#else
"_1VtblCall__IJJJ_3CIJI",
@@ -447,6 +499,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2",
#endif
#ifndef JNI64
+ "_1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J",
+#else
+ "_1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J",
+#endif
+#ifndef JNI64
"_1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2_3J",
#else
"_1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2_3J",
@@ -462,11 +519,21 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJJ_3BI",
#endif
#ifndef JNI64
+ "_1VtblCall__IIJ_3BJ",
+#else
+ "_1VtblCall__IJJ_3BJ",
+#endif
+#ifndef JNI64
"_1VtblCall__IIJ_3BJ_3J",
#else
"_1VtblCall__IJJ_3BJ_3J",
#endif
#ifndef JNI64
+ "_1VtblCall__IIJ_3BS",
+#else
+ "_1VtblCall__IJJ_3BS",
+#endif
+#ifndef JNI64
"_1VtblCall__IIJ_3B_3B_3BJ_3J",
#else
"_1VtblCall__IJJ_3B_3B_3BJ_3J",
@@ -662,6 +729,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJ_3BJLorg_eclipse_swt_internal_mozilla_nsID_2_3J",
#endif
#ifndef JNI64
+ "_1VtblCall__II_3BJ_3I",
+#else
+ "_1VtblCall__IJ_3BJ_3I",
+#endif
+#ifndef JNI64
"_1VtblCall__II_3BLorg_eclipse_swt_internal_mozilla_nsID_2I",
#else
"_1VtblCall__IJ_3BLorg_eclipse_swt_internal_mozilla_nsID_2I",
@@ -792,6 +864,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJ_3I_3I_3I_3I",
#endif
#ifndef JNI64
+ "_1VtblCall__II_3I_3I_3I_3I_3I_3I",
+#else
+ "_1VtblCall__IJ_3I_3I_3I_3I_3I_3I",
+#endif
+#ifndef JNI64
"_1VtblCall__II_3I_3J",
#else
"_1VtblCall__IJ_3I_3J",
@@ -822,6 +899,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1VtblCall__IJ_3J_3J_3J",
#endif
#ifndef JNI64
+ "_1VtblCall__II_3J_3J_3J_3J_3J_3I",
+#else
+ "_1VtblCall__IJ_3J_3J_3J_3J_3J_3I",
+#endif
+#ifndef JNI64
"_1VtblCall__II_3S",
#else
"_1VtblCall__IJ_3S",
@@ -859,6 +941,10 @@ char * XPCOM_nativeFunctionNames[] = {
"_1nsID_1new",
"_1nsIMemory_1Alloc",
"_1nsIMemory_1Realloc",
+ "_1nsIScriptContext_1GetNativeContext",
+ "_1nsIScriptGlobalObject_1EnsureScriptEnvironment",
+ "_1nsIScriptGlobalObject_1GetScriptContext",
+ "_1nsIScriptGlobalObject_1GetScriptGlobal",
#ifndef JNI64
"memmove__ILorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2I",
#else
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
index ee85e97c0f..94036b34c2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
@@ -25,6 +25,7 @@ extern char* XPCOM_nativeFunctionNames[];
#endif
typedef enum {
+ GetAddress_FUNC,
#ifndef JNI64
_1Call__I_FUNC,
#else
@@ -40,6 +41,7 @@ typedef enum {
#else
_1Call__JJJ_3BII_3I_FUNC,
#endif
+ _1JS_1EvaluateUCScriptForPrincipals_FUNC,
_1NS_1GetComponentManager_FUNC,
_1NS_1GetServiceManager_FUNC,
_1NS_1InitXPCOM2_FUNC,
@@ -100,11 +102,21 @@ typedef enum {
_1VtblCall__IJIIIIIIIIIIIIISI_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIIIIIIII_3I_FUNC,
+#else
+ _1VtblCall__IJIIIIIII_3I_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIIIIIII_3C_3I_3I_FUNC,
#else
_1VtblCall__IJIIIIII_3C_3I_3I_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIIIIII_3I_FUNC,
+#else
+ _1VtblCall__IJIIIII_3I_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIIIIIJII_FUNC,
#else
_1VtblCall__IJIIIIJII_FUNC,
@@ -160,6 +172,16 @@ typedef enum {
_1VtblCall__IJII_3BI_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIII_3BII_FUNC,
+#else
+ _1VtblCall__IJII_3BII_FUNC,
+#endif
+#ifndef JNI64
+ _1VtblCall__IIII_3B_3B_FUNC,
+#else
+ _1VtblCall__IJII_3B_3B_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIII_3C_FUNC,
#else
_1VtblCall__IJII_3C_FUNC,
@@ -195,11 +217,21 @@ typedef enum {
_1VtblCall__IJIJJ_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIIJJJJJJ_3J_FUNC,
+#else
+ _1VtblCall__IJIJJJJJJ_3J_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2_FUNC,
#else
_1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2II_3I_FUNC,
+#else
+ _1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2II_3I_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIILorg_eclipse_swt_internal_mozilla_nsID_2_3I_FUNC,
#else
_1VtblCall__IJILorg_eclipse_swt_internal_mozilla_nsID_2_3I_FUNC,
@@ -220,6 +252,11 @@ typedef enum {
_1VtblCall__IJI_3BI_3I_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__III_3BS_FUNC,
+#else
+ _1VtblCall__IJI_3BS_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__III_3B_3B_3BI_3I_FUNC,
#else
_1VtblCall__IJI_3B_3B_3BI_3I_FUNC,
@@ -405,6 +442,11 @@ typedef enum {
_1VtblCall__IJJJJJJJJ_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIJJJJJ_3J_FUNC,
+#else
+ _1VtblCall__IJJJJJJ_3J_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIJJJ_3B_3BJ_FUNC,
#else
_1VtblCall__IJJJJ_3B_3BJ_FUNC,
@@ -425,6 +467,16 @@ typedef enum {
_1VtblCall__IJJJ_3BJ_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIJJ_3BJI_FUNC,
+#else
+ _1VtblCall__IJJJ_3BJI_FUNC,
+#endif
+#ifndef JNI64
+ _1VtblCall__IIJJ_3B_3B_FUNC,
+#else
+ _1VtblCall__IJJJ_3B_3B_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIJJ_3CIJI_FUNC,
#else
_1VtblCall__IJJJ_3CIJI_FUNC,
@@ -455,6 +507,11 @@ typedef enum {
_1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J_FUNC,
+#else
+ _1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2JJ_3J_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIJLorg_eclipse_swt_internal_mozilla_nsID_2_3J_FUNC,
#else
_1VtblCall__IJJLorg_eclipse_swt_internal_mozilla_nsID_2_3J_FUNC,
@@ -470,11 +527,21 @@ typedef enum {
_1VtblCall__IJJ_3BI_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIJ_3BJ_FUNC,
+#else
+ _1VtblCall__IJJ_3BJ_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIJ_3BJ_3J_FUNC,
#else
_1VtblCall__IJJ_3BJ_3J_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__IIJ_3BS_FUNC,
+#else
+ _1VtblCall__IJJ_3BS_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__IIJ_3B_3B_3BJ_3J_FUNC,
#else
_1VtblCall__IJJ_3B_3B_3BJ_3J_FUNC,
@@ -670,6 +737,11 @@ typedef enum {
_1VtblCall__IJ_3BJLorg_eclipse_swt_internal_mozilla_nsID_2_3J_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__II_3BJ_3I_FUNC,
+#else
+ _1VtblCall__IJ_3BJ_3I_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__II_3BLorg_eclipse_swt_internal_mozilla_nsID_2I_FUNC,
#else
_1VtblCall__IJ_3BLorg_eclipse_swt_internal_mozilla_nsID_2I_FUNC,
@@ -800,6 +872,11 @@ typedef enum {
_1VtblCall__IJ_3I_3I_3I_3I_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__II_3I_3I_3I_3I_3I_3I_FUNC,
+#else
+ _1VtblCall__IJ_3I_3I_3I_3I_3I_3I_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__II_3I_3J_FUNC,
#else
_1VtblCall__IJ_3I_3J_FUNC,
@@ -830,6 +907,11 @@ typedef enum {
_1VtblCall__IJ_3J_3J_3J_FUNC,
#endif
#ifndef JNI64
+ _1VtblCall__II_3J_3J_3J_3J_3J_3I_FUNC,
+#else
+ _1VtblCall__IJ_3J_3J_3J_3J_3J_3I_FUNC,
+#endif
+#ifndef JNI64
_1VtblCall__II_3S_FUNC,
#else
_1VtblCall__IJ_3S_FUNC,
@@ -867,6 +949,10 @@ typedef enum {
_1nsID_1new_FUNC,
_1nsIMemory_1Alloc_FUNC,
_1nsIMemory_1Realloc_FUNC,
+ _1nsIScriptContext_1GetNativeContext_FUNC,
+ _1nsIScriptGlobalObject_1EnsureScriptEnvironment_FUNC,
+ _1nsIScriptGlobalObject_1GetScriptContext_FUNC,
+ _1nsIScriptGlobalObject_1GetScriptGlobal_FUNC,
#ifndef JNI64
memmove__ILorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2I_FUNC,
#else
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
index f00dfa19a4..d976f885c0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
@@ -1679,19 +1679,119 @@ void disposeCOMInterfaces () {
}
public boolean execute (String script) {
- String url = PREFIX_JAVASCRIPT + script + ";void(0);"; //$NON-NLS-1$
+ /*
+ * This could be the first content that is set into the browser, so
+ * ensure that the custom subclass that works around Mozilla bug
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=453523 is removed.
+ */
+ delegate.removeWindowSubclass ();
+
+ /*
+ * As of mozilla 1.9 executing javascript via the javascript: protocol no
+ * longer happens synchronously. As a result, the result of executing JS
+ * is not returned to the java side when expected by the client. The
+ * workaround is to invoke the javascript handler directly via C++, which is
+ * exposed as of mozilla 1.9.
+ */
int /*long*/[] result = new int /*long*/[1];
+ if (!IsPre_1_9) {
+ int rc = XPCOM.NS_GetServiceManager (result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+
+ nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
+ result[0] = 0;
+ nsIPrincipal principal = null;
+ byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_SCRIPTSECURITYMANAGER_CONTRACTID, true);
+ rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager_1_9_1.NS_ISCRIPTSECURITYMANAGER_IID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIScriptSecurityManager_1_9_1 securityManager = new nsIScriptSecurityManager_1_9_1 (result[0]);
+ result[0] = 0;
+ rc = securityManager.GetSystemPrincipal (result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_ERROR_NULL_POINTER);
+ principal = new nsIPrincipal (result[0]);
+ result[0] = 0;
+ securityManager.Release ();
+ } else {
+ rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager_1_9.NS_ISCRIPTSECURITYMANAGER_IID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIScriptSecurityManager_1_9 securityManager = new nsIScriptSecurityManager_1_9 (result[0]);
+ result[0] = 0;
+ rc = securityManager.GetSystemPrincipal (result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_ERROR_NULL_POINTER);
+ principal = new nsIPrincipal (result[0]);
+ result[0] = 0;
+ securityManager.Release ();
+ }
+ }
+ serviceManager.Release ();
+
+ if (principal != null) {
+ rc = webBrowser.QueryInterface (nsIInterfaceRequestor.NS_IINTERFACEREQUESTOR_IID, result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
+
+ nsIInterfaceRequestor interfaceRequestor = new nsIInterfaceRequestor (result[0]);
+ result[0] = 0;
+ nsID scriptGlobalObjectNSID = new nsID ("6afecd40-0b9a-4cfd-8c42-0f645cd91829"); /* nsIScriptGlobalObject */ //$NON-NLS-1$
+ rc = interfaceRequestor.GetInterface (scriptGlobalObjectNSID, result);
+ interfaceRequestor.Release ();
+
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ int /*long*/ scriptGlobalObject = result[0];
+ result[0] = 0;
+ rc = XPCOM.nsIScriptGlobalObject_EnsureScriptEnvironment (scriptGlobalObject, 2); /* nsIProgrammingLanguage.JAVASCRIPT */
+ if (rc != XPCOM.NS_OK) error (rc);
+ int /*long*/ scriptContext = XPCOM.nsIScriptGlobalObject_GetScriptContext (scriptGlobalObject, 2); /* nsIProgrammingLanguage.JAVASCRIPT */
+ int /*long*/ globalJSObject = XPCOM.nsIScriptGlobalObject_GetScriptGlobal (scriptGlobalObject, 2); /* nsIProgrammingLanguage.JAVASCRIPT */
+ new nsISupports (scriptGlobalObject).Release ();
+
+ if (scriptContext != 0 && globalJSObject != 0) {
+ /* ensure that the received nsIScriptContext implements the expected interface */
+ nsID scriptContextNSID = new nsID ("e7b9871d-3adc-4bf7-850d-7fb9554886bf"); /* nsIScriptContext */ //$NON-NLS-1$
+ rc = new nsISupports (scriptContext).QueryInterface (scriptContextNSID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ new nsISupports (result[0]).Release ();
+ result[0] = 0;
+
+ int /*long*/ nativeContext = XPCOM.nsIScriptContext_GetNativeContext (scriptContext);
+ if (nativeContext != 0) {
+ int length = script.length ();
+ char[] scriptChars = new char[length];
+ script.getChars(0, length, scriptChars, 0);
+ byte[] urlbytes = MozillaDelegate.wcsToMbcs (null, getUrl (), true);
+ rc = principal.GetJSPrincipals (nativeContext, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ int /*long*/ principals = result[0];
+ result[0] = 0;
+ principal.Release ();
+ String mozillaPath = LocationProvider.mozillaPath + delegate.getJSLibraryName () + '\0';
+ byte[] pathBytes = null;
+ try {
+ pathBytes = mozillaPath.getBytes ("UTF-8"); //$NON-NLS-1$
+ } catch (UnsupportedEncodingException e) {
+ pathBytes = mozillaPath.getBytes ();
+ }
+ rc = XPCOM.JS_EvaluateUCScriptForPrincipals (pathBytes, nativeContext, globalJSObject, principals, scriptChars, length, urlbytes, 0, result);
+ return rc != 0;
+ }
+ }
+ }
+ }
+ }
+ principal.Release ();
+ }
+ }
+
+ /* fall back to the pre-1.9 approach */
+
+ String url = PREFIX_JAVASCRIPT + script + ";void(0);"; //$NON-NLS-1$
int rc = webBrowser.QueryInterface (nsIWebNavigation.NS_IWEBNAVIGATION_IID, result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
- /*
- * This could be the first content that is set into the browser, so
- * ensure that the custom subclass that works around Mozilla bug
- * https://bugzilla.mozilla.org/show_bug.cgi?id=453523 is removed.
- */
- delegate.removeWindowSubclass ();
-
nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
char[] arg = url.toCharArray ();
char[] c = new char[arg.length+1];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
index 01a43a8a33..9b2fec1f02 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java
@@ -70,6 +70,7 @@ public class XPCOM extends C {
public static final String NS_FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1"; //$NON-NLS-1$
public static final String NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID = "@mozilla.org/helperapplauncherdialog;1"; //$NON-NLS-1$
public static final String NS_MEMORY_CONTRACTID = "@mozilla.org/xpcom/memory-service;1"; //$NON-NLS-1$
+ public static final String NS_SCRIPTSECURITYMANAGER_CONTRACTID = "@mozilla.org/scriptsecuritymanager;1"; //$NON-NLS-1$
public static final String NS_OBSERVER_CONTRACTID = "@mozilla.org/observer-service;1"; //$NON-NLS-1$
public static final String NS_PREFLOCALIZEDSTRING_CONTRACTID = "@mozilla.org/pref-localizedstring;1"; //$NON-NLS-1$
public static final String NS_PREFSERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"; //$NON-NLS-1$
@@ -152,6 +153,17 @@ public static final native void memmove(int /*long*/ dest, nsID src, int nbytes)
/** @method flags=no_gen */
public static final native int strlen_PRUnichar(int /*long*/ s);
+/** @method flags=no_gen */
+public static final native int _JS_EvaluateUCScriptForPrincipals(byte[] mozillaPath, int /*long*/ cx, int /*long*/ obj, int /*long*/ principals, char[] chars, int length, byte[] filename, int lineno, int /*long*/[] retVal);
+public static final int JS_EvaluateUCScriptForPrincipals(byte[] mozillaPath, int /*long*/ cx, int /*long*/ obj, int /*long*/ principals, char[] chars, int length, byte[] filename, int lineno, int /*long*/[] retVal) {
+ lock.lock();
+ try {
+ return _JS_EvaluateUCScriptForPrincipals(mozillaPath, cx, obj, principals, chars, length, filename, lineno, retVal);
+ } finally {
+ lock.unlock();
+ }
+}
+
/** @param result cast=(nsIComponentManager**) */
public static final native int _NS_GetComponentManager(int /*long*/[] result);
public static final int NS_GetComponentManager(int /*long*/[] result) {
@@ -263,6 +275,59 @@ public static final int nsEmbedCString_Length(int /*long*/ ptr) {
}
/**
* @method flags=cpp
+ * @param ptr cast=(nsIScriptGlobalObject *)
+ */
+public static final native int /*long*/ _nsIScriptGlobalObject_EnsureScriptEnvironment(int /*long*/ ptr, int lang);
+public static final int /*long*/ nsIScriptGlobalObject_EnsureScriptEnvironment(int /*long*/ ptr, int lang) {
+ lock.lock();
+ try {
+ return _nsIScriptGlobalObject_EnsureScriptEnvironment(ptr, lang);
+ } finally {
+ lock.unlock();
+ }
+}
+/**
+ * @method flags=cpp
+ * @param ptr cast=(nsIScriptGlobalObject *)
+ */
+public static final native int /*long*/ _nsIScriptGlobalObject_GetScriptGlobal(int /*long*/ ptr, int lang);
+public static final int /*long*/ nsIScriptGlobalObject_GetScriptGlobal(int /*long*/ ptr, int lang) {
+ lock.lock();
+ try {
+ return _nsIScriptGlobalObject_GetScriptGlobal(ptr, lang);
+ } finally {
+ lock.unlock();
+ }
+}
+/**
+ * @method flags=cpp
+ * @param ptr cast=(nsIScriptGlobalObject *)
+ */
+public static final native int /*long*/ _nsIScriptGlobalObject_GetScriptContext(int /*long*/ ptr, int lang);
+public static final int /*long*/ nsIScriptGlobalObject_GetScriptContext(int /*long*/ ptr, int lang) {
+ lock.lock();
+ try {
+ return _nsIScriptGlobalObject_GetScriptContext(ptr, lang);
+ } finally {
+ lock.unlock();
+ }
+}
+/**
+ * @method flags=cpp
+ * @param ptr cast=(nsIScriptContext *)
+ */
+public static final native int /*long*/ _nsIScriptContext_GetNativeContext(int /*long*/ ptr);
+public static final int /*long*/ nsIScriptContext_GetNativeContext(int /*long*/ ptr) {
+ lock.lock();
+ try {
+ return _nsIScriptContext_GetNativeContext(ptr);
+ } finally {
+ lock.unlock();
+ }
+}
+
+/**
+ * @method flags=cpp
* @param ptr cast=(nsEmbedCString *)
*/
public static final native int /*long*/ _nsEmbedCString_get(int /*long*/ ptr);
@@ -895,6 +960,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, int ar
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, long arg1, int[] arg2);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, long arg1, int[] arg2) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, nsID arg1, long [] arg2);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, nsID arg1, long [] arg2) {
lock.lock();
@@ -1192,6 +1266,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] ar
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, byte[] arg1, long arg2);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, byte[] arg1, long arg2) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, int arg2);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, int arg2) {
lock.lock();
@@ -1210,6 +1293,24 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, byte[] a
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, short arg2);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, short arg2) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, byte[] arg1, short arg2);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, byte[] arg1, short arg2) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, int arg1, nsID arg2, int[] arg3);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, int arg1, nsID arg2, int[] arg3) {
@@ -1409,6 +1510,60 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, int ar
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, byte[] arg2, byte[] arg3);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, byte[] arg2, byte[] arg3) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, byte[] arg2, byte[] arg3);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, byte[] arg2, byte[] arg3) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, byte[] arg2, int arg3);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, byte[] arg2, int arg3) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, byte[] arg2, long arg3);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, byte[] arg2, long arg3) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, short[] arg0, int arg1, int[] arg2, int[] arg3);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, short[] arg0, int arg1, int[] arg2, int[] arg3) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, short[] arg0, long arg1, int[] arg2, long[] arg3);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, short[] arg0, long arg1, int[] arg2, long[] arg3) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, char[] arg0, int arg1, int arg2, int arg3, int arg4);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, char[] arg0, int arg1, int arg2, int arg3, int arg4) {
@@ -1491,6 +1646,43 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, byte[] arg0, int ar
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, byte[] arg2, int arg3, int arg4);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, byte[] arg2, int arg3, int arg4) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4);
+ } finally {
+ lock.unlock();
+ }
+}
+
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, byte[] arg2, long arg3, int arg4);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, byte[] arg2, long arg3, int arg4) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, nsID arg1, int arg2, int arg3, int[] arg4);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, nsID arg1, int arg2, int arg3, int[] arg4) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, nsID arg1, long arg2, long arg3, long[] arg4);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, nsID arg1, long arg2, long arg3, long[] arg4) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, byte[] arg2, byte[] arg3, int arg4, int[] arg5);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, byte[] arg2, byte[] arg3, int arg4, int[] arg5) {
@@ -1546,6 +1738,25 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int[] arg0, int[] arg1, int[] arg2, int[] arg3, int[] arg4, int[] arg5);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int[] arg0, int[] arg1, int[] arg2, int[] arg3, int[] arg4, int[] arg5) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5);
+ } finally {
+ lock.unlock();
+ }
+}
+
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long[] arg0, long[] arg1, long[] arg2, long[] arg3, long[] arg4, int[] arg5);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long[] arg0, long[] arg1, long[] arg2, long[] arg3, long[] arg4, int[] arg5) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5) {
lock.lock();
@@ -1564,6 +1775,25 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int[] arg5);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int [] arg5) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5);
+ } finally {
+ lock.unlock();
+ }
+}
+
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, long arg2, long arg3, long arg4, long[] arg5);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, long arg2, long arg3, long arg4, long[] arg5) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, nsID arg0, byte[] arg1, byte[] arg2, int arg3, byte[] arg4, byte[] arg5);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, nsID arg0, byte[] arg1, byte[] arg2, int arg3, byte[] arg4, byte[] arg5) {
lock.lock();
@@ -1672,6 +1902,24 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, byte[] arg3, byte[] arg4, int arg5);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, byte[] arg3, byte[] arg4, int arg5) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, long arg2, byte[] arg3, byte[] arg4, long arg5);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, long arg2, byte[] arg3, byte[] arg4, long arg5) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5);
+ } finally {
+ lock.unlock();
+ }
+}
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, char[] arg1, char[] arg2, int arg3, int[] arg4, int[] arg5, int[] arg6);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, char[] arg1, char[] arg2, int arg3, int[] arg4, int[] arg5, int[] arg6) {
@@ -1771,6 +2019,25 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, char[] a
lock.unlock();
}
}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int[] arg7);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int[] arg7) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+ } finally {
+ lock.unlock();
+ }
+}
+static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long[] arg7);
+static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long[] arg7) {
+ lock.lock();
+ try {
+ return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+ } finally {
+ lock.unlock();
+ }
+}
+
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, char[] arg6, int[] arg7, int[] arg8);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, char[] arg6, int[] arg7, int[] arg8) {
lock.lock();
@@ -1879,59 +2146,10 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1
lock.unlock();
}
}
-static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, short[] type, int iid, int[] count, int[] ptr);
-static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, short[] type, int iid, int[] count, int[] ptr) {
- lock.lock();
- try {
- return _VtblCall(fnNumber, ppVtbl, type, iid, count, ptr);
- } finally {
- lock.unlock();
- }
-}
-static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, short[] type, long iid, int[] count, long[] ptr);
-static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, short[] type, long iid, int[] count, long[] ptr) {
- lock.lock();
- try {
- return _VtblCall(fnNumber, ppVtbl, type, iid, count, ptr);
- } finally {
- lock.unlock();
- }
-}
-static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, byte[] arg2, int arg3);
-static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, byte[] arg2, int arg3) {
- lock.lock();
- try {
- return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3);
- } finally {
- lock.unlock();
- }
-}
-static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, byte[] arg2, long arg3);
-static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, byte[] arg2, long arg3) {
- lock.lock();
- try {
- return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3);
- } finally {
- lock.unlock();
- }
-}
-static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, byte[] arg3, byte[] arg4, int arg5);
-static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, byte[] arg3, byte[] arg4, int arg5) {
- lock.lock();
- try {
- return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5);
- } finally {
- lock.unlock();
- }
-}
-static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, long arg2, byte[] arg3, byte[] arg4, long arg5);
-static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, long arg2, byte[] arg3, byte[] arg4, long arg5) {
- lock.lock();
- try {
- return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5);
- } finally {
- lock.unlock();
- }
-}
+
+/**
+ * @method flags=no_gen
+ */
+public static final native int GetAddress(int ptr, int index);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java
new file mode 100644
index 0000000000..d8c34191a1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java
@@ -0,0 +1,143 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2009 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIPrincipal extends nsISerializable {
+
+ static final int LAST_METHOD_ID = nsISerializable.LAST_METHOD_ID + 23;
+
+ public static final String NS_IPRINCIPAL_IID_STR =
+ "b8268b9a-2403-44ed-81e3-614075c92034";
+
+ public static final nsID NS_IPRINCIPAL_IID =
+ new nsID(NS_IPRINCIPAL_IID_STR);
+
+ public nsIPrincipal(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int ENABLE_DENIED = 1;
+
+ public static final int ENABLE_UNKNOWN = 2;
+
+ public static final int ENABLE_WITH_USER_PERMISSION = 3;
+
+ public static final int ENABLE_GRANTED = 4;
+
+ public int GetPreferences(int /*long*/[] prefBranch, int /*long*/[] id, int /*long*/[] subjectName, int /*long*/[] grantedList, int /*long*/[] deniedList, int[] isTrusted) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 1, getAddress(), prefBranch, id, subjectName, grantedList, deniedList, isTrusted);
+ }
+
+ public int Equals(int /*long*/ other, int[] _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 2, getAddress(), other, _retval);
+ }
+
+ public int GetHashValue(int[] aHashValue) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 3, getAddress(), aHashValue);
+ }
+
+ public int GetJSPrincipals(int /*long*/ cx, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 4, getAddress(), cx, _retval);
+ }
+
+ public int GetSecurityPolicy(int /*long*/[] aSecurityPolicy) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 5, getAddress(), aSecurityPolicy);
+ }
+
+ public int SetSecurityPolicy(int /*long*/ aSecurityPolicy) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 6, getAddress(), aSecurityPolicy);
+ }
+
+ public int CanEnableCapability(byte[] capability, int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 7, getAddress(), capability, _retval);
+ }
+
+ public int SetCanEnableCapability(byte[] capability, short canEnable) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 8, getAddress(), capability, canEnable);
+ }
+
+ public int IsCapabilityEnabled(byte[] capability, int /*long*/ annotation, int[] _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 9, getAddress(), capability, annotation, _retval);
+ }
+
+ public int EnableCapability(byte[] capability, int /*long*/[] annotation) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 10, getAddress(), capability, annotation);
+ }
+
+ public int RevertCapability(byte[] capability, int /*long*/[] annotation) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 11, getAddress(), capability, annotation);
+ }
+
+ public int DisableCapability(byte[] capability, int /*long*/[] annotation) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 12, getAddress(), capability, annotation);
+ }
+
+ public int GetURI(int /*long*/[] aURI) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 13, getAddress(), aURI);
+ }
+
+ public int GetDomain(int /*long*/[] aDomain) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 14, getAddress(), aDomain);
+ }
+
+ public int SetDomain(int /*long*/ aDomain) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 15, getAddress(), aDomain);
+ }
+
+ public int GetOrigin(int /*long*/[] aOrigin) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 16, getAddress(), aOrigin);
+ }
+
+ public int GetHasCertificate(int[] aHasCertificate) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 17, getAddress(), aHasCertificate);
+ }
+
+ public int GetFingerprint(int /*long*/ aFingerprint) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 18, getAddress(), aFingerprint);
+ }
+
+ public int GetPrettyName(int /*long*/ aPrettyName) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 19, getAddress(), aPrettyName);
+ }
+
+ public int Subsumes(int /*long*/ other, int[] _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 20, getAddress(), other, _retval);
+ }
+
+ public int CheckMayLoad(int /*long*/ uri, int report) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 21, getAddress(), uri, report);
+ }
+
+ public int GetSubjectName(int /*long*/ aSubjectName) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 22, getAddress(), aSubjectName);
+ }
+
+ public int GetCertificate(int /*long*/[] aCertificate) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 23, getAddress(), aCertificate);
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_1_9.java
new file mode 100644
index 0000000000..b2b7de895f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_1_9.java
@@ -0,0 +1,159 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2009 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIScriptSecurityManager_1_9 extends nsIXPCSecurityManager {
+
+ static final int LAST_METHOD_ID = nsIXPCSecurityManager.LAST_METHOD_ID + 26;
+
+ public static final String NS_ISCRIPTSECURITYMANAGER_IID_STR =
+ "3fffd8e8-3fea-442e-a0ed-2ba81ae197d5";
+
+ public static final nsID NS_ISCRIPTSECURITYMANAGER_IID =
+ new nsID(NS_ISCRIPTSECURITYMANAGER_IID_STR);
+
+ public nsIScriptSecurityManager_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+// public int CheckPropertyAccess(int /*long*/ aJSContext, int /*long*/ aJSObject, byte[] aClassName, !ERROR UNKNOWN C TYPE <jsval >! aProperty, int aAction) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 1, getAddress(), aJSContext, aJSObject, aClassName, aProperty, aAction);
+// }
+
+// public int CheckConnect(int /*long*/ aJSContext, int /*long*/ aTargetURI, byte[] aClassName, byte[] aProperty) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 2, getAddress(), aJSContext, aTargetURI, aClassName, aProperty);
+// }
+
+ public int CheckLoadURIFromScript(int /*long*/ cx, int /*long*/ uri) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 3, getAddress(), cx, uri);
+ }
+
+ public static final int STANDARD = 0;
+
+ public static final int LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT = 1;
+
+ public static final int ALLOW_CHROME = 2;
+
+ public static final int DISALLOW_INHERIT_PRINCIPAL = 4;
+
+ public static final int DISALLOW_SCRIPT_OR_DATA = 4;
+
+ public static final int DISALLOW_SCRIPT = 8;
+
+ public int CheckLoadURIWithPrincipal(int /*long*/ aPrincipal, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 4, getAddress(), aPrincipal, uri, flags);
+ }
+
+ public int CheckLoadURI(int /*long*/ from, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 5, getAddress(), from, uri, flags);
+ }
+
+ public int CheckLoadURIStrWithPrincipal(int /*long*/ aPrincipal, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 6, getAddress(), aPrincipal, uri, flags);
+ }
+
+ public int CheckLoadURIStr(int /*long*/ from, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 7, getAddress(), from, uri, flags);
+ }
+
+ public int CheckFunctionAccess(int /*long*/ cx, int /*long*/ funObj, int /*long*/ targetObj) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 8, getAddress(), cx, funObj, targetObj);
+ }
+
+ public int CanExecuteScripts(int /*long*/ cx, int /*long*/ principal, int[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 9, getAddress(), cx, principal, _retval);
+ }
+
+ public int GetSubjectPrincipal(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 10, getAddress(), _retval);
+ }
+
+ public int GetSystemPrincipal(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 11, getAddress(), _retval);
+ }
+
+// public int GetCertificatePrincipal(int /*long*/ aCertFingerprint, int /*long*/ aSubjectName, int /*long*/ aPrettyName, int /*long*/ aCert, int /*long*/ aURI, int /*long*/[] _retval) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 12, getAddress(), aCertFingerprint, aSubjectName, aPrettyName, aCert, aURI, _retval);
+// }
+
+ public int GetCodebasePrincipal(int /*long*/ aURI, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 13, getAddress(), aURI, _retval);
+ }
+
+// public int RequestCapability(int /*long*/ principal, byte[] capability, int /*long*/ _retval) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 14, getAddress(), principal, capability, _retval);
+// }
+
+ public int IsCapabilityEnabled(byte[] capability, int[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 15, getAddress(), capability, _retval);
+ }
+
+ public int EnableCapability(byte[] capability) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 16, getAddress(), capability);
+ }
+
+ public int RevertCapability(byte[] capability) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 17, getAddress(), capability);
+ }
+
+ public int DisableCapability(byte[] capability) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 18, getAddress(), capability);
+ }
+
+// public int SetCanEnableCapability(int /*long*/ certificateFingerprint, byte[] capability, !ERROR UNKNOWN C TYPE <PRInt16 >! canEnable) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 19, getAddress(), certificateFingerprint, capability, canEnable);
+// }
+
+ public int GetObjectPrincipal(int /*long*/ cx, int /*long*/ obj, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 20, getAddress(), cx, obj, _retval);
+ }
+
+ public int SubjectPrincipalIsSystem(int[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 21, getAddress(), _retval);
+ }
+
+ public int CheckSameOrigin(int /*long*/ aJSContext, int /*long*/ aTargetURI) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 22, getAddress(), aJSContext, aTargetURI);
+ }
+
+ public int CheckSameOriginURI(int /*long*/ aSourceURI, int /*long*/ aTargetURI, int reportError) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 23, getAddress(), aSourceURI, aTargetURI, reportError);
+ }
+
+ public int GetPrincipalFromContext(int /*long*/ cx, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 24, getAddress(), cx, _retval);
+ }
+
+ public int GetChannelPrincipal(int /*long*/ aChannel, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 25, getAddress(), aChannel, _retval);
+ }
+
+ public int IsSystemPrincipal(int /*long*/ aPrincipal, int[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 26, getAddress(), aPrincipal, _retval);
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_1_9_1.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_1_9_1.java
new file mode 100644
index 0000000000..25ae4813d6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_1_9_1.java
@@ -0,0 +1,159 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIScriptSecurityManager_1_9_1 extends nsIXPCSecurityManager {
+
+ static final int LAST_METHOD_ID = nsIXPCSecurityManager.LAST_METHOD_ID + 26;
+
+ public static final String NS_ISCRIPTSECURITYMANAGER_IID_STR =
+ "f8e350b9-9f31-451a-8c8f-d10fea26b780";
+
+ public static final nsID NS_ISCRIPTSECURITYMANAGER_IID =
+ new nsID(NS_ISCRIPTSECURITYMANAGER_IID_STR);
+
+ public nsIScriptSecurityManager_1_9_1(int /*long*/ address) {
+ super(address);
+ }
+
+// public int CheckPropertyAccess(int /*long*/ aJSContext, int /*long*/ aJSObject, byte[] aClassName, !ERROR UNKNOWN C TYPE <jsval >! aProperty, int aAction) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 1, getAddress(), aJSContext, aJSObject, aClassName, aProperty, aAction);
+// }
+
+ public int CheckConnect(int /*long*/ aJSContext, int /*long*/ aTargetURI, byte[] aClassName, byte[] aProperty) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 2, getAddress(), aJSContext, aTargetURI, aClassName, aProperty);
+ }
+
+ public int CheckLoadURIFromScript(int /*long*/ cx, int /*long*/ uri) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 3, getAddress(), cx, uri);
+ }
+
+ public static final int STANDARD = 0;
+
+ public static final int LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT = 1;
+
+ public static final int ALLOW_CHROME = 2;
+
+ public static final int DISALLOW_INHERIT_PRINCIPAL = 4;
+
+ public static final int DISALLOW_SCRIPT_OR_DATA = 4;
+
+ public static final int DISALLOW_SCRIPT = 8;
+
+ public int CheckLoadURIWithPrincipal(int /*long*/ aPrincipal, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 4, getAddress(), aPrincipal, uri, flags);
+ }
+
+ public int CheckLoadURI(int /*long*/ from, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 5, getAddress(), from, uri, flags);
+ }
+
+ public int CheckLoadURIStrWithPrincipal(int /*long*/ aPrincipal, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 6, getAddress(), aPrincipal, uri, flags);
+ }
+
+ public int CheckLoadURIStr(int /*long*/ from, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 7, getAddress(), from, uri, flags);
+ }
+
+ public int CheckFunctionAccess(int /*long*/ cx, int /*long*/ funObj, int /*long*/ targetObj) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 8, getAddress(), cx, funObj, targetObj);
+ }
+
+// public int CanExecuteScripts(int /*long*/ cx, int /*long*/ principal, int[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 9, getAddress(), cx, principal, _retval NS_OUTPARAM);
+// }
+
+// public int GetSubjectPrincipal(int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 10, getAddress(), _retval NS_OUTPARAM);
+// }
+
+ public int GetSystemPrincipal(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 11, getAddress(), _retval);
+ }
+
+// public int GetCertificatePrincipal(int /*long*/ aCertFingerprint, int /*long*/ aSubjectName, int /*long*/ aPrettyName, int /*long*/ aCert, int /*long*/ aURI, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 12, getAddress(), aCertFingerprint, aSubjectName, aPrettyName, aCert, aURI, _retval NS_OUTPARAM);
+// }
+
+// public int GetCodebasePrincipal(int /*long*/ aURI, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 13, getAddress(), aURI, _retval NS_OUTPARAM);
+// }
+
+// public int RequestCapability(int /*long*/ principal, byte[] capability, int /*long*/ _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 14, getAddress(), principal, capability, _retval NS_OUTPARAM);
+// }
+
+// public int IsCapabilityEnabled(byte[] capability, int[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 15, getAddress(), capability, _retval NS_OUTPARAM);
+// }
+
+ public int EnableCapability(byte[] capability) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 16, getAddress(), capability);
+ }
+
+ public int RevertCapability(byte[] capability) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 17, getAddress(), capability);
+ }
+
+ public int DisableCapability(byte[] capability) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 18, getAddress(), capability);
+ }
+
+// public int SetCanEnableCapability(int /*long*/ certificateFingerprint, byte[] capability, !ERROR UNKNOWN C TYPE <PRInt16 >! canEnable) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 19, getAddress(), certificateFingerprint, capability, canEnable);
+// }
+
+// public int GetObjectPrincipal(int /*long*/ cx, int /*long*/ obj, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 20, getAddress(), cx, obj, _retval NS_OUTPARAM);
+// }
+
+// public int SubjectPrincipalIsSystem(int[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 21, getAddress(), _retval NS_OUTPARAM);
+// }
+
+ public int CheckSameOrigin(int /*long*/ aJSContext, int /*long*/ aTargetURI) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 22, getAddress(), aJSContext, aTargetURI);
+ }
+
+ public int CheckSameOriginURI(int /*long*/ aSourceURI, int /*long*/ aTargetURI, int reportError) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 23, getAddress(), aSourceURI, aTargetURI, reportError);
+ }
+
+// public int GetPrincipalFromContext(int /*long*/ cx, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 24, getAddress(), cx, _retval NS_OUTPARAM);
+// }
+
+// public int GetChannelPrincipal(int /*long*/ aChannel, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 25, getAddress(), aChannel, _retval NS_OUTPARAM);
+// }
+
+// public int IsSystemPrincipal(int /*long*/ aPrincipal, int[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 26, getAddress(), aPrincipal, _retval NS_OUTPARAM);
+// }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISerializable.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISerializable.java
new file mode 100644
index 0000000000..6e2fed1778
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISerializable.java
@@ -0,0 +1,51 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2009 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsISerializable extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 2;
+
+ public static final String NS_ISERIALIZABLE_IID_STR =
+ "91cca981-c26d-44a8-bebe-d9ed4891503a";
+
+ public static final nsID NS_ISERIALIZABLE_IID =
+ new nsID(NS_ISERIALIZABLE_IID_STR);
+
+ public nsISerializable(int /*long*/ address) {
+ super(address);
+ }
+
+ public int Read(int /*long*/ aInputStream) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aInputStream);
+ }
+
+ public int Write(int /*long*/ aOutputStream) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aOutputStream);
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIXPCSecurityManager.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIXPCSecurityManager.java
new file mode 100644
index 0000000000..884b6d986a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIXPCSecurityManager.java
@@ -0,0 +1,79 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2009 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIXPCSecurityManager extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 4;
+
+ public static final String NS_IXPCSECURITYMANAGER_IID_STR =
+ "31431440-f1ce-11d2-985a-006008962422";
+
+ public static final nsID NS_IXPCSECURITYMANAGER_IID =
+ new nsID(NS_IXPCSECURITYMANAGER_IID_STR);
+
+ public nsIXPCSecurityManager(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int HOOK_CREATE_WRAPPER = 1;
+
+ public static final int HOOK_CREATE_INSTANCE = 2;
+
+ public static final int HOOK_GET_SERVICE = 4;
+
+ public static final int HOOK_CALL_METHOD = 8;
+
+ public static final int HOOK_GET_PROPERTY = 16;
+
+ public static final int HOOK_SET_PROPERTY = 32;
+
+ public static final int HOOK_ALL = 63;
+
+ public int CanCreateWrapper(int /*long*/ aJSContext, nsID aIID, int /*long*/ aObj, int /*long*/ aClassInfo, int /*long*/[] aPolicy) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aJSContext, aIID, aObj, aClassInfo, aPolicy);
+ }
+
+ public int CanCreateInstance(int /*long*/ aJSContext, nsID aCID) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aJSContext, aCID);
+ }
+
+ public int CanGetService(int /*long*/ aJSContext, nsID aCID) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aJSContext, aCID);
+ }
+
+ public static final int ACCESS_CALL_METHOD = 0;
+
+ public static final int ACCESS_GET_PROPERTY = 1;
+
+ public static final int ACCESS_SET_PROPERTY = 2;
+
+ public int CanAccess(int aAction, int /*long*/ aCallContext, int /*long*/ aJSContext, int /*long*/ aJSObject, int /*long*/ aObj, int /*long*/ aClassInfo, int /*long*/ aName, int /*long*/[] aPolicy) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aAction, aCallContext, aJSContext, aJSObject, aObj, aClassInfo, aName, aPolicy);
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java
index 7445cd9862..ba2871347b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java
@@ -89,6 +89,10 @@ int /*long*/ getHandle () {
return embedHandle;
}
+String getJSLibraryName () {
+ return "libmozjs.so"; //$NON-NLS-1$
+}
+
String getLibraryName () {
return "libxpcom.so"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/motif/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/motif/org/eclipse/swt/browser/MozillaDelegate.java
index 07cec76548..aac50746da 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/motif/org/eclipse/swt/browser/MozillaDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/motif/org/eclipse/swt/browser/MozillaDelegate.java
@@ -107,6 +107,10 @@ int getHandle() {
return result;
}
+String getJSLibraryName () {
+ return "libmozjs.so"; //$NON-NLS-1$
+}
+
String getLibraryName () {
return "libxpcom.so"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java
index 9ac19ba770..96937a1096 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java
@@ -81,6 +81,10 @@ int /*long*/ getHandle () {
return browser.handle;
}
+String getJSLibraryName () {
+ return "js3250.dll"; //$NON-NLS-1$
+}
+
String getLibraryName () {
return "xpcom.dll"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/make_macosx.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/make_macosx.mak
index 770e573941..d8db219325 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/make_macosx.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library/make_macosx.mak
@@ -46,7 +46,7 @@ XULRUNNER_SDK = /Users/Shared/xulrunner/1.8.0.1/mozilla/dist/i386/dist/sdk
#XULRUNNER_SDK = /Users/Shared/gecko-sdk
#XULRUNNER_LIBS = -L${XULRUNNER_SDK}/lib -lxpcomglue
XULRUNNER_LIBS = $(XULRUNNER_SDK)/lib/libxpcomglue.a $(XULRUNNER_SDK)/../../../ppc/dist/sdk/lib/libxpcomglue.a
-XULRUNNERCFLAGS = $(CFLAGS) -Wno-non-virtual-dtor -include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include -D_OSX
+XULRUNNERCFLAGS = $(CFLAGS) -Wno-non-virtual-dtor -include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include -DXULRUNNER
XULRUNNERLFLAGS = $(LFLAGS)
all: $(SWT_LIB) $(SWTPI_LIB) $(COCOA_LIB) $(AGL_LIB) $(XULRUNNER_LIB)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak
index ab91f222db..48ac9e2c4b 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak
@@ -43,7 +43,7 @@ XULRUNNER_SDK = /Users/Shared/xulrunner/1.8.0.1/mozilla/dist/i386/dist/sdk
#XULRUNNER_SDK = /Users/Shared/gecko-sdk
#XULRUNNER_LIBS = -L${XULRUNNER_SDK}/lib -lxpcomglue
XULRUNNER_LIBS = $(XULRUNNER_SDK)/lib/libxpcomglue.a $(XULRUNNER_SDK)/../../../ppc/dist/sdk/lib/libxpcomglue.a
-XULRUNNERCFLAGS = -c -Wall $(ARCHS) -DSWT_VERSION=$(SWT_VERSION) $(NATIVE_STATS) $(SWT_DEBUG) -DUSE_ASSEMBLER -DCOCOA -D_OSX -I /System/Library/Frameworks/JavaVM.framework/Headers \
+XULRUNNERCFLAGS = -c -Wall $(ARCHS) -DSWT_VERSION=$(SWT_VERSION) $(NATIVE_STATS) $(SWT_DEBUG) -DUSE_ASSEMBLER -DCOCOA -DXULRUNNER -I /System/Library/Frameworks/JavaVM.framework/Headers \
-Wno-non-virtual-dtor -include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include
XULRUNNERLFLAGS = $(LFLAGS)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
index e5d4c1acf2..e7b6b13d8b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
@@ -80,6 +80,11 @@ MOZILLACFLAGS = -O \
MOZILLALIBS = -shared -Wl,--version-script=mozilla_exports -Bsymbolic
MOZILLAEXCLUDES = -DNO__1XPCOMGlueShutdown \
-DNO__1XPCOMGlueStartup \
+ -DNO_JS_1EvaluateUCScriptForPrincipals \
+ -DNO__1nsIScriptContext_1GetNativeContext \
+ -DNO__1nsIScriptGlobalObject_1GetScriptContext \
+ -DNO__1nsIScriptGlobalObject_1GetScriptGlobal \
+ -DNO__1nsIScriptGlobalObject_1EnsureScriptEnvironment \
-DNO__1XPCOMGlueLoadXULFunctions \
-DNO_memmove__ILorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2I \
-DNO_memmove__JLorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2J \
@@ -239,16 +244,16 @@ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
$(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
xpcomxul.o: xpcom.cpp
- $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+ $(CXX) -o xpcomxul.o -DXULRUNNER $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom.cpp
xpcomxul_structs.o: xpcom_structs.cpp
- $(CXX) -o xpcomxul_structs.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_structs.cpp
+ $(CXX) -o xpcomxul_structs.o -DXULRUNNER $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_structs.cpp
xpcomxul_custom.o: xpcom_custom.cpp
- $(CXX) -o xpcomxul_custom.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_custom.cpp
+ $(CXX) -o xpcomxul_custom.o -DXULRUNNER $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_custom.cpp
xpcomxul_stats.o: xpcom_stats.cpp
- $(CXX) -o xpcomxul_stats.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_stats.cpp
+ $(CXX) -o xpcomxul_stats.o -DXULRUNNER $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_stats.cpp
#
# XPCOMInit lib
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak
index d10b5cab85..c967761af3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/make_linux.mak
@@ -76,6 +76,11 @@ MOZILLACFLAGS = -O \
MOZILLALIBS = -shared -Wl,--version-script=mozilla_exports -Bsymbolic
MOZILLAEXCLUDES = -DNO__1XPCOMGlueShutdown \
-DNO__1XPCOMGlueStartup \
+ -DNO_JS_1EvaluateUCScriptForPrincipals \
+ -DNO__1nsIScriptContext_1GetNativeContext \
+ -DNO__1nsIScriptGlobalObject_1GetScriptContext \
+ -DNO__1nsIScriptGlobalObject_1GetScriptGlobal \
+ -DNO__1nsIScriptGlobalObject_1EnsureScriptEnvironment \
-DNO__1XPCOMGlueLoadXULFunctions \
-DNO_memmove__ILorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2I \
-DNO_nsDynamicFunctionLoad_1sizeof \
@@ -183,16 +188,16 @@ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
$(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
xpcomxul.o: xpcom.cpp
- $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+ $(CXX) -o xpcomxul.o -DXULRUNNER $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom.cpp
xpcomxul_structs.o: xpcom_structs.cpp
- $(CXX) -o xpcomxul_structs.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_structs.cpp
+ $(CXX) -o xpcomxul_structs.o -DXULRUNNER $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_structs.cpp
xpcomxul_custom.o: xpcom_custom.cpp
- $(CXX) -o xpcomxul_custom.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_custom.cpp
+ $(CXX) -o xpcomxul_custom.o -DXULRUNNER $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_custom.cpp
xpcomxul_stats.o: xpcom_stats.cpp
- $(CXX) -o xpcomxul_stats.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_stats.cpp
+ $(CXX) -o xpcomxul_stats.o -DXULRUNNER $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_stats.cpp
#
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak
index ea0bdcb560..6f416c7291 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak
@@ -56,6 +56,7 @@ MOZILLACFLAGS = -c \
$(NATIVE_STATS) \
-MD \
-DMOZILLA_STRICT_API=1 \
+ -DXULRUNNER \
-W3 \
-I. \
-I"$(JAVA_HOME)/include" \