reapply bryner's fixes for dougt landing. Not part of build. r=javi
git-svn-id: svn://10.0.0.236/trunk@87618 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -424,8 +424,11 @@ CertDownloader::~CertDownloader()
|
||||
NS_IMPL_ISUPPORTS1(CertDownloader, nsIStreamListener);
|
||||
|
||||
NS_IMETHODIMP
|
||||
CertDownloader::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
CertDownloader::OnStartRequest(nsIRequest* request, nsISupports* context)
|
||||
{
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(request));
|
||||
if (!channel) return NS_ERROR_FAILURE;
|
||||
|
||||
channel->GetContentLength(&mContentLength);
|
||||
if (mContentLength == -1)
|
||||
return NS_ERROR_FAILURE;
|
||||
@@ -440,7 +443,7 @@ CertDownloader::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CertDownloader::OnDataAvailable(nsIChannel* channel,
|
||||
CertDownloader::OnDataAvailable(nsIRequest* request,
|
||||
nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
@@ -468,7 +471,7 @@ CertDownloader::OnDataAvailable(nsIChannel* channel,
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CertDownloader::OnStopRequest(nsIChannel* channel,
|
||||
CertDownloader::OnStopRequest(nsIRequest* request,
|
||||
nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
@@ -491,13 +494,13 @@ nsNSSComponent::HandleContent(const char * aContentType,
|
||||
const char * aCommand,
|
||||
const char * aWindowTarget,
|
||||
nsISupports* aWindowContext,
|
||||
nsIChannel * aChannel)
|
||||
nsIRequest * aRequest)
|
||||
{
|
||||
// We were called via CI. We better protect ourselves and addref.
|
||||
NS_ADDREF_THIS();
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (!aChannel) return NS_ERROR_NULL_POINTER;
|
||||
if (!aRequest) return NS_ERROR_NULL_POINTER;
|
||||
|
||||
PSMCertificateType type;
|
||||
|
||||
@@ -513,6 +516,10 @@ nsNSSComponent::HandleContent(const char * aContentType,
|
||||
type = PSMCertificateUnknown;
|
||||
|
||||
if (type != PSMCertificateUnknown) {
|
||||
nsCOMPtr<nsIChannel> aChannel(do_QueryInterface(aRequest));
|
||||
if (!aChannel)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = aChannel->GetURI(getter_AddRefs(uri));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@@ -521,11 +528,11 @@ nsNSSComponent::HandleContent(const char * aContentType,
|
||||
rv = NS_OpenURI(getter_AddRefs(channel), uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return channel->AsyncRead(new CertDownloader(type),
|
||||
return channel->AsyncOpen(new CertDownloader(type),
|
||||
NS_STATIC_CAST(nsISecurityManagerComponent*,this));
|
||||
}
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user