@Override public boolean setUrl (String url, String postData, String[] headers) { byte[] postDataBytes = null; if (postData != null) { postDataBytes = MozillaDelegate.wcsToMbcs (null, postData, false); } return setUrl (url, postDataBytes, headers); }
@Override public boolean setUrl (String url, String postData, String[] headers) { byte[] postDataBytes = null; if (postData != null) { postDataBytes = MozillaDelegate.wcsToMbcs (null, postData, false); } return setUrl (url, postDataBytes, headers); }
@Override public boolean setUrl (String url, String postData, String[] headers) { byte[] postDataBytes = null; if (postData != null) { postDataBytes = MozillaDelegate.wcsToMbcs (null, postData, false); } return setUrl (url, postDataBytes, headers); }
public boolean setUrl (String url, String postData, String[] headers) { byte[] postDataBytes = null; if (postData != null) { postDataBytes = MozillaDelegate.wcsToMbcs (null, postData, false); } return setUrl (url, postDataBytes, headers); }
@Override public boolean setUrl (String url, String postData, String[] headers) { byte[] postDataBytes = null; if (postData != null) { postDataBytes = MozillaDelegate.wcsToMbcs (null, postData, false); } return setUrl (url, postDataBytes, headers); }
static void loadAdditionalLibraries (String mozillaPath) { // workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=727616 String utilsPath = mozillaPath + Mozilla.SEPARATOR_OS + "libmozutils.dylib"; //$NON-NLS-1$ byte[] bytes = MozillaDelegate.wcsToMbcs (null, utilsPath, true); OS.NSAddImage (bytes, OS.NSADDIMAGE_OPTION_RETURN_ON_ERROR | OS.NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME); }
static String getProfilePath () { String baseDir = System.getProperty ("user.home"); //$NON-NLS-1$ /* * Bug in Sun JRE. Under some circumstances the value of java property "user.home" is * "?", even when the HOME environment variable has a valid value. If this happens * then attempt to read the value from the environment directly. */ if (baseDir.equals ("?")) { //$NON-NLS-1$ long /*int*/ ptr = C.getenv (wcsToMbcs (null, "HOME", true)); //$NON-NLS-1$ if (ptr != 0) { int length = C.strlen (ptr); byte[] bytes = new byte[length]; C.memmove (bytes, ptr, length); baseDir = new String (mbcsToWcs (null, bytes)); } } return baseDir + Mozilla.SEPARATOR_OS + ".mozilla" + Mozilla.SEPARATOR_OS + "eclipse"; //$NON-NLS-1$ //$NON-NLS-2$ }
static String getProfilePath () { String baseDir = System.getProperty ("user.home"); //$NON-NLS-1$ /* * Bug in Sun JRE. Under some circumstances the value of java property "user.home" is * "?", even when the HOME environment variable has a valid value. If this happens * then attempt to read the value from the environment directly. */ if (baseDir.equals ("?")) { //$NON-NLS-1$ int /*long*/ ptr = C.getenv (wcsToMbcs (null, "HOME", true)); //$NON-NLS-1$ if (ptr != 0) { int length = C.strlen (ptr); byte[] bytes = new byte[length]; C.memmove (bytes, ptr, length); baseDir = new String (mbcsToWcs (null, bytes)); } } return baseDir + Mozilla.SEPARATOR_OS + ".mozilla" + Mozilla.SEPARATOR_OS + "eclipse"; //$NON-NLS-1$ //$NON-NLS-2$ }
static String getProfilePath () { String baseDir = System.getProperty ("user.home"); //$NON-NLS-1$ /* * Bug in Sun JRE. Under some circumstances the value of java property "user.home" is * "?", even when the HOME environment variable has a valid value. If this happens * then attempt to read the value from the environment directly. */ if (baseDir.equals ("?")) { //$NON-NLS-1$ int /*long*/ ptr = C.getenv (wcsToMbcs (null, "HOME", true)); //$NON-NLS-1$ if (ptr != 0) { int length = C.strlen (ptr); byte[] bytes = new byte[length]; C.memmove (bytes, ptr, length); baseDir = new String (mbcsToWcs (null, bytes)); } } return baseDir + Mozilla.SEPARATOR_OS + ".mozilla" + Mozilla.SEPARATOR_OS + "eclipse"; //$NON-NLS-1$ //$NON-NLS-2$ }
int getScriptObject (int /*long*/ aContext, int /*long*/ aScriptObject) { byte[] jsLibPath = Mozilla.getJSLibPathBytes (); int /*long*/ nativeContext = XPCOM.nsIScriptContext_GetNativeContext (aContext); int /*long*/ globalJSObject = XPCOM.JS_GetGlobalObject (jsLibPath, nativeContext); int /*long*/ newObject = XPCOM.JS_NewObject (jsLibPath, nativeContext, 0, 0, globalJSObject); byte[] functionName = MozillaDelegate.wcsToMbcs (null, CALLJAVA, true); int flags = XPCOM.JSPROP_ENUMERATE | XPCOM.JSPROP_READONLY | XPCOM.JSPROP_PERMANENT; XPCOM.JS_DefineFunction (jsLibPath, nativeContext, newObject, functionName, XPCOM.CALLBACK_JSNative (CallJavaProc.getAddress ()), 3, flags); XPCOM.memmove (aScriptObject, new int /*long*/[] {newObject}, C.PTR_SIZEOF); return XPCOM.NS_OK; }
int getScriptObject (int /*long*/ aContext, int /*long*/ aScriptObject) { byte[] jsLibPath = Mozilla.getJSLibPathBytes (); int /*long*/ nativeContext = XPCOM.nsIScriptContext_GetNativeContext (aContext); int /*long*/ globalJSObject = XPCOM.JS_GetGlobalObject (jsLibPath, nativeContext); int /*long*/ newObject = XPCOM.JS_NewObject (jsLibPath, nativeContext, 0, 0, globalJSObject); byte[] functionName = MozillaDelegate.wcsToMbcs (null, CALLJAVA, true); int flags = XPCOM.JSPROP_ENUMERATE | XPCOM.JSPROP_READONLY | XPCOM.JSPROP_PERMANENT; XPCOM.JS_DefineFunction (jsLibPath, nativeContext, newObject, functionName, XPCOM.CALLBACK_JSNative (CallJavaProc.getAddress ()), 3, flags); XPCOM.memmove (aScriptObject, new int /*long*/[] {newObject}, C.PTR_SIZEOF); return XPCOM.NS_OK; }
int getScriptObject (long /*int*/ aContext, long /*int*/ aScriptObject) { byte[] jsLibPath = Mozilla.getJSLibPathBytes (); long /*int*/ nativeContext = XPCOM.nsIScriptContext_GetNativeContext (aContext); long /*int*/ globalJSObject = XPCOM.JS_GetGlobalObject (jsLibPath, nativeContext); long /*int*/ newObject = XPCOM.JS_NewObject (jsLibPath, nativeContext, 0, 0, globalJSObject); byte[] functionName = MozillaDelegate.wcsToMbcs (null, CALLJAVA, true); int flags = XPCOM.JSPROP_ENUMERATE | XPCOM.JSPROP_READONLY | XPCOM.JSPROP_PERMANENT; XPCOM.JS_DefineFunction (jsLibPath, nativeContext, newObject, functionName, XPCOM.CALLBACK_JSNative (CallJavaProc.getAddress ()), 3, flags); XPCOM.memmove (aScriptObject, new long /*int*/[] {newObject}, C.PTR_SIZEOF); return XPCOM.NS_OK; }
int getScriptObject (long /*int*/ aContext, long /*int*/ aScriptObject) { byte[] jsLibPath = Mozilla.getJSLibPathBytes (); long /*int*/ nativeContext = XPCOM.nsIScriptContext_GetNativeContext (aContext); long /*int*/ globalJSObject = XPCOM.JS_GetGlobalObject (jsLibPath, nativeContext); long /*int*/ newObject = XPCOM.JS_NewObject (jsLibPath, nativeContext, 0, 0, globalJSObject); byte[] functionName = MozillaDelegate.wcsToMbcs (null, "callJava", true); //$NON-NLS-1$ int flags = XPCOM.JSPROP_ENUMERATE | XPCOM.JSPROP_READONLY | XPCOM.JSPROP_PERMANENT; XPCOM.JS_DefineFunction (jsLibPath, nativeContext, newObject, functionName, XPCOM.CALLBACK_JSNative (CallJavaProc.getAddress ()), 3, flags); XPCOM.memmove (aScriptObject, new long /*int*/[] {newObject}, C.PTR_SIZEOF); return XPCOM.NS_OK; }
int getScriptObject (int /*long*/ aContext, int /*long*/ aScriptObject) { byte[] jsLibPath = Mozilla.getJSLibPathBytes (); int /*long*/ nativeContext = XPCOM.nsIScriptContext_GetNativeContext (aContext); int /*long*/ globalJSObject = XPCOM.JS_GetGlobalObject (jsLibPath, nativeContext); int /*long*/ newObject = XPCOM.JS_NewObject (jsLibPath, nativeContext, 0, 0, globalJSObject); byte[] functionName = MozillaDelegate.wcsToMbcs (null, CALLJAVA, true); int flags = XPCOM.JSPROP_ENUMERATE | XPCOM.JSPROP_READONLY | XPCOM.JSPROP_PERMANENT; XPCOM.JS_DefineFunction (jsLibPath, nativeContext, newObject, functionName, XPCOM.CALLBACK_JSNative (CallJavaProc.getAddress ()), 3, flags); XPCOM.memmove (aScriptObject, new int /*long*/[] {newObject}, C.PTR_SIZEOF); return XPCOM.NS_OK; }
int getClassDescription (long /*int*/ _retValue) { long /*int*/[] result = new long /*int*/[1]; int rc = XPCOM.NS_GetServiceManager (result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); nsIServiceManager serviceManager = new nsIServiceManager (result[0]); result[0] = 0; byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true); rc = serviceManager.GetServiceByContractID (aContractID, nsIMemory.NS_IMEMORY_IID, result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); nsIMemory memory = new nsIMemory (result[0]); result[0] = 0; byte[] bytes = MozillaDelegate.wcsToMbcs (null, "external", true); //$NON-NLS-1$ long /*int*/ ptr = memory.Alloc (bytes.length); C.memmove (ptr, bytes, bytes.length); C.memmove (_retValue, new long /*int*/[] {ptr}, C.PTR_SIZEOF); memory.Release (); return XPCOM.NS_OK; }
int canCreateWrapper (int /*long*/ iid, int /*long*/ _retVal) { int /*long*/[] result = new int /*long*/[1]; int rc = XPCOM.NS_GetServiceManager (result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); nsIServiceManager serviceManager = new nsIServiceManager (result[0]); result[0] = 0; byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true); rc = serviceManager.GetServiceByContractID (aContractID, IIDStore.GetIID (nsIMemory.class), result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); nsIMemory memory = new nsIMemory (result[0]); result[0] = 0; byte[] bytes = MozillaDelegate.wcsToMbcs (null, "allAccess", true); //$NON-NLS-1$ int /*long*/ ptr = memory.Alloc (bytes.length); C.memmove (ptr, bytes, bytes.length); C.memmove (_retVal, new int /*long*/[] {ptr}, C.PTR_SIZEOF); memory.Release (); return XPCOM.NS_OK; }
int canGetProperty (int /*long*/ iid, int /*long*/ propertyName, int /*long*/ _retVal) { int /*long*/[] result = new int /*long*/[1]; int rc = XPCOM.NS_GetServiceManager (result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); nsIServiceManager serviceManager = new nsIServiceManager (result[0]); result[0] = 0; byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true); rc = serviceManager.GetServiceByContractID (aContractID, IIDStore.GetIID (nsIMemory.class), result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); nsIMemory memory = new nsIMemory (result[0]); result[0] = 0; byte[] bytes = MozillaDelegate.wcsToMbcs (null, "noAccess", true); //$NON-NLS-1$ int /*long*/ ptr = memory.Alloc (bytes.length); C.memmove (ptr, bytes, bytes.length); C.memmove (_retVal, new int /*long*/[] {ptr}, C.PTR_SIZEOF); memory.Release (); return XPCOM.NS_OK; }
int getClassDescription (long /*int*/ _retValue) { long /*int*/[] result = new long /*int*/[1]; int rc = XPCOM.NS_GetServiceManager (result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); nsIServiceManager serviceManager = new nsIServiceManager (result[0]); result[0] = 0; byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true); rc = serviceManager.GetServiceByContractID (aContractID, IIDStore.GetIID (nsIMemory.class), result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); nsIMemory memory = new nsIMemory (result[0]); result[0] = 0; byte[] bytes = MozillaDelegate.wcsToMbcs (null, "external", true); //$NON-NLS-1$ long /*int*/ ptr = memory.Alloc (bytes.length); C.memmove (ptr, bytes, bytes.length); C.memmove (_retValue, new long /*int*/[] {ptr}, C.PTR_SIZEOF); memory.Release (); return XPCOM.NS_OK; }
int canSetProperty (long /*int*/ iid, long /*int*/ propertyName, long /*int*/ _retVal) { long /*int*/[] result = new long /*int*/[1]; int rc = XPCOM.NS_GetServiceManager (result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); nsIServiceManager serviceManager = new nsIServiceManager (result[0]); result[0] = 0; byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true); rc = serviceManager.GetServiceByContractID (aContractID, IIDStore.GetIID (nsIMemory.class), result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); nsIMemory memory = new nsIMemory (result[0]); result[0] = 0; byte[] bytes = MozillaDelegate.wcsToMbcs (null, "noAccess", true); //$NON-NLS-1$ long /*int*/ ptr = memory.Alloc (bytes.length); C.memmove (ptr, bytes, bytes.length); C.memmove (_retVal, new long /*int*/[] {ptr}, C.PTR_SIZEOF); memory.Release (); return XPCOM.NS_OK; }
int canGetProperty (int /*long*/ iid, int /*long*/ propertyName, int /*long*/ _retVal) { int /*long*/[] result = new int /*long*/[1]; int rc = XPCOM.NS_GetServiceManager (result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); nsIServiceManager serviceManager = new nsIServiceManager (result[0]); result[0] = 0; byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true); rc = serviceManager.GetServiceByContractID (aContractID, IIDStore.GetIID (nsIMemory.class), result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); nsIMemory memory = new nsIMemory (result[0]); result[0] = 0; byte[] bytes = MozillaDelegate.wcsToMbcs (null, "noAccess", true); //$NON-NLS-1$ int /*long*/ ptr = memory.Alloc (bytes.length); C.memmove (ptr, bytes, bytes.length); C.memmove (_retVal, new int /*long*/[] {ptr}, C.PTR_SIZEOF); memory.Release (); return XPCOM.NS_OK; }