From d0138cbb079818fe8c114a7cd602f7fedf509700 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 5 Sep 2017 11:41:34 -0400 Subject: [PATCH] Windows: Fix crash during window creation (see https://crbug.com/761389) --- patch/patch.cfg | 3 ++ patch/patches/rwh_background_color_1984.patch | 34 +++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/patch/patch.cfg b/patch/patch.cfg index fcff408db..32eee8c06 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -279,6 +279,9 @@ patches = [ { # Fix white flash during browser creation. # https://bitbucket.org/chromiumembedded/cef/issues/1984 + # + # Windows: Fix crash during window creation. + # https://bugs.chromium.org/p/chromium/issues/detail?id=761389 'name': 'rwh_background_color_1984', }, { diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index 38e60cfab..6ef105038 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,8 +1,22 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 2f5ef2190d81..02c66974a6b4 100644 +index 2f5ef2190d81..fb3dcab86340 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -740,8 +740,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer( +@@ -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()); +- } + } + + //////////////////////////////////////////////////////////////////////////////// +@@ -740,8 +733,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer( background_color_ = color; bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; @@ -15,3 +29,19 @@ index 2f5ef2190d81..02c66974a6b4 100644 } bool RenderWidgetHostViewAura::IsMouseLocked() { +@@ -1923,6 +1918,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; +