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); |
+ } |
} |
} |