Commit 3b14d3be authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Handle scroll update without begin in MomentumScrollJankTracker

MomentumScrollJankTracker logic assumed that a kGestureScrollUpdate
would always occur betweek kGestureScrollBegin / kGestureScrollEnd.

It seems like we can hit a kGestureScrollUpdate in other cases,
leading to a crash where we tried to use a null object. We now
handle this case.

Bug: 965422
Change-Id: I5538f52ff410e22334e0c0affcea5e987aa00803
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1625822
Commit-Queue: David Bokan <bokan@chromium.org>
Auto-Submit: Eric Karl <ericrk@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663145}
parent deceeb0a
......@@ -342,8 +342,12 @@ void InputHandlerProxy::DispatchSingleInputEvent(
std::make_unique<MomentumScrollJankTracker>();
break;
case blink::WebGestureEvent::kGestureScrollUpdate:
momentum_scroll_jank_tracker_->OnDispatchedInputEvent(
event_with_callback.get(), now);
// It's possible to get a scroll update without a begin. Ignore these
// cases.
if (momentum_scroll_jank_tracker_) {
momentum_scroll_jank_tracker_->OnDispatchedInputEvent(
event_with_callback.get(), now);
}
break;
case blink::WebGestureEvent::kGestureScrollEnd:
momentum_scroll_jank_tracker_.reset();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment