Chromium Code Reviews| 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 |