Bug 1115691 patch 1 - Store counts of frames constructed and reflowed on the pres context. r=roc

(I've tested the frame construction counts in my test for bug 1110277; I
haven't actually tested the reflow counts.)
This commit is contained in:
L. David Baron 2015-01-11 15:43:10 -08:00
Родитель 7370fc443f
Коммит 2c4447faf5
2 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -821,6 +821,20 @@ public:
nsIFrame * aFrame);
#endif
void ConstructedFrame() {
++mFramesConstructed;
}
void ReflowedFrame() {
++mFramesReflowed;
}
uint64_t FramesConstructedCount() {
return mFramesConstructed;
}
uint64_t FramesReflowedCount() {
return mFramesReflowed;
}
/**
* This table maps border-width enums 'thin', 'medium', 'thick'
* to actual nscoord values.
@ -1289,6 +1303,11 @@ protected:
uint32_t mInterruptChecksToSkip;
// Counters for tests and tools that want to detect frame construction
// or reflow.
uint64_t mFramesConstructed;
uint64_t mFramesReflowed;
mozilla::TimeStamp mReflowStartTime;
// last time we did a full style flush

Просмотреть файл

@ -538,6 +538,8 @@ nsFrame::Init(nsIContent* aContent,
NS_FRAME_MAY_BE_TRANSFORMED |
NS_FRAME_MAY_HAVE_GENERATED_CONTENT |
NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
} else {
PresContext()->ConstructedFrame();
}
if (GetParent()) {
nsFrameState state = GetParent()->GetStateBits();
@ -4432,6 +4434,8 @@ nsFrame::DidReflow(nsPresContext* aPresContext,
aReflowState->mPercentHeightObserver->NotifyPercentHeight(*aReflowState);
}
}
aPresContext->ReflowedFrame();
}
void