Commit 94edf646 authored by W. James MacLean's avatar W. James MacLean Committed by Commit Bot

Make sure we don't deref nullopt for TouchAction.

This CL is in addition to
https://chromium-review.googlesource.com/c/chromium/src/+/1099193, and
fixes another case where an Optional<TouchAction> might have novalue.

Bug: 824774
Change-Id: I21d18fa682d3de4cea7b54572f0bbef92eb9e6ca
Reviewed-on: https://chromium-review.googlesource.com/1101478Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567410}
parent a7152b86
...@@ -1105,7 +1105,8 @@ void RenderWidgetHostInputEventRouter::DispatchTouchscreenGestureEvent( ...@@ -1105,7 +1105,8 @@ void RenderWidgetHostInputEventRouter::DispatchTouchscreenGestureEvent(
// should have been one. // should have been one.
if (root_view != touchscreen_gesture_target_.target && if (root_view != touchscreen_gesture_target_.target &&
!rwhi->is_in_touchscreen_gesture_scroll()) { !rwhi->is_in_touchscreen_gesture_scroll()) {
base::Optional<cc::TouchAction> target_allowed_touch_action; base::Optional<cc::TouchAction> target_allowed_touch_action(
cc::kTouchActionNone);
if (touchscreen_gesture_target_.target) { if (touchscreen_gesture_target_.target) {
target_allowed_touch_action = target_allowed_touch_action =
(static_cast<RenderWidgetHostImpl*>( (static_cast<RenderWidgetHostImpl*>(
...@@ -1113,6 +1114,7 @@ void RenderWidgetHostInputEventRouter::DispatchTouchscreenGestureEvent( ...@@ -1113,6 +1114,7 @@ void RenderWidgetHostInputEventRouter::DispatchTouchscreenGestureEvent(
->input_router() ->input_router()
->AllowedTouchAction(); ->AllowedTouchAction();
} }
DCHECK(target_allowed_touch_action.has_value());
if (target_allowed_touch_action.value() & if (target_allowed_touch_action.value() &
cc::TouchAction::kTouchActionPinchZoom) { cc::TouchAction::kTouchActionPinchZoom) {
gesture_pinch_did_send_scroll_begin_ = true; gesture_pinch_did_send_scroll_begin_ = true;
......
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