mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-20 17:20:54 +00:00
Bug 320498 Fix NewChannel impls to handle null in argument
r=darin sr=darin
This commit is contained in:
parent
5708a7284e
commit
63408ce9ed
@ -119,6 +119,7 @@ nsAnnoProtocolHandler::NewURI(const nsACString& aSpec,
|
||||
NS_IMETHODIMP
|
||||
nsAnnoProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
nsresult rv;
|
||||
|
||||
nsCAutoString path;
|
||||
|
@ -109,6 +109,7 @@ nsWyciwygProtocolHandler::NewURI(const nsACString &aSpec,
|
||||
NS_IMETHODIMP
|
||||
nsWyciwygProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(url);
|
||||
nsresult rv;
|
||||
|
||||
nsWyciwygChannel* channel = new nsWyciwygChannel();
|
||||
|
@ -118,6 +118,7 @@ NS_IMETHODIMP
|
||||
nsLDAPProtocolHandler::NewChannel(nsIURI* uri,
|
||||
nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(uri);
|
||||
nsresult rv;
|
||||
nsLDAPChannel *channel;
|
||||
|
||||
|
@ -245,6 +245,7 @@ NS_IMETHODIMP GeckoProtocolHandlerImpl::NewURI(const nsACString & aSpec, const c
|
||||
/* nsIChannel newChannel (in nsIURI aURI); */
|
||||
NS_IMETHODIMP GeckoProtocolHandlerImpl::NewChannel(nsIURI *aURI, nsIChannel **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
GeckoProtocolChannel *channel = new GeckoProtocolChannel;
|
||||
if (!channel)
|
||||
{
|
||||
|
@ -125,6 +125,7 @@ NS_IMETHODIMP
|
||||
nsDateTimeHandler::NewProxiedChannel(nsIURI* url, nsIProxyInfo* proxyInfo,
|
||||
nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(url);
|
||||
nsresult rv;
|
||||
|
||||
nsDateTimeChannel *chan = new nsDateTimeChannel();
|
||||
|
@ -127,6 +127,7 @@ NS_IMETHODIMP
|
||||
nsFingerHandler::NewProxiedChannel(nsIURI* url, nsIProxyInfo* proxyInfo,
|
||||
nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(url);
|
||||
nsresult rv;
|
||||
|
||||
nsFingerChannel *chan = new nsFingerChannel();
|
||||
|
@ -940,6 +940,7 @@ nsGnomeVFSProtocolHandler::NewURI(const nsACString &aSpec,
|
||||
NS_IMETHODIMP
|
||||
nsGnomeVFSProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
nsresult rv;
|
||||
|
||||
nsCAutoString spec;
|
||||
|
@ -345,6 +345,7 @@ NS_IMETHODIMP nsSmtpService::NewURI(const nsACString &aSpec,
|
||||
|
||||
NS_IMETHODIMP nsSmtpService::NewChannel(nsIURI *aURI, nsIChannel **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
// create an empty pipe for use with the input stream channel.
|
||||
nsCOMPtr<nsIInputStream> pipeIn;
|
||||
nsCOMPtr<nsIOutputStream> pipeOut;
|
||||
|
@ -562,6 +562,7 @@ NS_IMETHODIMP nsMailboxService::NewURI(const nsACString &aSpec,
|
||||
|
||||
NS_IMETHODIMP nsMailboxService::NewChannel(nsIURI *aURI, nsIChannel **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
nsresult rv = NS_OK;
|
||||
nsMailboxProtocol * protocol = new nsMailboxProtocol(aURI);
|
||||
if (protocol)
|
||||
|
@ -415,6 +415,7 @@ NS_IMETHODIMP nsPop3Service::NewURI(const nsACString &aSpec,
|
||||
|
||||
NS_IMETHODIMP nsPop3Service::NewChannel(nsIURI *aURI, nsIChannel **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
nsresult rv = NS_OK;
|
||||
nsPop3Protocol * protocol = new nsPop3Protocol(aURI);
|
||||
if (protocol)
|
||||
|
@ -24,7 +24,7 @@
|
||||
* Scott MacGregor <mscott@netscape.com>
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
* Håkan Waara <hwaara@chello.se>
|
||||
* David Bienvenu < bienvenu@nventure.com>
|
||||
* David Bienvenu <bienvenu@nventure.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
@ -1416,11 +1416,12 @@ NS_IMETHODIMP nsNntpService::NewURI(const nsACString &aSpec,
|
||||
|
||||
NS_IMETHODIMP nsNntpService::NewChannel(nsIURI *aURI, nsIChannel **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr <nsINNTPProtocol> nntpProtocol;
|
||||
rv = GetProtocolForUri(aURI, nsnull, getter_AddRefs(nntpProtocol));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = nntpProtocol->Initialize(aURI, nsnull);
|
||||
rv = nntpProtocol->Initialize(aURI, nsnull);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return CallQueryInterface(nntpProtocol, _retval);
|
||||
|
@ -106,6 +106,7 @@ NS_IMETHODIMP nsIconProtocolHandler::NewURI(const nsACString &aSpec,
|
||||
|
||||
NS_IMETHODIMP nsIconProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(url);
|
||||
nsIconChannel* channel = new nsIconChannel;
|
||||
if (!channel)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -49,6 +49,7 @@ static const char kBlankPage[] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01
|
||||
NS_IMETHODIMP
|
||||
nsAboutBlank::NewChannel(nsIURI *aURI, nsIChannel **result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
nsresult rv;
|
||||
nsIChannel* channel;
|
||||
|
||||
|
@ -60,6 +60,7 @@ NS_IMPL_ISUPPORTS1(nsAboutBloat, nsIAboutModule)
|
||||
NS_IMETHODIMP
|
||||
nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
nsresult rv;
|
||||
nsCAutoString path;
|
||||
rv = aURI->GetPath(path);
|
||||
|
@ -75,6 +75,7 @@ NS_IMPL_ISUPPORTS2(nsAboutCache, nsIAboutModule, nsICacheVisitor)
|
||||
NS_IMETHODIMP
|
||||
nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
nsresult rv;
|
||||
PRUint32 bytesWritten;
|
||||
|
||||
|
@ -60,6 +60,7 @@ NS_IMPL_ISUPPORTS2(nsAboutCacheEntry,
|
||||
NS_IMETHODIMP
|
||||
nsAboutCacheEntry::NewChannel(nsIURI *uri, nsIChannel **result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(uri);
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIInputStream> stream;
|
||||
|
@ -136,6 +136,7 @@ nsAboutProtocolHandler::NewURI(const nsACString &aSpec,
|
||||
NS_IMETHODIMP
|
||||
nsAboutProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(uri);
|
||||
// about:what you ask?
|
||||
nsresult rv;
|
||||
nsCAutoString contractID;
|
||||
|
@ -76,7 +76,7 @@ static const int kRedirTotal = NS_ARRAY_LENGTH(kRedirMap);
|
||||
NS_IMETHODIMP
|
||||
nsAboutRedirector::NewChannel(nsIURI *aURI, nsIChannel **result)
|
||||
{
|
||||
NS_ASSERTION(aURI, "must not be null");
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
NS_ASSERTION(result, "must not be null");
|
||||
|
||||
nsresult rv;
|
||||
|
@ -117,6 +117,7 @@ nsDataHandler::NewURI(const nsACString &aSpec,
|
||||
NS_IMETHODIMP
|
||||
nsDataHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(uri);
|
||||
nsDataChannel* channel = new nsDataChannel(uri);
|
||||
if (!channel)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -213,6 +213,7 @@ nsFtpProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
|
||||
NS_IMETHODIMP
|
||||
nsFtpProtocolHandler::NewProxiedChannel(nsIURI* url, nsIProxyInfo* proxyInfo, nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(url);
|
||||
nsFTPChannel *channel = new nsFTPChannel();
|
||||
if (!channel)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -100,6 +100,7 @@ NS_IMETHODIMP
|
||||
nsGopherHandler::NewProxiedChannel(nsIURI *uri, nsIProxyInfo *proxyInfo,
|
||||
nsIChannel **result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(uri);
|
||||
nsGopherChannel *chan = new nsGopherChannel(uri, proxyInfo);
|
||||
if (!chan)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -164,6 +164,7 @@ nsKeywordProtocolHandler::NewURI(const nsACString &aSpec,
|
||||
NS_IMETHODIMP
|
||||
nsKeywordProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(uri);
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -236,6 +236,7 @@ nsResProtocolHandler::NewURI(const nsACString &aSpec,
|
||||
NS_IMETHODIMP
|
||||
nsResProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(uri);
|
||||
nsresult rv;
|
||||
nsCAutoString spec;
|
||||
|
||||
|
@ -115,6 +115,7 @@ nsViewSourceHandler::NewURI(const nsACString &aSpec,
|
||||
NS_IMETHODIMP
|
||||
nsViewSourceHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(uri);
|
||||
nsViewSourceChannel *channel = new nsViewSourceChannel();
|
||||
if (!channel)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
Loading…
x
Reference in New Issue
Block a user