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

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: Add use counter 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ba2558be4ea525a692f070152ea8065f091c6b32..76e912ee065e48932c61979ca8d91c33f6124113 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 {
@@ -163,6 +165,16 @@ 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);
+ if (m_scroller->isFrameView()) {
skobes 2016/03/24 18:59:11 You can do scrollerLayoutBox(m_scroller)->document
ymalik 2016/03/25 19:38:07 Done.
+ UseCounter::count(toFrameView(m_scroller)->layoutView()->document(), UseCounter::ScrollAnchored);
+ } else {
+ ASSERT(m_scroller->isPaintLayerScrollableArea());
+ UseCounter::count(toPaintLayerScrollableArea(m_scroller)->box().document(), UseCounter::ScrollAnchored);
+ }
}
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698