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
|
|
|
|
|
|
|
#include "nsHtml5TreeOpStage.h"
|
|
|
|
|
2015-08-11 18:29:46 +03:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2009-09-21 17:18:20 +04:00
|
|
|
nsHtml5TreeOpStage::nsHtml5TreeOpStage()
|
|
|
|
: mMutex("nsHtml5TreeOpStage mutex")
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsHtml5TreeOpStage::~nsHtml5TreeOpStage()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-11-17 11:52:30 +03:00
|
|
|
nsHtml5TreeOpStage::MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue)
|
2009-09-21 17:18:20 +04:00
|
|
|
{
|
|
|
|
mozilla::MutexAutoLock autoLock(mMutex);
|
2015-08-11 18:29:46 +03:00
|
|
|
mOpQueue.AppendElements(Move(aOpQueue));
|
2009-09-21 17:18:20 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-02-26 12:18:38 +03:00
|
|
|
nsHtml5TreeOpStage::MoveOpsAndSpeculativeLoadsTo(nsTArray<nsHtml5TreeOperation>& aOpQueue,
|
|
|
|
nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue)
|
2009-09-21 17:18:20 +04:00
|
|
|
{
|
|
|
|
mozilla::MutexAutoLock autoLock(mMutex);
|
2015-08-11 18:29:46 +03:00
|
|
|
aOpQueue.AppendElements(Move(mOpQueue));
|
|
|
|
aSpeculativeLoadQueue.AppendElements(Move(mSpeculativeLoadQueue));
|
2010-02-26 12:18:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5TreeOpStage::MoveSpeculativeLoadsFrom(nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue)
|
|
|
|
{
|
|
|
|
mozilla::MutexAutoLock autoLock(mMutex);
|
2015-08-11 18:29:46 +03:00
|
|
|
mSpeculativeLoadQueue.AppendElements(Move(aSpeculativeLoadQueue));
|
2010-02-26 12:18:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5TreeOpStage::MoveSpeculativeLoadsTo(nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue)
|
|
|
|
{
|
|
|
|
mozilla::MutexAutoLock autoLock(mMutex);
|
2015-08-11 18:29:46 +03:00
|
|
|
aSpeculativeLoadQueue.AppendElements(Move(mSpeculativeLoadQueue));
|
2009-09-21 17:18:20 +04:00
|
|
|
}
|
2009-10-12 17:08:04 +04:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
void
|
|
|
|
nsHtml5TreeOpStage::AssertEmpty()
|
|
|
|
{
|
|
|
|
mozilla::MutexAutoLock autoLock(mMutex);
|
|
|
|
// This shouldn't really need the mutex
|
|
|
|
NS_ASSERTION(mOpQueue.IsEmpty(), "The stage was supposed to be empty.");
|
|
|
|
}
|
|
|
|
#endif
|