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

Unified Diff: third_party/WebKit/Source/core/layout/ScrollAnchor.cpp

Issue 1827793004: Add initial UMA metrics for ScrollAnchoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase master Created 4 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/layout/ScrollAnchor.cpp
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
index 7959b41f6a48b238cf4a8b6d07280beb69333687..dbefd1b256907f3901c8ce3c78e5c3360262ac94 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
@@ -5,9 +5,11 @@
#include "core/layout/ScrollAnchor.h"
#include "core/frame/FrameView.h"
+#include "core/frame/UseCounter.h"
#include "core/layout/LayoutView.h"
#include "core/layout/line/InlineTextBox.h"
#include "core/paint/PaintLayerScrollableArea.h"
+#include "platform/Histogram.h"
namespace blink {
@@ -173,6 +175,11 @@ void ScrollAnchor::restore()
m_scroller->setScrollPosition(
m_scroller->scrollPositionDouble() + DoubleSize(adjustment),
AnchoringScroll);
+ // Update UMA metric.
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, adjustedOffsetHistogram,
+ ("Layout.ScrollAnchor.AdjustedScrollOffset", 2));
+ adjustedOffsetHistogram.count(1);
+ UseCounter::count(scrollerLayoutBox(m_scroller)->document(), UseCounter::ScrollAnchored);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698