Fix potential OSR crash on renderer process recreation (issue #2082)

This commit is contained in:
Marshall Greenblatt 2017-01-25 12:34:18 -05:00
parent 41a02dbe08
commit 819dcdf461
1 changed files with 3 additions and 1 deletions

View File

@ -472,7 +472,6 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
weak_ptr_factory_(this) {
DCHECK(render_widget_host_);
DCHECK(!render_widget_host_->GetView());
render_widget_host_->SetView(this);
// CefBrowserHostImpl might not be created at this time for popups.
if (content::RenderViewHost::From(render_widget_host_)) {
@ -506,6 +505,9 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
if (browser_impl_.get())
ResizeRootLayer();
// Do this last because it may result in a call to SetNeedsBeginFrames.
render_widget_host_->SetView(this);
}
CefRenderWidgetHostViewOSR::~CefRenderWidgetHostViewOSR() {