Bug 482919 - Add speculative parsing to the HTML5 parser. r=bnewman.

This commit is contained in:
Henri Sivonen
2009-10-12 16:08:04 +03:00
parent 87b1f6516d
commit e5e8f90558
20 changed files with 934 additions and 215 deletions

View File

@@ -62,3 +62,29 @@ nsHtml5UTF16Buffer::~nsHtml5UTF16Buffer()
MOZ_COUNT_DTOR(nsHtml5UTF16Buffer);
delete[] buffer;
}
// Not using macros for AddRef and Release in order to be able to refcount on
// and create on different threads.
nsrefcnt
nsHtml5UTF16Buffer::AddRef()
{
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "Illegal refcount.");
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsHtml5UTF16Buffer", sizeof(*this));
return mRefCnt;
}
nsrefcnt
nsHtml5UTF16Buffer::Release()
{
NS_PRECONDITION(0 != mRefCnt, "Release without AddRef.");
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsHtml5UTF16Buffer");
if (mRefCnt == 0) {
mRefCnt = 1; /* stabilize */
delete this;
return 0;
}
return mRefCnt;
}