Bug 1570869 - Remove mPendingCount in favor of an accessor. r=nical

Depends on D40371

Differential Revision: https://phabricator.services.mozilla.com/D40372

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-08-05 11:59:35 +00:00
parent 17df58880c
commit d00dade81c
2 changed files with 8 additions and 11 deletions

View File

@ -320,7 +320,7 @@ void RenderThread::HandleFrameOneDoc(wr::WindowId aWindowId, bool aRender) {
auto it = windows->find(AsUint64(aWindowId));
MOZ_ASSERT(it != windows->end());
WindowInfo* info = it->second;
MOZ_ASSERT(info->mPendingCount > 0);
MOZ_ASSERT(info->PendingCount() > 0);
frame = info->mPendingFrames.front();
hadSlowFrame = info->mHadSlowFrame;
info->mHadSlowFrame = false;
@ -515,11 +515,11 @@ bool RenderThread::TooManyPendingFrames(wr::WindowId aWindowId) {
}
WindowInfo* info = it->second;
if (info->mPendingCount > maxFrameCount) {
if (info->PendingCount() > maxFrameCount) {
return true;
}
MOZ_ASSERT(info->mPendingCount >= info->mRenderingCount);
return info->mPendingCount > info->mRenderingCount;
MOZ_ASSERT(info->PendingCount() >= info->mRenderingCount);
return info->PendingCount() > info->mRenderingCount;
}
bool RenderThread::IsDestroyed(wr::WindowId aWindowId) {
@ -552,7 +552,6 @@ void RenderThread::IncPendingFrameCount(wr::WindowId aWindowId,
MOZ_ASSERT(false);
return;
}
it->second->mPendingCount++;
it->second->mPendingFrames.push(PendingFrameInfo{aStartTime, aStartId});
it->second->mDocFrameCounts.push(aDocFrameCount);
}
@ -565,15 +564,14 @@ void RenderThread::FrameRenderingComplete(wr::WindowId aWindowId) {
return;
}
WindowInfo* info = it->second;
MOZ_ASSERT(info->mPendingCount > 0);
MOZ_ASSERT(info->PendingCount() > 0);
MOZ_ASSERT(info->mRenderingCount > 0);
if (info->mPendingCount <= 0) {
if (info->PendingCount() <= 0) {
return;
}
PendingFrameInfo frame = std::move(info->mPendingFrames.front());
info->mPendingFrames.pop();
info->mPendingCount--;
info->mRenderingCount--;
// The start time is from WebRenderBridgeParent::CompositeToTarget. From that

View File

@ -305,13 +305,12 @@ class RenderThread final {
};
struct WindowInfo {
int64_t PendingCount() { return mPendingFrames.size(); }
bool mIsDestroyed = false;
bool mRender = false;
int64_t mPendingCount = 0;
int64_t mRenderingCount = 0;
uint8_t mDocFramesSeen = 0;
// One entry in this queue for each pending frame, so the length
// should always equal mPendingCount
std::queue<PendingFrameInfo> mPendingFrames;
std::queue<uint8_t> mDocFrameCounts;
bool mHadSlowFrame = false;