From b1e18f1c1defb8f0e7acdcb32334f42f221f9045 Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Thu, 22 Nov 2001 05:50:04 +0000 Subject: [PATCH] Removing dead, wrong, evil, dangerous code from the parser!! --- htmlparser/src/nsParser.cpp | 43 ------------------------------ htmlparser/src/nsParser.h | 4 --- parser/htmlparser/src/nsParser.cpp | 43 ------------------------------ parser/htmlparser/src/nsParser.h | 4 --- 4 files changed, 94 deletions(-) diff --git a/htmlparser/src/nsParser.cpp b/htmlparser/src/nsParser.cpp index c81d00187dda..977fa93949c7 100644 --- a/htmlparser/src/nsParser.cpp +++ b/htmlparser/src/nsParser.cpp @@ -56,7 +56,6 @@ #include "nsICachingChannel.h" #include "nsICacheEntryDescriptor.h" #include "nsICharsetAlias.h" -#include "nsIProgressEventSink.h" #include "nsIInputStream.h" #include "CNavDTD.h" #include "COtherDTD.h" @@ -71,7 +70,6 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID); static NS_DEFINE_IID(kIParserIID, NS_IPARSER_IID); -static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID); static NS_DEFINE_CID(kWellFormedDTDCID, NS_WELLFORMEDDTD_CID); static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID); @@ -308,7 +306,6 @@ nsParser::nsParser(nsITokenObserver* anObserver) { mCharset.AssignWithConversion("ISO-8859-1"); mParserFilter = 0; mObserver = 0; - mProgressEventSink = nsnull; mSink=0; mParserContext=0; mTokenObserver=anObserver; @@ -364,7 +361,6 @@ nsParser::~nsParser() { #endif NS_IF_RELEASE(mObserver); - NS_IF_RELEASE(mProgressEventSink); NS_IF_RELEASE(mSink); NS_IF_RELEASE(mParserFilter); @@ -405,9 +401,6 @@ nsresult nsParser::QueryInterface(const nsIID& aIID, void** aInstancePtr) else if(aIID.Equals(kIParserIID)) { //do IParser base class... *aInstancePtr = (nsIParser*)(this); } - else if(aIID.Equals(NS_GET_IID(nsIProgressEventSink))) { - *aInstancePtr = (nsIStreamListener*)(this); - } else if(aIID.Equals(NS_GET_IID(nsIRequestObserver))) { *aInstancePtr = (nsIRequestObserver*)(this); } @@ -2011,42 +2004,6 @@ nsITokenizer* nsParser::GetTokenizer(void) { These methods are used to talk to the netlib system... *******************************************************************/ -/** - * - * - * @update gess 5/12/98 - * @param - * @return error code -- 0 if ok, non-zero if error. - */ -nsresult -nsParser::OnProgress(nsIRequest *request, nsISupports* aContext, PRUint32 aProgress, PRUint32 aProgressMax) -{ - nsresult result=0; - if (nsnull != mProgressEventSink) { - mProgressEventSink->OnProgress(request, aContext, aProgress, aProgressMax); - } - return result; -} - -/** - * - * - * @update gess 5/12/98 - * @param - * @return error code -- 0 if ok, non-zero if error. - */ -nsresult -nsParser::OnStatus(nsIRequest *request, nsISupports* aContext, - nsresult aStatus, const PRUnichar* aStatusArg) -{ - nsresult rv; - if (nsnull != mProgressEventSink) { - rv = mProgressEventSink->OnStatus(request, aContext, aStatus, aStatusArg); - NS_ASSERTION(NS_SUCCEEDED(rv), "dropping error result"); - } - return NS_OK; -} - #ifdef rickgdebug #include fstream* gOutFile; diff --git a/htmlparser/src/nsParser.h b/htmlparser/src/nsParser.h index e3e9afd24d3f..83b8f610c5a1 100644 --- a/htmlparser/src/nsParser.h +++ b/htmlparser/src/nsParser.h @@ -85,7 +85,6 @@ #include "nsHTMLTags.h" #include "nsDTDUtils.h" #include "nsTimer.h" -#include "nsIProgressEventSink.h" #include "nsIEventQueue.h" class IContentSink; @@ -280,8 +279,6 @@ class nsParser : public nsIParser, // These methods are callback methods used by // net lib to let us know about our inputstream. //********************************************* - NS_DECL_NSIPROGRESSEVENTSINK - // nsIRequestObserver methods: NS_DECL_NSIREQUESTOBSERVER @@ -460,7 +457,6 @@ protected: PRInt32 mMinorIteration; nsIRequestObserver* mObserver; - nsIProgressEventSink* mProgressEventSink; nsIContentSink* mSink; nsIParserFilter* mParserFilter; diff --git a/parser/htmlparser/src/nsParser.cpp b/parser/htmlparser/src/nsParser.cpp index c81d00187dda..977fa93949c7 100644 --- a/parser/htmlparser/src/nsParser.cpp +++ b/parser/htmlparser/src/nsParser.cpp @@ -56,7 +56,6 @@ #include "nsICachingChannel.h" #include "nsICacheEntryDescriptor.h" #include "nsICharsetAlias.h" -#include "nsIProgressEventSink.h" #include "nsIInputStream.h" #include "CNavDTD.h" #include "COtherDTD.h" @@ -71,7 +70,6 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID); static NS_DEFINE_IID(kIParserIID, NS_IPARSER_IID); -static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID); static NS_DEFINE_CID(kWellFormedDTDCID, NS_WELLFORMEDDTD_CID); static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID); @@ -308,7 +306,6 @@ nsParser::nsParser(nsITokenObserver* anObserver) { mCharset.AssignWithConversion("ISO-8859-1"); mParserFilter = 0; mObserver = 0; - mProgressEventSink = nsnull; mSink=0; mParserContext=0; mTokenObserver=anObserver; @@ -364,7 +361,6 @@ nsParser::~nsParser() { #endif NS_IF_RELEASE(mObserver); - NS_IF_RELEASE(mProgressEventSink); NS_IF_RELEASE(mSink); NS_IF_RELEASE(mParserFilter); @@ -405,9 +401,6 @@ nsresult nsParser::QueryInterface(const nsIID& aIID, void** aInstancePtr) else if(aIID.Equals(kIParserIID)) { //do IParser base class... *aInstancePtr = (nsIParser*)(this); } - else if(aIID.Equals(NS_GET_IID(nsIProgressEventSink))) { - *aInstancePtr = (nsIStreamListener*)(this); - } else if(aIID.Equals(NS_GET_IID(nsIRequestObserver))) { *aInstancePtr = (nsIRequestObserver*)(this); } @@ -2011,42 +2004,6 @@ nsITokenizer* nsParser::GetTokenizer(void) { These methods are used to talk to the netlib system... *******************************************************************/ -/** - * - * - * @update gess 5/12/98 - * @param - * @return error code -- 0 if ok, non-zero if error. - */ -nsresult -nsParser::OnProgress(nsIRequest *request, nsISupports* aContext, PRUint32 aProgress, PRUint32 aProgressMax) -{ - nsresult result=0; - if (nsnull != mProgressEventSink) { - mProgressEventSink->OnProgress(request, aContext, aProgress, aProgressMax); - } - return result; -} - -/** - * - * - * @update gess 5/12/98 - * @param - * @return error code -- 0 if ok, non-zero if error. - */ -nsresult -nsParser::OnStatus(nsIRequest *request, nsISupports* aContext, - nsresult aStatus, const PRUnichar* aStatusArg) -{ - nsresult rv; - if (nsnull != mProgressEventSink) { - rv = mProgressEventSink->OnStatus(request, aContext, aStatus, aStatusArg); - NS_ASSERTION(NS_SUCCEEDED(rv), "dropping error result"); - } - return NS_OK; -} - #ifdef rickgdebug #include fstream* gOutFile; diff --git a/parser/htmlparser/src/nsParser.h b/parser/htmlparser/src/nsParser.h index e3e9afd24d3f..83b8f610c5a1 100644 --- a/parser/htmlparser/src/nsParser.h +++ b/parser/htmlparser/src/nsParser.h @@ -85,7 +85,6 @@ #include "nsHTMLTags.h" #include "nsDTDUtils.h" #include "nsTimer.h" -#include "nsIProgressEventSink.h" #include "nsIEventQueue.h" class IContentSink; @@ -280,8 +279,6 @@ class nsParser : public nsIParser, // These methods are callback methods used by // net lib to let us know about our inputstream. //********************************************* - NS_DECL_NSIPROGRESSEVENTSINK - // nsIRequestObserver methods: NS_DECL_NSIREQUESTOBSERVER @@ -460,7 +457,6 @@ protected: PRInt32 mMinorIteration; nsIRequestObserver* mObserver; - nsIProgressEventSink* mProgressEventSink; nsIContentSink* mSink; nsIParserFilter* mParserFilter;