Bug 482919 - Add speculative parsing to the HTML5 parser. r=bnewman.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user