Commit 84397708 authored by Ria Jiang's avatar Ria Jiang Committed by Commit Bot

Early return if host is gone when dispatching events.

If host is already gone after we've found a target and is processing/
dispatching the event now, early return and drop the event.

Bug: 814674
Change-Id: Ifa1b0aac45669413f954a843bf395aae229b969c
Reviewed-on: https://chromium-review.googlesource.com/1129856Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Commit-Queue: Ria Jiang <riajiang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580206}
parent aa2ac6cd
......@@ -564,6 +564,11 @@ viz::FrameSinkId RenderWidgetHostViewBase::FrameSinkIdAtPoint(
void RenderWidgetHostViewBase::ProcessMouseEvent(
const blink::WebMouseEvent& event,
const ui::LatencyInfo& latency) {
// TODO(crbug.com/814674): Figure out the reason |host| is null here in all
// Process* functions.
if (!host())
return;
PreProcessMouseEvent(event);
host()->ForwardMouseEventWithLatencyInfo(event, latency);
}
......@@ -571,12 +576,17 @@ void RenderWidgetHostViewBase::ProcessMouseEvent(
void RenderWidgetHostViewBase::ProcessMouseWheelEvent(
const blink::WebMouseWheelEvent& event,
const ui::LatencyInfo& latency) {
if (!host())
return;
host()->ForwardWheelEventWithLatencyInfo(event, latency);
}
void RenderWidgetHostViewBase::ProcessTouchEvent(
const blink::WebTouchEvent& event,
const ui::LatencyInfo& latency) {
if (!host())
return;
PreProcessTouchEvent(event);
host()->ForwardTouchEventWithLatencyInfo(event, latency);
}
......@@ -584,6 +594,8 @@ void RenderWidgetHostViewBase::ProcessTouchEvent(
void RenderWidgetHostViewBase::ProcessGestureEvent(
const blink::WebGestureEvent& event,
const ui::LatencyInfo& latency) {
if (!host())
return;
host()->ForwardGestureEventWithLatencyInfo(event, latency);
}
......
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