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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user