Commit 05fae737 authored by danakj's avatar danakj Committed by Commit Bot

Wrap all input handling with the SwapPromiseMonitor.

The SwapPromiseMonitor was moved to wrap only the call to
WillHandleGestureEvent(), but that optionally handles the input
event (it is handled for pepper when the mouse is locked). The event is
otherwise handled later in the method in the call to HandleTouchEvent()
or by calling out to the WebWidget. The SwapPromiseMonitor should be
alive during all of these calls.

This is a fix for the scope change in
https://chromium-review.googlesource.com/c/chromium/src/+/1812915

R=dtapuska@chromium.org

Bug: 994926
Change-Id: I3313415b4c8f90ac1b544d10a7bf68833e3ab872
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1831453
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701572}
parent 07e32375
......@@ -367,6 +367,9 @@ void RenderWidgetInputHandler::HandleInputEvent(
ui::LatencyInfo swap_latency_info(latency_info);
swap_latency_info.AddLatencyNumber(
ui::LatencyComponentType::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT);
cc::LatencyInfoSwapPromiseMonitor swap_promise_monitor(
&swap_latency_info, widget_->layer_tree_host()->GetSwapPromiseManager(),
nullptr);
bool prevent_default = false;
bool show_virtual_keyboard_for_mouse = false;
......@@ -377,12 +380,7 @@ void RenderWidgetInputHandler::HandleInputEvent(
mouse_event.PositionInWidget().x, "y",
mouse_event.PositionInWidget().y);
{
cc::LatencyInfoSwapPromiseMonitor swap_promise_monitor(
&swap_latency_info,
widget_->layer_tree_host()->GetSwapPromiseManager(), nullptr);
prevent_default = delegate_->WillHandleMouseEvent(mouse_event);
}
prevent_default = delegate_->WillHandleMouseEvent(mouse_event);
// Reset the last known cursor if mouse has left this widget. So next
// time that the mouse enters we always set the cursor accordingly.
......
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