Chromium Code Reviews| 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..77bb05a7d55c8633b863ed15219a714c1677de49 100644 |
| --- a/content/browser/web_contents/web_contents_impl.cc |
| +++ b/content/browser/web_contents/web_contents_impl.cc |
| @@ -1647,8 +1647,13 @@ 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. Give the event to the main frame in this case. |
|
Charlie Reis
2015/12/07 22:47:24
Sanity check: What will the main frame do with it?
alexmos
2015/12/07 23:12:59
That's a good point. It's going to go to the main
Charlie Reis
2015/12/07 23:16:52
Yes, let's do that. Thanks!
alexmos
2015/12/07 23:21:50
Done. Please take a look.
|
| + RenderWidgetHostView* view = focused_frame->current_frame_host()->GetView(); |
| + if (!view) |
| + return receiving_widget; |
| + |
| + return RenderWidgetHostImpl::From(view->GetRenderWidgetHost()); |
| } |
| void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { |