Bug 502176 - Replace static use of jArray with a plain old data staticJArray, introduce an autoJArray for nicer memory management. r=tglek, a=jst.

This commit is contained in:
Henri Sivonen
2010-09-28 10:32:31 +03:00
parent 3d72e29d09
commit a00ca20e07
28 changed files with 1181 additions and 1329 deletions

View File

@@ -59,6 +59,8 @@
#include "nsHtml5MetaScanner.h"
PRUnichar nsHtml5MetaScanner::CHARSET[] = { 'c', 'h', 'a', 'r', 's', 'e', 't' };
PRUnichar nsHtml5MetaScanner::CONTENT[] = { 'c', 'o', 'n', 't', 'e', 'n', 't' };
void
nsHtml5MetaScanner::stateLoop(PRInt32 state)
{
@@ -671,9 +673,8 @@ void
nsHtml5MetaScanner::addToBuffer(PRInt32 c)
{
if (strBufLen == strBuf.length) {
jArray<PRUnichar,PRInt32> newBuf = jArray<PRUnichar,PRInt32>(strBuf.length + (strBuf.length << 1));
jArray<PRUnichar,PRInt32> newBuf = jArray<PRUnichar,PRInt32>::newJArray(strBuf.length + (strBuf.length << 1));
nsHtml5ArrayCopy::arraycopy(strBuf, newBuf, strBuf.length);
strBuf.release();
strBuf = newBuf;
}
strBuf[strBufLen++] = (PRUnichar) c;