Bug 697494 - Outparamdel nsIParser::GetStreamListener; r=hsivonen

This commit is contained in:
Ms2ger 2011-11-16 08:50:19 +01:00
parent 1c189b4cf4
commit 1049c156c8
6 changed files with 13 additions and 21 deletions

View File

@ -950,10 +950,8 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
// Set the parser as the stream listener for the document loader...
if (mParser) {
rv = mParser->GetStreamListener(aDocListener);
if (NS_FAILED(rv)) {
return rv;
}
nsCOMPtr<nsIStreamListener> listener = mParser->GetStreamListener();
listener.forget(aDocListener);
#ifdef DEBUG_charset
printf(" charset = %s source %d\n",

View File

@ -177,11 +177,10 @@ nsHtml5Parser::GetDTD(nsIDTD** aDTD)
return NS_OK;
}
NS_IMETHODIMP
nsHtml5Parser::GetStreamListener(nsIStreamListener** aListener)
nsIStreamListener*
nsHtml5Parser::GetStreamListener()
{
NS_IF_ADDREF(*aListener = mStreamParser);
return NS_OK;
return mStreamParser;
}
NS_IMETHODIMP

View File

@ -137,7 +137,7 @@ class nsHtml5Parser : public nsIParser,
/**
* Get the stream parser for this parser
*/
NS_IMETHOD GetStreamListener(nsIStreamListener** aListener);
virtual nsIStreamListener* GetStreamListener();
/**
* Don't call. For interface compat only.

View File

@ -55,8 +55,8 @@
#include "nsIAtom.h"
#define NS_IPARSER_IID \
{ 0xcbc0cbd8, 0xbbb7, 0x46d6, \
{ 0xa5, 0x51, 0x37, 0x8a, 0x69, 0x53, 0xa7, 0x14 } }
{ 0xc9169398, 0x897a, 0x481d, \
{ 0xa9, 0x5f, 0xd6, 0x60, 0x6e, 0xf8, 0x37, 0x56 } }
// {41421C60-310A-11d4-816F-000064657374}
#define NS_IDEBUG_DUMP_CONTENT_IID \
@ -196,10 +196,8 @@ class nsIParser : public nsISupports {
/**
* Get the nsIStreamListener for this parser
* @param aDTD out param that will contain the result
* @return NS_OK if successful
*/
NS_IMETHOD GetStreamListener(nsIStreamListener** aListener) = 0;
virtual nsIStreamListener* GetStreamListener() = 0;
/**************************************************************************
* Parse methods always begin with an input source, and perform

View File

@ -2976,9 +2976,8 @@ nsParser::GetDTD(nsIDTD** aDTD)
/**
* Get this as nsIStreamListener
*/
NS_IMETHODIMP
nsParser::GetStreamListener(nsIStreamListener** aListener)
nsIStreamListener*
nsParser::GetStreamListener()
{
NS_ADDREF(*aListener = this);
return NS_OK;
return this;
}

View File

@ -294,10 +294,8 @@ class nsParser : public nsIParser,
/**
* Get the nsIStreamListener for this parser
* @param aDTD out param that will contain the result
* @return NS_OK if successful
*/
NS_IMETHOD GetStreamListener(nsIStreamListener** aListener);
virtual nsIStreamListener* GetStreamListener();
/**
* Detects the existence of a META tag with charset information in