This checkin enables obtaining an InputStream to read the POST body from

a request on the END_URL_LOAD event.  Please see
<http://lxr.mozilla.org/mozilla/source/java/webclient/test/automated/src/classes/org/mozilla/webclient/DocumentLoadListenerTest.java#138>
for an example.

Next step is to clean up the javadocs.

A webclient/test/automated/src/test/DocumentLoadListenerTest0.html
M webclient/src_moz/EmbedProgress.cpp
M webclient/test/automated/src/classes/org/mozilla/util/THTTPD.java
M webclient/test/automated/src/classes/org/mozilla/webclient/DocumentLoadListenerTest.java


git-svn-id: svn://10.0.0.236/trunk@170610 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2005-03-13 17:56:16 +00:00
parent 8593d723e5
commit 9b782a05a8
4 changed files with 261 additions and 92 deletions

View File

@@ -26,6 +26,7 @@
#include <nsIHttpChannel.h>
#include <nsIUploadChannel.h>
#include <nsIInputStream.h>
#include <nsISeekableStream.h>
#include <nsIHttpHeaderVisitor.h>
#include "nsIURI.h"
@@ -190,7 +191,6 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
(jobject)
&(mOwner->GetWrapperFactory()->shareContext));
}
}
util_SendEventToJava(nsnull,
@@ -255,6 +255,13 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
jmethodID jID;
pStream = (jint) uploadStream;
uploadStream->AddRef();
// rewind upload stream
nsCOMPtr<nsISeekableStream> seekable =
do_QueryInterface(uploadStream);
if (seekable) {
seekable->Seek(nsISeekableStream::NS_SEEK_SET, 0);
}
if (clazz = env->FindClass("org/mozilla/webclient/impl/wrapper_native/NativeInputStream")) {
if (jID = env->GetMethodID(clazz, "<init>", "(I)V")) {
if (streamObj = env->NewObject(clazz,jID,pStream)){
@@ -272,7 +279,6 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
}
}
}
}
util_SendEventToJava(nsnull,