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

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

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.h
diff --git a/third_party/WebKit/Source/core/frame/FrameView.h b/third_party/WebKit/Source/core/frame/FrameView.h
index f3496595a49b91242f2929265d357eb26dab8317..d825a9a9ac4cc1486f418850df1c7e3749c64b61 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.h
+++ b/third_party/WebKit/Source/core/frame/FrameView.h
@@ -767,6 +767,21 @@ class CORE_EXPORT FrameView final
// Only for SPv2.
std::unique_ptr<JSONObject> compositedLayersAsJSON(LayerTreeFlags);
+ inline int reasonIndex(uint32_t reason) const {
bokan 2016/12/13 14:38:57 inline unneeded, this is inline by virtue of being
bokan 2016/12/13 14:38:57 This should move as a helper into MainThreadScroll
yigu 2016/12/13 20:54:10 Done.
yigu 2016/12/13 20:54:10 Done.
+ if (!reason || reason & (reason - 1))
+ return 0;
+ int power = 0;
+ while (reason > 0) {
+ reason = reason >> 1;
+ ++power;
+ }
+ return power;
+ }
+
+ void adjustMainThreadReasonsDueToLayoutObject(uint32_t reason, bool increase);
bokan 2016/12/13 14:38:56 IMO, this should be called adjustMainThreadReasons
yigu 2016/12/13 20:54:10 Done.
+
+ MainThreadScrollingReasons checkMainThreadScrollingReasonDueToLayoutObject();
bokan 2016/12/13 14:38:56 check->get, Reason->Reasons
yigu 2016/12/13 20:54:10 Done.
+
protected:
// Scroll the content via the compositor.
bool scrollContentsFastPath(const IntSize& scrollDelta);
@@ -1132,6 +1147,12 @@ class CORE_EXPORT FrameView final
// For Slimming Paint v2 only.
std::unique_ptr<PaintController> m_paintController;
std::unique_ptr<PaintArtifactCompositor> m_paintArtifactCompositor;
+
+ // For recording main thread scrolling reasons
+ // due to layout object properties. e.g. opacity, transform.
+ // The size of the vector depends on the number of
+ // main thread scrolling reasons.
+ Vector<int> m_mainThreadScrollingReasonLayoutCounter;
bokan 2016/12/13 14:38:57 My read is that this vector is tracking scrolling
yigu 2016/12/13 20:54:10 Done.
};
inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) {

Powered by Google App Engine
This is Rietveld 408576698