Only state the stop notification for JSDownloads in nsWebBrowserPersist::EndDownload

This commit is contained in:
NTD 2019-01-31 07:35:32 -05:00 committed by Roy Tam
commit 120aa8a81e

View file

@ -2351,16 +2351,18 @@ nsWebBrowserPersist::EndDownload(nsresult aResult)
{
mPersistResult = aResult;
}
// mCompleted needs to be set before issuing the stop notification.
// (Bug 1224437)
mCompleted = true;
#ifdef MOZ_JSDOWNLOADS
// State stop notification
if (mProgressListener) {
mProgressListener->OnStateChange(nullptr, nullptr,
nsIWebProgressListener::STATE_STOP
| nsIWebProgressListener::STATE_IS_NETWORK, mPersistResult);
}
#endif
// Do file cleanup if required
if (NS_FAILED(aResult) && (mPersistFlags & PERSIST_FLAGS_CLEANUP_ON_FAILURE))