Chromium Code Reviews| 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..34e873e7ede3234cf9500f46b4c7d128a031a3a2 100644 |
| --- a/cc/trees/layer_tree_host.cc |
| +++ b/cc/trees/layer_tree_host.cc |
| @@ -737,6 +737,21 @@ void LayerTreeHost::ApplyViewportDeltas(ScrollAndScaleSet* info) { |
| SetNeedsUpdateLayers(); |
| } |
| +void LayerTreeHost::RecordWheelAndTouchScrollingCount(ScrollAndScaleSet* info) { |
| + if (!info || info->scroll_source_info == 0) |
|
danakj
2017/03/10 20:52:48
When will info be null?
sahel
2017/03/13 20:13:43
Done.
|
| + return; |
| + |
| + bool has_scrolled_by_wheel = |
| + (info->scroll_source_info & |
| + InputHandler::ScrollSourceInfo::SCROLLED_BY_WHEEL) != 0; |
| + bool has_scrolled_by_touch = |
| + (info->scroll_source_info & |
| + InputHandler::ScrollSourceInfo::SCROLLED_BY_TOUCH) != 0; |
| + |
| + 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 +782,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() |