Make sure to grab the security info from the underlying channel so that the

lock icon goes into the locked state properly for remote jars over https.  Bug
240496, r+sr=darin


git-svn-id: svn://10.0.0.236/trunk@155285 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2004-04-21 14:58:45 +00:00
parent d621728eae
commit d64df39493
6 changed files with 28 additions and 4 deletions

View File

@@ -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<nsIChannel> channel(do_QueryInterface(request));
if (channel)
channel->GetSecurityInfo(getter_AddRefs(mSecurityInfo));
if (NS_SUCCEEDED(status)) {
mJarFile = file;

View File

@@ -87,6 +87,7 @@ private:
nsCOMPtr<nsIURI> mOriginalURI;
nsCOMPtr<nsISupports> mOwner;
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
nsCOMPtr<nsISupports> mSecurityInfo;
nsCOMPtr<nsIProgressEventSink> mProgressSink;
nsCOMPtr<nsILoadGroup> mLoadGroup;
nsCOMPtr<nsIStreamListener> mListener;

View File

@@ -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);
};

View File

@@ -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;

View File

@@ -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<nsIChannel> channel(do_QueryInterface(request));
if (channel)
channel->GetSecurityInfo(getter_AddRefs(mSecurityInfo));
if (NS_SUCCEEDED(status)) {
mJarFile = file;

View File

@@ -87,6 +87,7 @@ private:
nsCOMPtr<nsIURI> mOriginalURI;
nsCOMPtr<nsISupports> mOwner;
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
nsCOMPtr<nsISupports> mSecurityInfo;
nsCOMPtr<nsIProgressEventSink> mProgressSink;
nsCOMPtr<nsILoadGroup> mLoadGroup;
nsCOMPtr<nsIStreamListener> mListener;