Improved NS_ERROR_OUT_OF_MEMORY error handling. b=354074 r=mrbkap sr=jst

git-svn-id: svn://10.0.0.236/trunk@214217 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mats.palmgren%bredband.net
2006-10-27 01:49:52 +00:00
parent 9c542e1a41
commit 6c2b590a5d
4 changed files with 233 additions and 243 deletions

View File

@@ -797,6 +797,7 @@ nsresult CViewSourceHTML::WriteTag(PRInt32 aTagType,const nsSubstring & aText,PR
theAllocator->CreateTokenOfType(eToken_start,
eHTMLTag_span,
NS_LITERAL_STRING("SPAN")));
NS_ENSURE_TRUE(theTagToken, NS_ERROR_OUT_OF_MEMORY);
theContext.mErrorNode.Init(theTagToken, theAllocator);
AddAttrToNode(theContext.mErrorNode, theAllocator,
NS_LITERAL_STRING("class"),
@@ -826,6 +827,7 @@ nsresult CViewSourceHTML::WriteTag(PRInt32 aTagType,const nsSubstring & aText,PR
theAllocator->CreateTokenOfType(eToken_start,
eHTMLTag_span,
NS_LITERAL_STRING("SPAN")));
NS_ENSURE_TRUE(theTagToken, NS_ERROR_OUT_OF_MEMORY);
theContext.mStartNode.Init(theTagToken, theAllocator);
AddAttrToNode(theContext.mStartNode, theAllocator,
NS_LITERAL_STRING("class"),