2012-05-29 08:52:43 -07: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 06:18:20 -07:00
|
|
|
|
|
|
|
#ifndef nsHtml5TreeOpStage_h___
|
|
|
|
#define nsHtml5TreeOpStage_h___
|
|
|
|
|
|
|
|
#include "mozilla/Mutex.h"
|
|
|
|
#include "nsHtml5TreeOperation.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
#include "nsAHtml5TreeOpSink.h"
|
2010-02-26 01:18:38 -08:00
|
|
|
#include "nsHtml5SpeculativeLoad.h"
|
2009-09-21 06:18:20 -07:00
|
|
|
|
|
|
|
class nsHtml5TreeOpStage : public nsAHtml5TreeOpSink {
|
|
|
|
public:
|
|
|
|
|
|
|
|
nsHtml5TreeOpStage();
|
|
|
|
|
2010-11-18 00:23:48 -08:00
|
|
|
virtual ~nsHtml5TreeOpStage();
|
2009-09-21 06:18:20 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Flush the operations from the tree operations from the argument
|
|
|
|
* queue unconditionally.
|
|
|
|
*/
|
2009-11-17 00:52:30 -08:00
|
|
|
virtual void MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue);
|
2009-09-21 06:18:20 -07:00
|
|
|
|
|
|
|
/**
|
2010-02-26 01:18:38 -08:00
|
|
|
* Retrieve the staged operations and speculative loads into the arguments.
|
2009-09-21 06:18:20 -07:00
|
|
|
*/
|
2010-02-26 01:18:38 -08:00
|
|
|
void MoveOpsAndSpeculativeLoadsTo(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 06:18:20 -07:00
|
|
|
|
2009-10-12 06:08:04 -07:00
|
|
|
#ifdef DEBUG
|
|
|
|
void AssertEmpty();
|
|
|
|
#endif
|
|
|
|
|
2009-09-21 06:18:20 -07:00
|
|
|
private:
|
|
|
|
nsTArray<nsHtml5TreeOperation> mOpQueue;
|
2010-02-26 01:18:38 -08:00
|
|
|
nsTArray<nsHtml5SpeculativeLoad> mSpeculativeLoadQueue;
|
|
|
|
mozilla::Mutex mMutex;
|
2009-09-21 06:18:20 -07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsHtml5TreeOpStage_h___ */
|