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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2737653004: UMA metrics for use count of wheel and touch scrolls. (Closed)
Patch Set: TODO for GRC usage added. 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6edff37f91e42c40b8a3471c3ef07e462840144b..ebd8d171deb4931d9a2aeb6a1cc073abe6616fbe 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -237,7 +237,9 @@ LayerTreeHostImpl::LayerTreeHostImpl(
requires_high_res_to_draw_(false),
is_likely_to_require_a_draw_(false),
has_valid_compositor_frame_sink_(false),
- mutator_(nullptr) {
+ mutator_(nullptr),
+ has_scrolled_by_wheel_(false),
+ has_scrolled_by_touch_(false) {
DCHECK(mutator_host_);
mutator_host_->SetMutatorHostClient(this);
@@ -2695,6 +2697,8 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl(
client_->RenewTreePriority();
RecordCompositorSlowScrollMetric(type, CC_THREAD);
+ UpdateScrollSourceInfo(wheel_scrolling_);
+
return scroll_status;
}
@@ -3515,6 +3519,11 @@ 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 flags.
+ scroll_info->has_scrolled_by_wheel = has_scrolled_by_wheel_;
+ scroll_info->has_scrolled_by_touch = has_scrolled_by_touch_;
+ has_scrolled_by_wheel_ = has_scrolled_by_touch_ = false;
+
return scroll_info;
}
@@ -4217,4 +4226,11 @@ void LayerTreeHostImpl::SetContextVisibility(bool is_visible) {
}
}
+void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) {
+ if (is_wheel_scroll)
+ has_scrolled_by_wheel_ = true;
+ else
+ has_scrolled_by_touch_ = true;
+}
+
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698