Added AppendSource() into keep the semantics of

GetSource() alive. This should give us some performance
in adding skipped content to the node.

r=pollmann
This commit is contained in:
harishd%netscape.com 2000-03-23 21:19:05 +00:00
Родитель 7d2d0cf608
Коммит 0a887b9d1b
10 изменённых файлов: 188 добавлений и 2 удалений

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

@ -2046,7 +2046,9 @@ nsresult CNavDTD::CollectSkippedContent(nsCParserNode& aNode,PRInt32 &aCount) {
aNode.mSkippedContent->Append(mScratch);
}
}
else theNextToken->GetSource(*aNode.mSkippedContent);
else {
theNextToken->AppendSource(*aNode.mSkippedContent);
}
}
mTokenRecycler->RecycleToken(theNextToken);
}

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

@ -297,6 +297,28 @@ void CStartToken::DebugDumpSource(nsOutputStream& out) {
* @return nada
*/
void CStartToken::GetSource(nsString& anOutputString){
anOutputString="<";
/*
* mTextValue used to contain the name of the tag.
* But for the sake of performance we now rely on the tagID
* rather than tag name. This however, caused bug 15204
* to reincarnate. Since, mTextvalue is not being used here..
* I'm just going to comment it out.
*
*/
// anOutputString+=mTextValue;
if(mTrailingContent.Length()>0)
anOutputString+=mTrailingContent;
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CStartToken::AppendSource(nsString& anOutputString){
anOutputString+="<";
/*
* mTextValue used to contain the name of the tag.
@ -427,6 +449,19 @@ void CEndToken::DebugDumpSource(nsOutputStream& out) {
* @return nada
*/
void CEndToken::GetSource(nsString& anOutputString){
anOutputString="</";
anOutputString+=mTextValue;
anOutputString+=">";
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CEndToken::AppendSource(nsString& anOutputString){
anOutputString+="</";
anOutputString+=mTextValue;
anOutputString+=">";
@ -1174,6 +1209,20 @@ void CAttributeToken::DebugDumpToken(nsOutputStream& out) {
* @return nada
*/
void CAttributeToken::GetSource(nsString& anOutputString){
anOutputString=mTextKey;
anOutputString+="=";
anOutputString+=mTextValue;
anOutputString+=";";
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CAttributeToken::AppendSource(nsString& anOutputString){
anOutputString+=mTextKey;
anOutputString+="=";
anOutputString+=mTextValue;
@ -1668,6 +1717,19 @@ void CEntityToken::DebugDumpSource(nsOutputStream& out) {
* @return nada
*/
void CEntityToken::GetSource(nsString& anOutputString){
anOutputString="&";
anOutputString+=mTextValue;
//anOutputString+=";";
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CEntityToken::AppendSource(nsString& anOutputString){
anOutputString+="&";
anOutputString+=mTextValue;
//anOutputString+=";";
@ -1859,6 +1921,17 @@ void CSkippedContentToken::GetSource(nsString& anOutputString){
anOutputString="$skipped-content";
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CSkippedContentToken::AppendSource(nsString& anOutputString){
anOutputString+="$skipped-content";
}
/**
*
* @update gess4/25/98

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

@ -129,6 +129,7 @@ class CStartToken: public CHTMLToken {
void SetEmpty(PRBool aValue);
virtual void DebugDumpSource(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
virtual void Reinitialize(PRInt32 aTag, const nsString& aString);
@ -157,6 +158,7 @@ class CEndToken: public CHTMLToken {
virtual PRInt32 GetTokenType(void);
virtual void DebugDumpSource(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
};
@ -198,6 +200,7 @@ class CEntityToken : public CHTMLToken {
static PRInt32 TranslateToUnicodeStr(PRInt32 aValue,nsString& aString);
virtual void DebugDumpSource(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
};
@ -274,6 +277,7 @@ class CAttributeToken: public CHTMLToken {
virtual void SanitizeKey();
virtual void DebugDumpToken(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
virtual void DebugDumpSource(nsOutputStream& out);
PRBool mLastAttribute;
virtual void Reinitialize(PRInt32 aTag, const nsString& aString);
@ -352,6 +356,7 @@ class CSkippedContentToken: public CAttributeToken {
virtual PRInt32 GetTokenType(void);
virtual void DebugDumpSource(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
protected:
};

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

@ -183,6 +183,14 @@ nsString& CToken::GetStringValueXXX(void) {
* @return reference to string containing string value
*/
void CToken::GetSource(nsString& anOutputString){
anOutputString=mTextValue;
}
/**
* @update harishd 3/23/00
* @return reference to string containing string value
*/
void CToken::AppendSource(nsString& anOutputString){
anOutputString+=mTextValue;
}

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

@ -114,6 +114,11 @@ class CToken {
*/
virtual void GetSource(nsString& anOutputString);
/** @update harishd 03/23/00
* @return reference to string containing string value
*/
virtual void AppendSource(nsString& anOutputString);
/**
* Setter method that changes the string value of this token
* @update gess5/11/98

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

@ -2046,7 +2046,9 @@ nsresult CNavDTD::CollectSkippedContent(nsCParserNode& aNode,PRInt32 &aCount) {
aNode.mSkippedContent->Append(mScratch);
}
}
else theNextToken->GetSource(*aNode.mSkippedContent);
else {
theNextToken->AppendSource(*aNode.mSkippedContent);
}
}
mTokenRecycler->RecycleToken(theNextToken);
}

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

@ -297,6 +297,28 @@ void CStartToken::DebugDumpSource(nsOutputStream& out) {
* @return nada
*/
void CStartToken::GetSource(nsString& anOutputString){
anOutputString="<";
/*
* mTextValue used to contain the name of the tag.
* But for the sake of performance we now rely on the tagID
* rather than tag name. This however, caused bug 15204
* to reincarnate. Since, mTextvalue is not being used here..
* I'm just going to comment it out.
*
*/
// anOutputString+=mTextValue;
if(mTrailingContent.Length()>0)
anOutputString+=mTrailingContent;
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CStartToken::AppendSource(nsString& anOutputString){
anOutputString+="<";
/*
* mTextValue used to contain the name of the tag.
@ -427,6 +449,19 @@ void CEndToken::DebugDumpSource(nsOutputStream& out) {
* @return nada
*/
void CEndToken::GetSource(nsString& anOutputString){
anOutputString="</";
anOutputString+=mTextValue;
anOutputString+=">";
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CEndToken::AppendSource(nsString& anOutputString){
anOutputString+="</";
anOutputString+=mTextValue;
anOutputString+=">";
@ -1174,6 +1209,20 @@ void CAttributeToken::DebugDumpToken(nsOutputStream& out) {
* @return nada
*/
void CAttributeToken::GetSource(nsString& anOutputString){
anOutputString=mTextKey;
anOutputString+="=";
anOutputString+=mTextValue;
anOutputString+=";";
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CAttributeToken::AppendSource(nsString& anOutputString){
anOutputString+=mTextKey;
anOutputString+="=";
anOutputString+=mTextValue;
@ -1668,6 +1717,19 @@ void CEntityToken::DebugDumpSource(nsOutputStream& out) {
* @return nada
*/
void CEntityToken::GetSource(nsString& anOutputString){
anOutputString="&";
anOutputString+=mTextValue;
//anOutputString+=";";
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CEntityToken::AppendSource(nsString& anOutputString){
anOutputString+="&";
anOutputString+=mTextValue;
//anOutputString+=";";
@ -1859,6 +1921,17 @@ void CSkippedContentToken::GetSource(nsString& anOutputString){
anOutputString="$skipped-content";
}
/*
*
*
* @update harishd 03/23/00
* @param result appended to the output string.
* @return nada
*/
void CSkippedContentToken::AppendSource(nsString& anOutputString){
anOutputString+="$skipped-content";
}
/**
*
* @update gess4/25/98

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

@ -129,6 +129,7 @@ class CStartToken: public CHTMLToken {
void SetEmpty(PRBool aValue);
virtual void DebugDumpSource(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
virtual void Reinitialize(PRInt32 aTag, const nsString& aString);
@ -157,6 +158,7 @@ class CEndToken: public CHTMLToken {
virtual PRInt32 GetTokenType(void);
virtual void DebugDumpSource(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
};
@ -198,6 +200,7 @@ class CEntityToken : public CHTMLToken {
static PRInt32 TranslateToUnicodeStr(PRInt32 aValue,nsString& aString);
virtual void DebugDumpSource(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
};
@ -274,6 +277,7 @@ class CAttributeToken: public CHTMLToken {
virtual void SanitizeKey();
virtual void DebugDumpToken(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
virtual void DebugDumpSource(nsOutputStream& out);
PRBool mLastAttribute;
virtual void Reinitialize(PRInt32 aTag, const nsString& aString);
@ -352,6 +356,7 @@ class CSkippedContentToken: public CAttributeToken {
virtual PRInt32 GetTokenType(void);
virtual void DebugDumpSource(nsOutputStream& out);
virtual void GetSource(nsString& anOutputString);
virtual void AppendSource(nsString& anOutputString);
protected:
};

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

@ -183,6 +183,14 @@ nsString& CToken::GetStringValueXXX(void) {
* @return reference to string containing string value
*/
void CToken::GetSource(nsString& anOutputString){
anOutputString=mTextValue;
}
/**
* @update harishd 3/23/00
* @return reference to string containing string value
*/
void CToken::AppendSource(nsString& anOutputString){
anOutputString+=mTextValue;
}

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

@ -114,6 +114,11 @@ class CToken {
*/
virtual void GetSource(nsString& anOutputString);
/** @update harishd 03/23/00
* @return reference to string containing string value
*/
virtual void AppendSource(nsString& anOutputString);
/**
* Setter method that changes the string value of this token
* @update gess5/11/98