Commit 04ed3f26 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

MacViews: Don't try to route events when no frame sink is present

This (appropriately) DCHECKs when attempted. Skip event routing (send
directly to the root RWHV) when no frame sink is present.

Bug: 844095
Change-Id: I867c9f6cb7135473fc52fb44dcff7ed5e1759658
Reviewed-on: https://chromium-review.googlesource.com/1071120Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561391}
parent 1cdbef88
......@@ -1108,6 +1108,11 @@ viz::FrameSinkId RenderWidgetHostViewMac::GetFrameSinkId() {
bool RenderWidgetHostViewMac::ShouldRouteEvent(
const WebInputEvent& event) const {
// Event routing requires a valid frame sink (that is, that we be connected to
// a ui::Compositor), which is not guaranteed to be the case.
// https://crbug.com/844095
if (!browser_compositor_->GetRootFrameSinkId().is_valid())
return false;
// See also RenderWidgetHostViewAura::ShouldRouteEvent.
// TODO(wjmaclean): Update this function if RenderWidgetHostViewMac implements
// OnTouchEvent(), to match what we are doing in RenderWidgetHostViewAura.
......
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