| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index 18589f15e14ca89b2a2c84366110b23d7f66114f..5392cf82d6a4f7e7299a71cc22c04c929dd53fb8 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -1647,8 +1647,15 @@ RenderWidgetHostImpl* WebContentsImpl::GetFocusedRenderWidgetHost(
|
| if (!focused_frame)
|
| return receiving_widget;
|
|
|
| - return RenderWidgetHostImpl::From(
|
| - focused_frame->current_frame_host()->GetView()->GetRenderWidgetHost());
|
| + // The view may be null if a subframe's renderer process has crashed while
|
| + // the subframe has focus. Drop the event in that case. Do not give
|
| + // it to the main frame, so that the user doesn't unexpectedly type into the
|
| + // wrong frame if a focused subframe renderer crashes while they type.
|
| + RenderWidgetHostView* view = focused_frame->current_frame_host()->GetView();
|
| + if (!view)
|
| + return nullptr;
|
| +
|
| + return RenderWidgetHostImpl::From(view->GetRenderWidgetHost());
|
| }
|
|
|
| void WebContentsImpl::EnterFullscreenMode(const GURL& origin) {
|
|
|