fixes bug 189897 "Download starts with Download Error, then Cancel Button disabled"
r=adamlock sr=bzbarsky a=dbaron git-svn-id: svn://10.0.0.236/trunk@136918 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -899,6 +899,7 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStatus(
|
||||
case NS_NET_STATUS_CONNECTED_TO:
|
||||
case NS_NET_STATUS_SENDING_TO:
|
||||
case NS_NET_STATUS_RECEIVING_FROM:
|
||||
case NS_NET_STATUS_WAITING_FOR:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -109,4 +109,5 @@ interface nsISocketTransport : nsITransport
|
||||
#define NS_NET_STATUS_SENDING_TO nsISocketTransport::STATUS_SENDING_TO
|
||||
#define NS_NET_STATUS_RECEIVING_FROM nsISocketTransport::STATUS_RECEIVING_FROM
|
||||
#define NS_NET_STATUS_CONNECTING_TO nsISocketTransport::STATUS_CONNECTING_TO
|
||||
#define NS_NET_STATUS_WAITING_FOR nsISocketTransport::STATUS_WAITING_FOR
|
||||
%}
|
||||
|
||||
@@ -3050,7 +3050,8 @@ nsHttpChannel::OnTransportStatus(nsITransport *trans, nsresult status,
|
||||
{
|
||||
// block socket status event after OnStopRequest has been fired.
|
||||
if (mProgressSink && mIsPending && !(mLoadFlags & LOAD_BACKGROUND)) {
|
||||
LOG(("sending status notification [status=%x]\n", status));
|
||||
LOG(("sending status notification [this=%x status=%x progress=%u/%u]\n",
|
||||
this, status, progress, progressMax));
|
||||
|
||||
NS_ConvertASCIItoUCS2 host(mConnectionInfo->Host());
|
||||
mProgressSink->OnStatus(this, nsnull, status, host.get());
|
||||
@@ -3063,8 +3064,8 @@ nsHttpChannel::OnTransportStatus(nsITransport *trans, nsresult status,
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else
|
||||
LOG(("skipping status notification [sink=%x pending=%u background=%x]\n",
|
||||
mProgressSink.get(), mIsPending, (mLoadFlags & LOAD_BACKGROUND)));
|
||||
LOG(("skipping status notification [this=%x sink=%x pending=%u background=%x]\n",
|
||||
this, mProgressSink.get(), mIsPending, (mLoadFlags & LOAD_BACKGROUND)));
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
|
||||
@@ -271,12 +271,16 @@ nsHttpTransaction::OnTransportStatus(nsresult status, PRUint32 progress)
|
||||
mTransportProgress = mContentRead;
|
||||
mTransportProgressMax = mContentLength;
|
||||
}
|
||||
else {
|
||||
else if (status == nsISocketTransport::STATUS_SENDING_TO) {
|
||||
// when uploading, we include the request headers in the progress
|
||||
// notifications.
|
||||
mTransportProgress = progress;
|
||||
mTransportProgressMax = mRequestSize;
|
||||
}
|
||||
else {
|
||||
mTransportProgress = 0;
|
||||
mTransportProgressMax = 0;
|
||||
}
|
||||
|
||||
postEvent = !mTransportStatusInProgress;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user