Fix problem with the external protocol channel that makes it return a null

originalURI and cause crashes.  Bug 241300, r=biesi, sr=darin
This commit is contained in:
bzbarsky%mit.edu 2004-07-15 20:20:50 +00:00
Родитель 74691465d2
Коммит 71db5adf33
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@ -75,6 +75,7 @@ public:
protected:
nsCOMPtr<nsIURI> mUrl;
nsCOMPtr<nsIURI> mOriginalURI;
nsresult mStatus;
nsresult OpenURL();
@ -127,12 +128,14 @@ nsExtProtocolChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
NS_IMETHODIMP nsExtProtocolChannel::GetOriginalURI(nsIURI* *aURI)
{
*aURI = nsnull;
NS_IF_ADDREF(*aURI = mOriginalURI);
return NS_OK;
}
NS_IMETHODIMP nsExtProtocolChannel::SetOriginalURI(nsIURI* aURI)
{
NS_ENSURE_ARG_POINTER(aURI);
mOriginalURI = aURI;
return NS_OK;
}
@ -369,6 +372,7 @@ NS_IMETHODIMP nsExternalProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_
if (!channel) return NS_ERROR_OUT_OF_MEMORY;
((nsExtProtocolChannel*) channel.get())->SetURI(aURI);
channel->SetOriginalURI(aURI);
if (_retval)
{