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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 6e8030fca4ea558c1c7cc5a6ddd66c0f999ffc1b..10e38a4e9195a4174cea9e0f2528061a7501ce06 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -2990,6 +2990,36 @@ void FrameView::clearPrintContext() {
m_printContext.clear();
}
+static int gFrameCounts[7];
+int* frameCounts() {
+ return gFrameCounts;
+}
+
+static void countFrames(const Frame& frame) {
+ gFrameCounts[0]++;
+ for (Frame* child = frame.tree().firstChild(); child;
+ child = child->tree().nextSibling()) {
+ if (!child->isLocalFrame()) {
+ gFrameCounts[1]++;
+ continue;
+ }
+ if (!child->ownerLayoutObject())
+ gFrameCounts[2]++;
+ if (FrameView* childView = toLocalFrame(child)->view()) {
+ if (childView->shouldThrottleRendering()) {
+ gFrameCounts[3]++;
+ if (!child->ownerLayoutObject())
+ gFrameCounts[4]++;
+ }
+ if (!childView->layoutView())
+ gFrameCounts[5]++;
+ } else {
+ gFrameCounts[6]++;
+ }
+ countFrames(*child);
+ }
+}
+
// TODO(leviw): We don't assert lifecycle information from documents in child
// PluginViews.
void FrameView::updateLifecyclePhasesInternal(
@@ -3121,6 +3151,10 @@ void FrameView::updateLifecyclePhasesInternal(
}
updateViewportIntersectionsForSubtree(targetState);
+
+ gFrameCounts[0] = gFrameCounts[1] = gFrameCounts[2] = gFrameCounts[3] =
+ gFrameCounts[4] = 0;
+ countFrames(*m_frame);
}
void FrameView::enqueueScrollAnchoringAdjustment(
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698