diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc index dda1da688eb7..936fc509685c 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -422,13 +422,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host, selection_controller_client_.reset( new TouchSelectionControllerClientAura(this)); CreateSelectionController(); - - RenderViewHost* rvh = RenderViewHost::From(host_); - if (rvh) { - // TODO(mostynb): actually use prefs. Landing this as a separate CL - // first to rebaseline some unreliable layout tests. - ignore_result(rvh->GetWebkitPreferences()); - } } //////////////////////////////////////////////////////////////////////////////// @@ -746,8 +739,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer( background_color_ = color; bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; - window_->layer()->SetFillsBoundsOpaquely(opaque); - window_->layer()->SetColor(color); + if (window_) { + window_->layer()->SetFillsBoundsOpaquely(opaque); + window_->layer()->SetColor(color); + } } bool RenderWidgetHostViewAura::IsMouseLocked() { @@ -1933,6 +1928,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { window_->Init(ui::LAYER_SOLID_COLOR); window_->layer()->SetColor(background_color_); + // Do this after |window_| is created to avoid crashes on Win10. + // See https://crbug.com/761389. + RenderViewHost* rvh = RenderViewHost::From(host_); + if (rvh) { + // TODO(mostynb): actually use prefs. Landing this as a separate CL + // first to rebaseline some unreliable layout tests. + ignore_result(rvh->GetWebkitPreferences()); + } + if (!IsMus()) return;