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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2565223002: Add more specific metrics for main thread scrolling reasons (Closed)
Patch Set: Add unit test && refactoring Created 4 years 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 196f562691e386f9bdd7377e29038afb9aec1869..8469e696d032ed84dda81edac05a648dec563098 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -194,7 +194,10 @@ FrameView::FrameView(LocalFrame& frame)
m_scrollbarManager(*this),
m_needsScrollbarsUpdate(false),
m_suppressAdjustViewSize(false),
- m_allowsLayoutInvalidationAfterLayoutClean(true) {
+ m_allowsLayoutInvalidationAfterLayoutClean(true),
+ m_mainThreadScrollingReasonLayoutCounter(
+ MainThreadScrollingReason::kMainThreadScrollingReasonCount,
+ 0) {
init();
}
@@ -4675,4 +4678,24 @@ int FrameView::initialViewportHeight() const {
return m_initialViewportSize.height();
}
+void FrameView::adjustMainThreadReasonsDueToLayoutObject(uint32_t reason,
+ bool increase) {
+ m_mainThreadScrollingReasonLayoutCounter[reasonIndex(reason)] +=
bokan 2016/12/13 14:38:56 This should never be negative, right? If so, pleas
yigu 2016/12/13 20:54:10 Done.
+ increase ? 1 : -1;
+}
+
+MainThreadScrollingReasons
+FrameView::checkMainThreadScrollingReasonDueToLayoutObject() {
+ MainThreadScrollingReasons reasons =
+ static_cast<MainThreadScrollingReasons>(0);
+ for (uint32_t reason = 1;
+ reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount;
+ ++reason) {
+ if (m_mainThreadScrollingReasonLayoutCounter[reason] > 0) {
+ reasons |= 1 << (reason - 1);
+ }
+ }
+ return reasons;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698