2012-05-29 19:52:43 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-09-21 17:18:20 +04:00
|
|
|
|
2013-08-23 19:07:10 +04:00
|
|
|
#ifndef nsHtml5TreeOpStage_h
|
|
|
|
#define nsHtml5TreeOpStage_h
|
2009-09-21 17:18:20 +04:00
|
|
|
|
|
|
|
#include "mozilla/Mutex.h"
|
|
|
|
#include "nsHtml5TreeOperation.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
#include "nsAHtml5TreeOpSink.h"
|
2010-02-26 12:18:38 +03:00
|
|
|
#include "nsHtml5SpeculativeLoad.h"
|
2009-09-21 17:18:20 +04:00
|
|
|
|
2018-03-16 18:26:06 +03:00
|
|
|
class nsHtml5TreeOpStage : public nsAHtml5TreeOpSink {
|
|
|
|
public:
|
|
|
|
nsHtml5TreeOpStage();
|
|
|
|
|
|
|
|
virtual ~nsHtml5TreeOpStage();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flush the operations from the tree operations from the argument
|
|
|
|
* queue unconditionally.
|
|
|
|
*/
|
2022-04-27 10:24:34 +03:00
|
|
|
[[nodiscard]] virtual bool MoveOpsFrom(
|
|
|
|
nsTArray<nsHtml5TreeOperation>& aOpQueue) override;
|
2018-03-16 18:26:06 +03:00
|
|
|
|
2021-12-22 18:54:49 +03:00
|
|
|
/**
|
|
|
|
* Retrieve the staged operations into the argument.
|
|
|
|
*/
|
2022-04-27 10:24:34 +03:00
|
|
|
[[nodiscard]] bool MoveOpsTo(nsTArray<nsHtml5TreeOperation>& aOpQueue);
|
2021-12-22 18:54:49 +03:00
|
|
|
|
2018-03-16 18:26:06 +03:00
|
|
|
/**
|
|
|
|
* Retrieve the staged operations and speculative loads into the arguments.
|
|
|
|
*/
|
2022-04-27 10:24:34 +03:00
|
|
|
[[nodiscard]] bool MoveOpsAndSpeculativeLoadsTo(
|
2018-03-16 18:26:06 +03:00
|
|
|
nsTArray<nsHtml5TreeOperation>& aOpQueue,
|
|
|
|
nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Move the speculative loads from the argument into the staging queue.
|
|
|
|
*/
|
|
|
|
void MoveSpeculativeLoadsFrom(
|
|
|
|
nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve the staged speculative loads into the argument.
|
|
|
|
*/
|
|
|
|
void MoveSpeculativeLoadsTo(
|
|
|
|
nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue);
|
2009-09-21 17:18:20 +04:00
|
|
|
|
2009-10-12 17:08:04 +04:00
|
|
|
#ifdef DEBUG
|
2018-03-16 18:26:06 +03:00
|
|
|
void AssertEmpty();
|
2009-10-12 17:08:04 +04:00
|
|
|
#endif
|
|
|
|
|
2018-03-16 18:26:06 +03:00
|
|
|
private:
|
|
|
|
nsTArray<nsHtml5TreeOperation> mOpQueue;
|
|
|
|
nsTArray<nsHtml5SpeculativeLoad> mSpeculativeLoadQueue;
|
2022-03-16 21:47:08 +03:00
|
|
|
mozilla::Mutex mMutex MOZ_UNANNOTATED;
|
2009-09-21 17:18:20 +04:00
|
|
|
};
|
|
|
|
|
2013-08-23 19:07:10 +04:00
|
|
|
#endif /* nsHtml5TreeOpStage_h */
|