Bug 1414345 - Part 2: Add AutoProfilerLabels for all Frame Construction paths r?mstange
MozReview-Commit-ID: 4n65jAonwmA
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2702,16 +2702,17 @@ nsCSSFrameConstructor::ConstructDocEleme
return newFrame;
}
nsIFrame*
nsCSSFrameConstructor::ConstructRootFrame()
{
+ AUTO_PROFILER_LABEL("nsCSSFrameConstructor::ConstructRootFrame", LAYOUT);
AUTO_PROFILER_TRACING("Frame Construction", "ConstructRootFrame");
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
ServoStyleSet* styleSet = mPresShell->StyleSet();
// --------- BUILD VIEWPORT -----------
RefPtr<ComputedStyle> viewportPseudoStyle =
styleSet->ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::viewport,
@@ -7084,16 +7085,17 @@ nsCSSFrameConstructor::FindNextSiblingFo
void
nsCSSFrameConstructor::ContentAppended(nsIContent* aFirstNewContent,
InsertionKind aInsertionKind)
{
MOZ_ASSERT(aInsertionKind == InsertionKind::Sync ||
!RestyleManager()->IsInStyleRefresh());
+ AUTO_PROFILER_LABEL("nsCSSFrameConstructor::ContentAppended", LAYOUT);
AUTO_PROFILER_TRACING("Frame Construction", "ContentAppended");
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
#ifdef DEBUG
if (gNoisyContentUpdates) {
printf("nsCSSFrameConstructor::ContentAppended container=%p "
"first-child=%p lazy=%d\n",
aFirstNewContent->GetParent(),
@@ -7430,16 +7432,17 @@ void
nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aStartChild,
nsIContent* aEndChild,
nsILayoutHistoryState* aFrameState,
InsertionKind aInsertionKind)
{
MOZ_ASSERT(aInsertionKind == InsertionKind::Sync ||
!RestyleManager()->IsInStyleRefresh());
+ AUTO_PROFILER_LABEL("nsCSSFrameConstructor::ContentRangeInserted", LAYOUT);
AUTO_PROFILER_TRACING("Frame Construction", "ContentRangeInserted");
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
MOZ_ASSERT(aStartChild, "must always pass a child");
#ifdef DEBUG
if (gNoisyContentUpdates) {
printf("nsCSSFrameConstructor::ContentRangeInserted container=%p "
@@ -7892,16 +7895,17 @@ nsCSSFrameConstructor::ContentRangeInser
bool
nsCSSFrameConstructor::ContentRemoved(nsIContent* aChild,
nsIContent* aOldNextSibling,
RemoveFlags aFlags)
{
MOZ_ASSERT(aChild);
MOZ_ASSERT(!aChild->IsRootOfAnonymousSubtree() || !aOldNextSibling,
"Anonymous roots don't have siblings");
+ AUTO_PROFILER_LABEL("nsCSSFrameConstructor::ContentRemoved", LAYOUT);
AUTO_PROFILER_TRACING("Frame Construction", "ContentRemoved");
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
nsPresContext* presContext = mPresShell->GetPresContext();
MOZ_ASSERT(presContext, "Our presShell should have a valid presContext");
// We want to detect when the viewport override element stored in the
// prescontext is in the subtree being removed. Except in fullscreen cases
// (which are handled in Element::UnbindFromTree and do not get stored on the
@@ -8290,16 +8294,17 @@ nsCSSFrameConstructor::EnsureFrameForTex
root, nsRestyleHint(0), nsChangeHint_ReconstructFrame);
return true;
}
void
nsCSSFrameConstructor::CharacterDataChanged(nsIContent* aContent,
const CharacterDataChangeInfo& aInfo)
{
+ AUTO_PROFILER_LABEL("nsCSSFrameConstructor::CharacterDataChanged", LAYOUT);
AUTO_PROFILER_TRACING("Frame Construction", "CharacterDataChanged");
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
if ((aContent->HasFlag(NS_CREATE_FRAME_IF_NON_WHITESPACE) &&
!aContent->TextIsOnlyWhitespace()) ||
(aContent->HasFlag(NS_REFRAME_IF_WHITESPACE) &&
aContent->TextIsOnlyWhitespace())) {
#ifdef DEBUG