зеркало из https://github.com/mozilla/pjs.git
bug=47357
a=edburns r=edburns author=avm This fix adds a length parameter to the loading of URLs. It also adds a new util function util_getStringLength().
This commit is contained in:
Родитель
0e45976a97
Коммит
2646150a6f
|
@ -1511,13 +1511,13 @@ jboolean initStringConstants()
|
|||
return JNI_FALSE;
|
||||
}
|
||||
if (nsnull == (DOCUMENT_LOAD_LISTENER_CLASSNAME = (jstring)
|
||||
::util_NewGlobalRef(env,
|
||||
::util_NewGlobalRef(env, (jobject)
|
||||
::util_NewStringUTF(env,
|
||||
gSupportedListenerInterfaces[DOCUMENT_LOAD_LISTENER])))) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
if (nsnull == (MOUSE_LISTENER_CLASSNAME = (jstring)
|
||||
::util_NewGlobalRef(env,
|
||||
::util_NewGlobalRef(env, (jobject)
|
||||
::util_NewStringUTF(env,
|
||||
gSupportedListenerInterfaces[MOUSE_LISTENER])))) {
|
||||
return JNI_FALSE;
|
||||
|
|
|
@ -75,10 +75,20 @@ LLIBS = \
|
|||
$(DIST)\lib\nspr4.lib \
|
||||
$(DIST)\lib\plc4.lib \
|
||||
$(DIST)\lib\plds4.lib \
|
||||
$(DIST)\lib\wc_share.lib \
|
||||
# $(DEPTH)\xpfe\bootstrap\$(OBJDIR)\nsSetupRegistry.obj \
|
||||
$(NULL)
|
||||
|
||||
!ifdef BAL_INTERFACE
|
||||
LLIBS = $(LLIBS) \
|
||||
$(DIST)\lib\wc_share_bal.lib \
|
||||
$(NULL)
|
||||
!else
|
||||
LLIBS = $(LLIBS) \
|
||||
$(DIST)\lib\wc_share.lib \
|
||||
$(NULL)
|
||||
!endif
|
||||
|
||||
|
||||
WIN_LIBS = \
|
||||
version.lib
|
||||
|
||||
|
@ -130,3 +140,6 @@ clobber::
|
|||
rm -f nsSetupRegistry.cpp
|
||||
rm -f runem.bat
|
||||
|
||||
|
||||
edburns:
|
||||
echo $(LLIBS)
|
||||
|
|
|
@ -49,6 +49,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_NavigationImpl
|
|||
|
||||
PRUnichar * urlStringChars = (PRUnichar *) ::util_GetStringChars(env,
|
||||
urlString);
|
||||
PRInt32 urlLength = (PRInt32) ::util_GetStringLength(env, urlString);
|
||||
|
||||
if (::util_ExceptionOccurred(env)) {
|
||||
::util_ThrowExceptionToJava(env, "raptorWebShellLoadURL Exception: unable to extract Java string");
|
||||
|
@ -67,7 +68,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_NavigationImpl
|
|||
}
|
||||
|
||||
if (initContext->initComplete) {
|
||||
wsLoadURLEvent * actionEvent = new wsLoadURLEvent(initContext->webNavigation, urlStringChars);
|
||||
wsLoadURLEvent * actionEvent = new wsLoadURLEvent(initContext->webNavigation, urlStringChars, urlLength);
|
||||
PLEvent * event = (PLEvent*) *actionEvent;
|
||||
|
||||
::util_PostEvent(initContext, event);
|
||||
|
|
|
@ -120,12 +120,12 @@ wsResizeEvent::handleEvent ()
|
|||
* wsLoadURLEvent
|
||||
*/
|
||||
|
||||
wsLoadURLEvent::wsLoadURLEvent(nsIWebNavigation* webNavigation, PRUnichar * urlString) :
|
||||
wsLoadURLEvent::wsLoadURLEvent(nsIWebNavigation* webNavigation, PRUnichar * urlString, PRInt32 urlLength) :
|
||||
nsActionEvent(),
|
||||
mWebNavigation(webNavigation),
|
||||
mURL(nsnull)
|
||||
{
|
||||
mURL = new nsString(urlString);
|
||||
mURL = new nsString(urlString, urlLength);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ protected:
|
|||
|
||||
class wsLoadURLEvent : public nsActionEvent {
|
||||
public:
|
||||
wsLoadURLEvent (nsIWebNavigation* webNavigation, PRUnichar * urlString);
|
||||
wsLoadURLEvent (nsIWebNavigation* webNavigation, PRUnichar * urlString, PRInt32 urlLength);
|
||||
~wsLoadURLEvent ();
|
||||
void * handleEvent (void);
|
||||
|
||||
|
|
|
@ -97,6 +97,18 @@ JNIEXPORT void JNICALL util_ReleaseStringChars(JNIEnv *env, jstring inString,
|
|||
|
||||
}
|
||||
|
||||
JNIEXPORT jsize JNICALL util_GetStringLength(JNIEnv *env,
|
||||
jstring inString)
|
||||
{
|
||||
jsize result = 0;
|
||||
#ifdef BAL_INTERFACE
|
||||
result = bal_jstring_getLength(inString);
|
||||
#else
|
||||
result = env->GetStringLength(inString);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL util_NewStringUTF(JNIEnv *env, const char *inString)
|
||||
{
|
||||
jstring result = nsnull;
|
||||
|
|
|
@ -51,6 +51,9 @@ JNIEXPORT const jchar * JNICALL util_GetStringChars(JNIEnv *env,
|
|||
JNIEXPORT void JNICALL util_ReleaseStringChars(JNIEnv *env, jstring inString,
|
||||
const jchar *stringFromGet);
|
||||
|
||||
JNIEXPORT jsize JNICALL util_GetStringLength(JNIEnv *env,
|
||||
jstring inString);
|
||||
|
||||
JNIEXPORT jstring JNICALL util_NewStringUTF(JNIEnv *env,
|
||||
const char * inString);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче