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 4bafa3e155
commit 6d7f90ec51
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_)) {
@ -503,6 +502,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() {