96364 - Register html tag observers directly to parser service rather than nsObserverService. Doing so, reduces a lot of overhead. Also, the observers are now notified via sink. This eliminates the need for parser bundle.

r=dp,shanjian,sfraser, sr=rpotts.


git-svn-id: svn://10.0.0.236/trunk@104152 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
harishd%netscape.com
2001-09-28 23:08:17 +00:00
parent 3c1b9e9fad
commit 1c4e4c74ec
57 changed files with 541 additions and 1544 deletions

View File

@@ -80,17 +80,16 @@
#include "prtypes.h" //this is here for debug reasons...
#include "prio.h"
#include "plstr.h"
#include "prmem.h"
#ifdef RAPTOR_PERF_METRICS
#include "stopwatch.h"
Stopwatch vsTimer;
#endif
static NS_DEFINE_IID(kClassIID, NS_VIEWSOURCE_HTML_IID);
static NS_DEFINE_IID(kClassIID, NS_VIEWSOURCE_HTML_IID);
static int gErrorThreshold = 10;
// Define this to dump the viewsource stuff to a file
@@ -1099,12 +1098,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
else result=WriteTag(mStartTag,startValue,aToken->GetAttributeCount(),PR_TRUE);
if((ePlainText!=mDocType) && mParser && (NS_OK==result)) {
CObserverService* theService=mParser->GetObserverService();
if(theService) {
eHTMLTags theTag=(eHTMLTags)theToken->GetTypeID();
const nsISupportsParserBundle* bundle=mParser->GetParserBundle();
result=theService->Notify(theTag,theContext.mTokenNode,(void*)bundle, mMimeType, mParser);
}
result = mSink->NotifyTagObservers(&theContext.mTokenNode);
}
}
break;