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: #ifndef nsHtml5TreeOpStage_h michael@0: #define nsHtml5TreeOpStage_h michael@0: michael@0: #include "mozilla/Mutex.h" michael@0: #include "nsHtml5TreeOperation.h" michael@0: #include "nsTArray.h" michael@0: #include "nsAHtml5TreeOpSink.h" michael@0: #include "nsHtml5SpeculativeLoad.h" michael@0: michael@0: class nsHtml5TreeOpStage : public nsAHtml5TreeOpSink { michael@0: public: michael@0: michael@0: nsHtml5TreeOpStage(); michael@0: michael@0: virtual ~nsHtml5TreeOpStage(); michael@0: michael@0: /** michael@0: * Flush the operations from the tree operations from the argument michael@0: * queue unconditionally. michael@0: */ michael@0: virtual void MoveOpsFrom(nsTArray& aOpQueue); michael@0: michael@0: /** michael@0: * Retrieve the staged operations and speculative loads into the arguments. michael@0: */ michael@0: void MoveOpsAndSpeculativeLoadsTo(nsTArray& aOpQueue, michael@0: nsTArray& aSpeculativeLoadQueue); michael@0: michael@0: /** michael@0: * Move the speculative loads from the argument into the staging queue. michael@0: */ michael@0: void MoveSpeculativeLoadsFrom(nsTArray& aSpeculativeLoadQueue); michael@0: michael@0: /** michael@0: * Retrieve the staged speculative loads into the argument. michael@0: */ michael@0: void MoveSpeculativeLoadsTo(nsTArray& aSpeculativeLoadQueue); michael@0: michael@0: #ifdef DEBUG michael@0: void AssertEmpty(); michael@0: #endif michael@0: michael@0: private: michael@0: nsTArray mOpQueue; michael@0: nsTArray mSpeculativeLoadQueue; michael@0: mozilla::Mutex mMutex; michael@0: michael@0: }; michael@0: michael@0: #endif /* nsHtml5TreeOpStage_h */