diff --git a/mozilla/modules/libjar/nsJARChannel.cpp b/mozilla/modules/libjar/nsJARChannel.cpp index 0aa9b6d7fe4..05132930d14 100644 --- a/mozilla/modules/libjar/nsJARChannel.cpp +++ b/mozilla/modules/libjar/nsJARChannel.cpp @@ -272,6 +272,8 @@ nsJARChannel::EnsureJarInput(PRBool blocking) } if (mJarFile) { + // NOTE: we do not need to deal with mSecurityInfo here, + // because we're loading from a local file rv = CreateJarInput(gJarHandler->JarCache()); } else if (blocking) { @@ -489,7 +491,8 @@ nsJARChannel::SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks) NS_IMETHODIMP nsJARChannel::GetSecurityInfo(nsISupports **aSecurityInfo) { - *aSecurityInfo = nsnull; + NS_PRECONDITION(aSecurityInfo, "Null out param"); + NS_IF_ADDREF(*aSecurityInfo = mSecurityInfo); return NS_OK; } @@ -627,9 +630,16 @@ nsJARChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx) NS_IMETHODIMP nsJARChannel::OnDownloadComplete(nsIDownloader *downloader, + nsIRequest *request, + nsISupports *context, nsresult status, nsIFile *file) { + // Grab the security info from our base channel + nsCOMPtr channel(do_QueryInterface(request)); + if (channel) + channel->GetSecurityInfo(getter_AddRefs(mSecurityInfo)); + if (NS_SUCCEEDED(status)) { mJarFile = file; diff --git a/mozilla/modules/libjar/nsJARChannel.h b/mozilla/modules/libjar/nsJARChannel.h index e5dbb3be005..a015c5d3d54 100644 --- a/mozilla/modules/libjar/nsJARChannel.h +++ b/mozilla/modules/libjar/nsJARChannel.h @@ -87,6 +87,7 @@ private: nsCOMPtr mOriginalURI; nsCOMPtr mOwner; nsCOMPtr mCallbacks; + nsCOMPtr mSecurityInfo; nsCOMPtr mProgressSink; nsCOMPtr mLoadGroup; nsCOMPtr mListener; diff --git a/mozilla/netwerk/base/public/nsIDownloader.idl b/mozilla/netwerk/base/public/nsIDownloader.idl index 6e555e393e8..18e59f6ae21 100644 --- a/mozilla/netwerk/base/public/nsIDownloader.idl +++ b/mozilla/netwerk/base/public/nsIDownloader.idl @@ -70,13 +70,15 @@ interface nsIDownloader : nsIStreamListener in nsIFile downloadLocation); }; -[scriptable, uuid(814bd098-4dfb-46dd-8305-9052c998ed94)] +[scriptable, uuid(44b3153e-a54e-4077-a527-b0325e40924e)] interface nsIDownloadObserver : nsISupports { /** * Called to signal a download that has completed. */ void onDownloadComplete(in nsIDownloader downloader, + in nsIRequest request, + in nsISupports ctxt, in nsresult status, in nsIFile result); }; diff --git a/mozilla/netwerk/base/src/nsDownloader.cpp b/mozilla/netwerk/base/src/nsDownloader.cpp index 86219c7b60b..e135f524fd7 100644 --- a/mozilla/netwerk/base/src/nsDownloader.cpp +++ b/mozilla/netwerk/base/src/nsDownloader.cpp @@ -153,7 +153,7 @@ nsDownloader::OnStopRequest(nsIRequest *request, } } - mObserver->OnDownloadComplete(this, status, mLocation); + mObserver->OnDownloadComplete(this, request, ctxt, status, mLocation); mObserver = nsnull; return NS_OK; diff --git a/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp b/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp index 0aa9b6d7fe4..05132930d14 100644 --- a/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp +++ b/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp @@ -272,6 +272,8 @@ nsJARChannel::EnsureJarInput(PRBool blocking) } if (mJarFile) { + // NOTE: we do not need to deal with mSecurityInfo here, + // because we're loading from a local file rv = CreateJarInput(gJarHandler->JarCache()); } else if (blocking) { @@ -489,7 +491,8 @@ nsJARChannel::SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks) NS_IMETHODIMP nsJARChannel::GetSecurityInfo(nsISupports **aSecurityInfo) { - *aSecurityInfo = nsnull; + NS_PRECONDITION(aSecurityInfo, "Null out param"); + NS_IF_ADDREF(*aSecurityInfo = mSecurityInfo); return NS_OK; } @@ -627,9 +630,16 @@ nsJARChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx) NS_IMETHODIMP nsJARChannel::OnDownloadComplete(nsIDownloader *downloader, + nsIRequest *request, + nsISupports *context, nsresult status, nsIFile *file) { + // Grab the security info from our base channel + nsCOMPtr channel(do_QueryInterface(request)); + if (channel) + channel->GetSecurityInfo(getter_AddRefs(mSecurityInfo)); + if (NS_SUCCEEDED(status)) { mJarFile = file; diff --git a/mozilla/netwerk/protocol/jar/src/nsJARChannel.h b/mozilla/netwerk/protocol/jar/src/nsJARChannel.h index e5dbb3be005..a015c5d3d54 100644 --- a/mozilla/netwerk/protocol/jar/src/nsJARChannel.h +++ b/mozilla/netwerk/protocol/jar/src/nsJARChannel.h @@ -87,6 +87,7 @@ private: nsCOMPtr mOriginalURI; nsCOMPtr mOwner; nsCOMPtr mCallbacks; + nsCOMPtr mSecurityInfo; nsCOMPtr mProgressSink; nsCOMPtr mLoadGroup; nsCOMPtr mListener;