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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

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/LayoutObject.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index ac9462f73910d0dbe23ccc828005c2807dda3866..80279b478075591638d70290ed3d97e07d9f696c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -75,6 +75,109 @@ struct PaintInvalidatorContext;
enum VisualRectFlags { DefaultVisualRectFlags = 0, EdgeInclusive = 1 };
+enum RareDataReason {
+ // LayoutObject
+ ReasonLOAll,
+ ReasonLOInFlowSelfPaintingLayer,
+ ReasonLOInFlowSelfPaintingLayerDiffPC,
+ ReasonLOPreviousLocation,
+ ReasonLOFloatLayerBug1,
+ ReasonLOFloatLayerBug2,
+ ReasonLOSVGForeignBug,
+ // LayoutInline
+ ReasonLIAll,
+ ReasonLICreatesLineBoxes,
+ // LayoutText
+ ReasonLTAll,
+ ReasonLTCanUseParentVisualRect,
+ ReasonLTZeroOrOneLineBox,
+ ReasonLTZeroOrOneLineBoxCanUse,
+ // LayoutBox
+ ReasonLBAll,
+ ReasonLBRareData,
+ ReasonLBInlineBoxWrapper,
+ ReasonLBSpannerPlaceholder,
+ ReasonLBOverrideSize,
+ ReasonLBPageOffset,
+ ReasonLBPaginationStrut,
+ ReasonLBPreviousSize,
+ ReasonLBPreviousLayoutOverflow,
+ ReasonLBPreviousContentBox,
+ ReasonLBPreviousContentBoxSizeIfDiff,
+ ReasonLBPositionedContainer,
+ ReasonLBPositionedDiffPC,
+ ReasonLBPercentHeightContainer,
+ ReasonLBContentBoxDiff,
+ ReasonLBLayoutOverflowDiff,
+ // LayoutBlock
+ ReasonLBLAll,
+ ReasonLBLPositionedDescendants,
+ ReasonLBLPercentHeightDescendants,
+ // LayoutBlockFlow
+ ReasonLBFAll,
+ ReasonLBFRareData,
+ ReasonLBFPaginationStrutFromChild,
+ ReasonLBFLineBreakToAvoidWidow,
+ ReasonLBFDiscardMargin,
+ ReasonLBFMargin,
+ ReasonLBFMultiColumnFlowThread,
+ // LayoutTableSection
+ ReasonLTSAll,
+ ReasonLTSComposited,
+ ReasonLTSNonComposited,
+ ReasonLTSCompositedWithContainerBackground,
+ // LayoutTableRow
+ ReasonLTRAll,
+ ReasonLTRComposited,
+ ReasonLTRNonComposited,
+ ReasonLTRCompositedWithContainerBackground,
+ // LayoutTableCell
+ ReasonLTCAll,
+ ReasonLTCInvisibleCollapsedBorders,
+ ReasonLTCCollapsedBorders,
+ ReasonLTCComposited,
+ ReasonLTCNonComposited,
+ ReasonLTCCompositedWithContainerBackground,
+ // LocationOffset
+ ReasonLocationOffsetObject,
+ ReasonLocationOffsetBox,
+ ReasonLocationOffsetText,
+ ReasonLocationOffsetInline,
+ ReasonLocationOffsetSVG,
+
+ MaxReason,
+ ReasonNone = -1,
+};
+
+static_assert(MaxReason == 58, "keep consistent");
+
+struct RareDataStat {
+ public:
+ RareDataStat() : m_reasons(0) {}
+#if 0
+ ~RareDataStat()
+ {
+ for (int reason = 0; reason < MaxReason; ++reason) {
+ if (m_reasons & ((uint64_t)1 << reason))
+ s_reasonCounts[reason]--;
+ }
+ }
+#endif
+
+ void addReason(RareDataReason reason) {
+ if (reason == ReasonNone)
+ return;
+ uint64_t reasonBit = (uint64_t)1 << reason;
+ if (!(m_reasons & reasonBit)) {
+ m_reasons |= reasonBit;
+ s_reasonCounts[reason]++;
+ }
+ }
+
+ uint64_t m_reasons;
+ static int s_reasonCounts[MaxReason];
+};
+
enum CursorDirective { SetCursorBasedOnStyle, SetCursor, DoNotSetCursor };
enum HitTestFilter { HitTestAll, HitTestSelf, HitTestDescendants };
@@ -2564,6 +2667,9 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
// For SPv2 only. The ObjectPaintProperties structure holds references to the
// property tree nodes that are created by the layout object for painting.
std::unique_ptr<ObjectPaintProperties> m_paintProperties;
+
+ public:
+ mutable RareDataStat m_rareStat;
};
// FIXME: remove this once the layout object lifecycle ASSERTS are no longer
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698