cef/patch/patches/rwh_background_color_1984.p...

48 lines
1.8 KiB
Diff

diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
index 087bc630062a..bd6ae8b47a1b 100644
--- content/browser/renderer_host/render_widget_host_view_aura.cc
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -433,13 +433,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(
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());
- }
}
////////////////////////////////////////////////////////////////////////////////
@@ -789,8 +782,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() {
@@ -1922,6 +1917,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
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());
+ }
+
if (!features::IsMusEnabled())
return;