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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2737653004: UMA metrics for use count of wheel and touch scrolls. (Closed)
Patch Set: use of fieldbit instead of normal enum 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_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 1974eb1dcc8fc394ae5a201b8d53a867833d1892..642ab1f536db81277243fc48c7117b58f51f8e0d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2690,6 +2690,8 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl(
client_->RenewTreePriority();
RecordCompositorSlowScrollMetric(type, CC_THREAD);
+ UpdateScrollSourceInfo(wheel_scrolling_);
+
return scroll_status;
}
@@ -3486,6 +3488,10 @@ std::unique_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
active_tree_->elastic_overscroll()->PullDeltaForMainThread();
scroll_info->swap_promises.swap(swap_promises_for_main_thread_scroll_update_);
+ // Record and reset scroll_source_info_;
+ scroll_info->scroll_source_info = scroll_source_info_;
+ scroll_source_info_ = ScrollSourceInfo::NONE;
+
return scroll_info;
}
@@ -4188,4 +4194,11 @@ void LayerTreeHostImpl::SetContextVisibility(bool is_visible) {
}
}
+void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) {
+ if (is_wheel_scroll)
+ scroll_source_info_ |= ScrollSourceInfo::SCROLLED_BY_WHEEL;
+ else
+ scroll_source_info_ |= ScrollSourceInfo::SCROLLED_BY_TOUCH;
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698