From 05cddc2490115082a5481b838b29cae4d9e7ac64 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 1fa83177c..fa4418139 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -287,6 +287,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 5bb4d09d3..aeffc43a8 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 91e326b..8f22548 100644 +index 91e326b7c623..72fd49dca893 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 91e326b..8f22548 100644 } bool RenderWidgetHostViewAura::IsMouseLocked() { +@@ -1915,6 +1910,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; +