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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2565223002: Add more specific metrics for main thread scrolling reasons (Closed)
Patch Set: Relocate the logic of updating mainThreadScrollingFromStyle 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/paint/PaintLayerScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
index e50d441318e02d9e712f2b5845123466b39657b5..3cf4f29dc640cdc3922d67474f070deaf6383a25 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -107,7 +107,8 @@ PaintLayerScrollableArea::PaintLayerScrollableArea(PaintLayer& layer)
m_scrollbarManager(*this),
m_scrollCorner(nullptr),
m_resizer(nullptr),
- m_scrollAnchor(this)
+ m_scrollAnchor(this),
+ m_reasons(0)
#if DCHECK_IS_ON()
,
m_hasBeenDisposed(false)
@@ -147,8 +148,18 @@ void PaintLayerScrollableArea::dispose() {
if (box().frame() && box().frame()->page()) {
if (ScrollingCoordinator* scrollingCoordinator =
- box().frame()->page()->scrollingCoordinator())
+ box().frame()->page()->scrollingCoordinator()) {
+ // Decrese the number of layer that has any main thread
+ // scrolling reasons stored in ScrollingCoordinator
+ for (uint32_t i = 0;
+ i < MainThreadScrollingReason::kMainThreadScrollingReasonCount;
+ ++i) {
+ if (hasMainThreadScrollingReason(1 << i)) {
+ scrollingCoordinator->adjustMainThreadReasonsFromStyle(1 << i, false);
+ }
+ }
scrollingCoordinator->willDestroyScrollableArea(this);
bokan 2016/12/14 13:28:59 Actually, since we already have this willDestroySc
yigu 2016/12/14 21:17:33 Done.
+ }
}
if (!box().documentBeingDestroyed()) {

Powered by Google App Engine
This is Rietveld 408576698