nsHtml5TreeOpStage.h (1733B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef nsHtml5TreeOpStage_h 6 #define nsHtml5TreeOpStage_h 7 8 #include "mozilla/Mutex.h" 9 #include "nsHtml5TreeOperation.h" 10 #include "nsTArray.h" 11 #include "nsAHtml5TreeOpSink.h" 12 #include "nsHtml5SpeculativeLoad.h" 13 14 class nsHtml5TreeOpStage : public nsAHtml5TreeOpSink { 15 public: 16 nsHtml5TreeOpStage(); 17 18 virtual ~nsHtml5TreeOpStage(); 19 20 /** 21 * Flush the operations from the tree operations from the argument 22 * queue unconditionally. 23 */ 24 [[nodiscard]] virtual bool MoveOpsFrom( 25 nsTArray<nsHtml5TreeOperation>& aOpQueue) override; 26 27 /** 28 * Retrieve the staged operations into the argument. 29 */ 30 [[nodiscard]] bool MoveOpsTo(nsTArray<nsHtml5TreeOperation>& aOpQueue); 31 32 /** 33 * Retrieve the staged operations and speculative loads into the arguments. 34 */ 35 [[nodiscard]] bool MoveOpsAndSpeculativeLoadsTo( 36 nsTArray<nsHtml5TreeOperation>& aOpQueue, 37 nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue); 38 39 /** 40 * Move the speculative loads from the argument into the staging queue. 41 */ 42 void MoveSpeculativeLoadsFrom( 43 nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue); 44 45 /** 46 * Retrieve the staged speculative loads into the argument. 47 */ 48 void MoveSpeculativeLoadsTo( 49 nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue); 50 51 #ifdef DEBUG 52 void AssertEmpty(); 53 #endif 54 55 private: 56 nsTArray<nsHtml5TreeOperation> mOpQueue; 57 nsTArray<nsHtml5SpeculativeLoad> mSpeculativeLoadQueue; 58 mozilla::Mutex mMutex MOZ_UNANNOTATED; 59 }; 60 61 #endif /* nsHtml5TreeOpStage_h */