From a1f7159ede5d7ccdc69b59c91c7195474f0c63fc Mon Sep 17 00:00:00 2001 From: "edburns%acm.org" Date: Fri, 11 Aug 2000 21:58:56 +0000 Subject: [PATCH] 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(). --- java/webclient/src_moz/CBrowserContainer.cpp | 4 ++-- java/webclient/src_moz/Makefile.win | 15 ++++++++++++++- java/webclient/src_moz/NavigationImpl.cpp | 3 ++- java/webclient/src_moz/nsActions.cpp | 4 ++-- java/webclient/src_moz/nsActions.h | 2 +- java/webclient/src_share/jni_util_export.cpp | 12 ++++++++++++ java/webclient/src_share/jni_util_export.h | 3 +++ 7 files changed, 36 insertions(+), 7 deletions(-) diff --git a/java/webclient/src_moz/CBrowserContainer.cpp b/java/webclient/src_moz/CBrowserContainer.cpp index 779c2597c203..ff2459d9382a 100644 --- a/java/webclient/src_moz/CBrowserContainer.cpp +++ b/java/webclient/src_moz/CBrowserContainer.cpp @@ -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; diff --git a/java/webclient/src_moz/Makefile.win b/java/webclient/src_moz/Makefile.win index 7a41e3b44faf..e98d41305909 100644 --- a/java/webclient/src_moz/Makefile.win +++ b/java/webclient/src_moz/Makefile.win @@ -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) diff --git a/java/webclient/src_moz/NavigationImpl.cpp b/java/webclient/src_moz/NavigationImpl.cpp index 4abe6b6e2765..8cef9d8f5823 100644 --- a/java/webclient/src_moz/NavigationImpl.cpp +++ b/java/webclient/src_moz/NavigationImpl.cpp @@ -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); diff --git a/java/webclient/src_moz/nsActions.cpp b/java/webclient/src_moz/nsActions.cpp index 116257f7ed16..8176e5ed8863 100644 --- a/java/webclient/src_moz/nsActions.cpp +++ b/java/webclient/src_moz/nsActions.cpp @@ -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); } diff --git a/java/webclient/src_moz/nsActions.h b/java/webclient/src_moz/nsActions.h index 1849047a25c3..a3dbcc83c0c4 100644 --- a/java/webclient/src_moz/nsActions.h +++ b/java/webclient/src_moz/nsActions.h @@ -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); diff --git a/java/webclient/src_share/jni_util_export.cpp b/java/webclient/src_share/jni_util_export.cpp index dea48b602ccd..f01abc552428 100644 --- a/java/webclient/src_share/jni_util_export.cpp +++ b/java/webclient/src_share/jni_util_export.cpp @@ -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; diff --git a/java/webclient/src_share/jni_util_export.h b/java/webclient/src_share/jni_util_export.h index 8a24dddabc10..73e50b7c6bc2 100644 --- a/java/webclient/src_share/jni_util_export.h +++ b/java/webclient/src_share/jni_util_export.h @@ -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);