parser/html/nsHtml5Speculation.cpp

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #include "nsHtml5Speculation.h"
michael@0 6
michael@0 7 nsHtml5Speculation::nsHtml5Speculation(nsHtml5OwningUTF16Buffer* aBuffer,
michael@0 8 int32_t aStart,
michael@0 9 int32_t aStartLineNumber,
michael@0 10 nsAHtml5TreeBuilderState* aSnapshot)
michael@0 11 : mBuffer(aBuffer)
michael@0 12 , mStart(aStart)
michael@0 13 , mStartLineNumber(aStartLineNumber)
michael@0 14 , mSnapshot(aSnapshot)
michael@0 15 {
michael@0 16 MOZ_COUNT_CTOR(nsHtml5Speculation);
michael@0 17 }
michael@0 18
michael@0 19 nsHtml5Speculation::~nsHtml5Speculation()
michael@0 20 {
michael@0 21 MOZ_COUNT_DTOR(nsHtml5Speculation);
michael@0 22 }
michael@0 23
michael@0 24 void
michael@0 25 nsHtml5Speculation::MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue)
michael@0 26 {
michael@0 27 if (mOpQueue.IsEmpty()) {
michael@0 28 mOpQueue.SwapElements(aOpQueue);
michael@0 29 return;
michael@0 30 }
michael@0 31 mOpQueue.MoveElementsFrom(aOpQueue);
michael@0 32 }
michael@0 33
michael@0 34 void
michael@0 35 nsHtml5Speculation::FlushToSink(nsAHtml5TreeOpSink* aSink)
michael@0 36 {
michael@0 37 aSink->MoveOpsFrom(mOpQueue);
michael@0 38 }

mercurial