michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsHtml5Speculation.h" michael@0: michael@0: nsHtml5Speculation::nsHtml5Speculation(nsHtml5OwningUTF16Buffer* aBuffer, michael@0: int32_t aStart, michael@0: int32_t aStartLineNumber, michael@0: nsAHtml5TreeBuilderState* aSnapshot) michael@0: : mBuffer(aBuffer) michael@0: , mStart(aStart) michael@0: , mStartLineNumber(aStartLineNumber) michael@0: , mSnapshot(aSnapshot) michael@0: { michael@0: MOZ_COUNT_CTOR(nsHtml5Speculation); michael@0: } michael@0: michael@0: nsHtml5Speculation::~nsHtml5Speculation() michael@0: { michael@0: MOZ_COUNT_DTOR(nsHtml5Speculation); michael@0: } michael@0: michael@0: void michael@0: nsHtml5Speculation::MoveOpsFrom(nsTArray& aOpQueue) michael@0: { michael@0: if (mOpQueue.IsEmpty()) { michael@0: mOpQueue.SwapElements(aOpQueue); michael@0: return; michael@0: } michael@0: mOpQueue.MoveElementsFrom(aOpQueue); michael@0: } michael@0: michael@0: void michael@0: nsHtml5Speculation::FlushToSink(nsAHtml5TreeOpSink* aSink) michael@0: { michael@0: aSink->MoveOpsFrom(mOpQueue); michael@0: }