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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2737653004: UMA metrics for use count of wheel and touch scrolls. (Closed)
Patch Set: boolean flags used instead of fieldbit Created 3 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: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 7d4b70c5aa0d20625061b4ab508d424632e8a488..9beed1adf9a54af1d54f146dd4689a815a16fd4b 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -737,6 +737,16 @@ void LayerTreeHost::ApplyViewportDeltas(ScrollAndScaleSet* info) {
SetNeedsUpdateLayers();
}
+void LayerTreeHost::RecordWheelAndTouchScrollingCount(ScrollAndScaleSet* info) {
+ bool has_scrolled_by_wheel = info->has_scrolled_by_wheel;
+ bool has_scrolled_by_touch = info->has_scrolled_by_touch;
+
+ if (has_scrolled_by_wheel || has_scrolled_by_touch) {
+ client_->RecordWheelAndTouchScrollingCount(has_scrolled_by_wheel,
+ has_scrolled_by_touch);
+ }
+}
+
void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
for (auto& swap_promise : info->swap_promises) {
TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow",
@@ -767,6 +777,8 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
// controls from clamping the layout viewport both on the compositor and
// on the main thread.
ApplyViewportDeltas(info);
+
+ RecordWheelAndTouchScrollingCount(info);
}
const base::WeakPtr<InputHandler>& LayerTreeHost::GetInputHandler()

Powered by Google App Engine
This is Rietveld 408576698