blob: e4b3c5dbecb20aed949ea6b7f2879779a0a3f77e [file] [log] [blame]
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
index f7f9dafb9798..a378394c2d41 100644
--- content/browser/renderer_host/render_widget_host_view_aura.cc
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -745,10 +745,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() {
void RenderWidgetHostViewAura::UpdateBackgroundColor() {
DCHECK(GetBackgroundColor());
- SkColor color = *GetBackgroundColor();
- bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
- window_->layer()->SetFillsBoundsOpaquely(opaque);
- window_->layer()->SetColor(color);
+ if (window_) {
+ SkColor color = *GetBackgroundColor();
+ bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
+ window_->layer()->SetFillsBoundsOpaquely(opaque);
+ window_->layer()->SetColor(color);
+ }
}
void RenderWidgetHostViewAura::WindowTitleChanged() {
@@ -2029,6 +2031,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
// Init(), because it needs to have the layer.
if (frame_sink_id_.is_valid())
window_->SetEmbedFrameSinkId(frame_sink_id_);
+
+ // 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());
+ }
}
void RenderWidgetHostViewAura::CreateDelegatedFrameHostClient() {