Checkpoint. Still waiting for advice on how to get POST inspection working.

M src_moz/EmbedProgress.cpp

- remove PageInfoListener meta-data from END_DOCUMENT_LOAD.  Didn't
  belong there.

M test/manual/src/classes/org/mozilla/webclient/test/TestBrowser.java

- print out the request method and response code.


git-svn-id: svn://10.0.0.236/trunk@170053 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2005-03-01 20:39:23 +00:00
parent bdb0c96450
commit 73ac2e27c7
2 changed files with 39 additions and 61 deletions

View File

@@ -158,67 +158,6 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
(aStateFlags & STATE_STOP)) {
PR_LOG(prLogModuleInfo, PR_LOG_DEBUG,
("EmbedProgress::OnStateChange: END_DOCUMENT_LOAD\n"));
if (channel && mCapturePageInfo) {
// store the request method
if (NS_SUCCEEDED(rv = channel->GetRequestMethod(cstr))) {
jstring methodJStr = (jstring) ::util_NewGlobalRef(env,
::util_NewStringUTF(env, cstr.get()));
::util_StoreIntoPropertiesObject(env, properties,
METHOD_VALUE, methodJStr,
(jobject)
&(mOwner->GetWrapperFactory()->shareContext));
}
// store the response status
PRUint32 responseStatus;
if (NS_SUCCEEDED(rv =channel->GetResponseStatus(&responseStatus))){
if (NS_SUCCEEDED(rv=channel->GetResponseStatusText(cstr))) {
nsAutoString autoStatus;
autoStatus.AppendInt(responseStatus);
autoStatus.AppendWithConversion(" ");
autoStatus.AppendWithConversion(cstr.get());
jstring statusJStr = (jstring) ::util_NewGlobalRef(env,
::util_NewString(env, autoStatus.get(), autoStatus.Length()));
::util_StoreIntoPropertiesObject(env, properties,
STATUS_VALUE, statusJStr,
(jobject)
&(mOwner->GetWrapperFactory()->shareContext));
}
}
// If there is an upload stream, store it as well
nsCOMPtr<nsIUploadChannel> upload = do_QueryInterface(channel);
if (upload) {
nsIInputStream *uploadStream = nsnull;
if (NS_SUCCEEDED(rv = upload->GetUploadStream(&uploadStream))
&& uploadStream) {
jint pStream;
jclass clazz;
jobject streamObj;
jmethodID jID;
pStream = (jint) uploadStream;
uploadStream->AddRef();
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)){
if (streamObj = ::util_NewGlobalRef(env,
streamObj)){
::util_StoreIntoPropertiesObject(env,
properties,
REQUEST_BODY_VALUE,
streamObj,
(jobject)
&(mOwner->GetWrapperFactory()->shareContext));
}
}
}
}
}
}
}
util_SendEventToJava(nsnull,
mEventRegistration,
@@ -304,6 +243,36 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
}
}
// If there is an upload stream, store it as well
nsCOMPtr<nsIUploadChannel> upload = do_QueryInterface(channel);
if (upload) {
nsIInputStream *uploadStream = nsnull;
if (NS_SUCCEEDED(rv = upload->GetUploadStream(&uploadStream))
&& uploadStream) {
jint pStream;
jclass clazz;
jobject streamObj;
jmethodID jID;
pStream = (jint) uploadStream;
uploadStream->AddRef();
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)){
if (streamObj = ::util_NewGlobalRef(env,
streamObj)){
::util_StoreIntoPropertiesObject(env,
properties,
REQUEST_BODY_VALUE,
streamObj,
(jobject)
&(mOwner->GetWrapperFactory()->shareContext));
}
}
}
}
}
}
}
util_SendEventToJava(nsnull,