Do not hold parser nodes, that do not contain residual style information, longer than necessary. By recycling the nodes earlier the number of malloc calls and the peak memory usage can be reduced. b=177994, r=heikki, sr=jst
git-svn-id: svn://10.0.0.236/trunk@134114 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -226,11 +226,11 @@ nsLoggingSink::OpenContainer(const nsIParserNode& aNode) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::CloseContainer(const nsIParserNode& aNode) {
|
||||
nsLoggingSink::CloseContainer(const nsHTMLTag aTag) {
|
||||
|
||||
nsresult theResult=NS_OK;
|
||||
|
||||
nsHTMLTag nodeType = nsHTMLTag(aNode.GetNodeType());
|
||||
nsHTMLTag nodeType = nsHTMLTag(aTag);
|
||||
if ((nodeType >= eHTMLTag_unknown) &&
|
||||
(nodeType <= nsHTMLTag(NS_HTML_TAG_MAX))) {
|
||||
const PRUnichar* tag = nsHTMLTags::GetStringValue(nodeType);
|
||||
@@ -240,7 +240,7 @@ nsLoggingSink::CloseContainer(const nsIParserNode& aNode) {
|
||||
|
||||
//then proxy the call to the real sink if you have one.
|
||||
if(mSink) {
|
||||
theResult=mSink->CloseContainer(aNode);
|
||||
theResult=mSink->CloseContainer(aTag);
|
||||
}
|
||||
|
||||
return theResult;
|
||||
@@ -379,14 +379,14 @@ nsLoggingSink::OpenHTML(const nsIParserNode& aNode) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::CloseHTML(const nsIParserNode& aNode) {
|
||||
nsLoggingSink::CloseHTML() {
|
||||
CloseNode("html");
|
||||
|
||||
nsresult theResult=NS_OK;
|
||||
|
||||
//then proxy the call to the real sink if you have one.
|
||||
if(mSink) {
|
||||
theResult=mSink->CloseHTML(aNode);
|
||||
theResult=mSink->CloseHTML();
|
||||
}
|
||||
|
||||
return theResult;
|
||||
@@ -408,14 +408,14 @@ nsLoggingSink::OpenHead(const nsIParserNode& aNode) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::CloseHead(const nsIParserNode& aNode) {
|
||||
nsLoggingSink::CloseHead() {
|
||||
CloseNode("head");
|
||||
|
||||
nsresult theResult=NS_OK;
|
||||
|
||||
//then proxy the call to the real sink if you have one.
|
||||
if(mSink) {
|
||||
theResult=mSink->CloseHead(aNode);
|
||||
theResult=mSink->CloseHead();
|
||||
}
|
||||
|
||||
return theResult;
|
||||
@@ -436,14 +436,14 @@ nsLoggingSink::OpenBody(const nsIParserNode& aNode) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::CloseBody(const nsIParserNode& aNode) {
|
||||
nsLoggingSink::CloseBody() {
|
||||
CloseNode("body");
|
||||
|
||||
nsresult theResult=NS_OK;
|
||||
|
||||
//then proxy the call to the real sink if you have one.
|
||||
if(mSink) {
|
||||
theResult=mSink->CloseBody(aNode);
|
||||
theResult=mSink->CloseBody();
|
||||
}
|
||||
|
||||
return theResult;
|
||||
@@ -464,14 +464,14 @@ nsLoggingSink::OpenForm(const nsIParserNode& aNode) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::CloseForm(const nsIParserNode& aNode) {
|
||||
nsLoggingSink::CloseForm() {
|
||||
CloseNode("form");
|
||||
|
||||
nsresult theResult=NS_OK;
|
||||
|
||||
//then proxy the call to the real sink if you have one.
|
||||
if(mSink) {
|
||||
theResult=mSink->CloseForm(aNode);
|
||||
theResult=mSink->CloseForm();
|
||||
}
|
||||
|
||||
return theResult;
|
||||
@@ -492,14 +492,14 @@ nsLoggingSink::OpenMap(const nsIParserNode& aNode) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::CloseMap(const nsIParserNode& aNode) {
|
||||
nsLoggingSink::CloseMap() {
|
||||
CloseNode("map");
|
||||
|
||||
nsresult theResult=NS_OK;
|
||||
|
||||
//then proxy the call to the real sink if you have one.
|
||||
if(mSink) {
|
||||
theResult=mSink->CloseMap(aNode);
|
||||
theResult=mSink->CloseMap();
|
||||
}
|
||||
|
||||
return theResult;
|
||||
@@ -520,14 +520,14 @@ nsLoggingSink::OpenFrameset(const nsIParserNode& aNode) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::CloseFrameset(const nsIParserNode& aNode) {
|
||||
nsLoggingSink::CloseFrameset() {
|
||||
CloseNode("frameset");
|
||||
|
||||
nsresult theResult=NS_OK;
|
||||
|
||||
//then proxy the call to the real sink if you have one.
|
||||
if(mSink) {
|
||||
theResult=mSink->CloseFrameset(aNode);
|
||||
theResult=mSink->CloseFrameset();
|
||||
}
|
||||
|
||||
return theResult;
|
||||
|
||||
Reference in New Issue
Block a user