parser/html/nsHtml5Speculation.h

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 #ifndef nsHtml5Speculation_h
michael@0 6 #define nsHtml5Speculation_h
michael@0 7
michael@0 8 #include "nsHtml5OwningUTF16Buffer.h"
michael@0 9 #include "nsAHtml5TreeBuilderState.h"
michael@0 10 #include "nsHtml5TreeOperation.h"
michael@0 11 #include "nsAHtml5TreeOpSink.h"
michael@0 12 #include "nsTArray.h"
michael@0 13 #include "nsAutoPtr.h"
michael@0 14 #include "mozilla/Attributes.h"
michael@0 15
michael@0 16 class nsHtml5Speculation MOZ_FINAL : public nsAHtml5TreeOpSink
michael@0 17 {
michael@0 18 public:
michael@0 19 nsHtml5Speculation(nsHtml5OwningUTF16Buffer* aBuffer,
michael@0 20 int32_t aStart,
michael@0 21 int32_t aStartLineNumber,
michael@0 22 nsAHtml5TreeBuilderState* aSnapshot);
michael@0 23
michael@0 24 ~nsHtml5Speculation();
michael@0 25
michael@0 26 nsHtml5OwningUTF16Buffer* GetBuffer()
michael@0 27 {
michael@0 28 return mBuffer;
michael@0 29 }
michael@0 30
michael@0 31 int32_t GetStart()
michael@0 32 {
michael@0 33 return mStart;
michael@0 34 }
michael@0 35
michael@0 36 int32_t GetStartLineNumber()
michael@0 37 {
michael@0 38 return mStartLineNumber;
michael@0 39 }
michael@0 40
michael@0 41 nsAHtml5TreeBuilderState* GetSnapshot()
michael@0 42 {
michael@0 43 return mSnapshot;
michael@0 44 }
michael@0 45
michael@0 46 /**
michael@0 47 * Flush the operations from the tree operations from the argument
michael@0 48 * queue unconditionally.
michael@0 49 */
michael@0 50 virtual void MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue);
michael@0 51
michael@0 52 void FlushToSink(nsAHtml5TreeOpSink* aSink);
michael@0 53
michael@0 54 private:
michael@0 55 /**
michael@0 56 * The first buffer in the pending UTF-16 buffer queue
michael@0 57 */
michael@0 58 nsRefPtr<nsHtml5OwningUTF16Buffer> mBuffer;
michael@0 59
michael@0 60 /**
michael@0 61 * The start index of this speculation in the first buffer
michael@0 62 */
michael@0 63 int32_t mStart;
michael@0 64
michael@0 65 /**
michael@0 66 * The current line number at the start of the speculation
michael@0 67 */
michael@0 68 int32_t mStartLineNumber;
michael@0 69
michael@0 70 nsAutoPtr<nsAHtml5TreeBuilderState> mSnapshot;
michael@0 71
michael@0 72 nsTArray<nsHtml5TreeOperation> mOpQueue;
michael@0 73 };
michael@0 74
michael@0 75 #endif // nsHtml5Speculation_h

mercurial