Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1577433003: Statistics of LayoutBox rare data reasons Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 9a074fa73dc3324ba23bfe504b34ac13fc40521c..8059142c4179b18e434fd57d8ddb036ea0db40b1 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -102,6 +102,7 @@ LayoutBox::LayoutBox(ContainerNode* node)
m_maxPreferredLogicalWidth(-1),
m_inlineBoxWrapper(nullptr) {
setIsBox();
+ m_rareStat.addReason(ReasonLBAll);
}
PaintLayerType LayoutBox::layerTypeRequired() const {
@@ -1235,11 +1236,13 @@ bool LayoutBox::hasOverrideLogicalContentWidth() const {
void LayoutBox::setOverrideLogicalContentHeight(LayoutUnit height) {
ASSERT(height >= 0);
ensureRareData().m_overrideLogicalContentHeight = height;
+ m_rareStat.addReason(ReasonLBOverrideSize);
}
void LayoutBox::setOverrideLogicalContentWidth(LayoutUnit width) {
ASSERT(width >= 0);
ensureRareData().m_overrideLogicalContentWidth = width;
+ m_rareStat.addReason(ReasonLBOverrideSize);
}
void LayoutBox::clearOverrideLogicalContentHeight() {
@@ -2105,6 +2108,7 @@ void LayoutBox::setSpannerPlaceholder(
// Not expected to change directly from one spanner to another.
CHECK(!m_rareData || !m_rareData->m_spannerPlaceholder);
ensureRareData().m_spannerPlaceholder = &placeholder;
+ m_rareStat.addReason(ReasonLBSpannerPlaceholder);
}
void LayoutBox::clearSpannerPlaceholder() {
@@ -2117,6 +2121,8 @@ void LayoutBox::setPaginationStrut(LayoutUnit strut) {
if (!strut && !m_rareData)
return;
ensureRareData().m_paginationStrut = strut;
+ if (strut)
+ m_rareStat.addReason(ReasonLBPaginationStrut);
}
bool LayoutBox::isBreakBetweenControllable(EBreakBetween breakValue) const {
@@ -5422,6 +5428,8 @@ void LayoutBox::setOffsetToNextPage(LayoutUnit offset) {
if (!m_rareData && !offset)
return;
ensureRareData().m_offsetToNextPage = offset;
+ if (offset)
+ m_rareStat.addReason(ReasonLBPageOffset);
}
void LayoutBox::logicalExtentAfterUpdatingLogicalWidth(
@@ -5591,6 +5599,8 @@ void LayoutBox::setPercentHeightContainer(LayoutBlock* container) {
if (!container && !m_rareData)
return;
ensureRareData().m_percentHeightContainer = container;
+ if (container)
+ m_rareStat.addReason(ReasonLBPercentHeightContainer);
}
void LayoutBox::removeFromPercentHeightContainer() {
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698