Windows: Fix crash during window creation (see https://crbug.com/761389)

This commit is contained in:
Marshall Greenblatt 2017-09-05 11:41:34 -04:00
parent ed5208366c
commit 05cddc2490
2 changed files with 35 additions and 2 deletions

View File

@ -287,6 +287,9 @@ patches = [
{ {
# Fix white flash during browser creation. # Fix white flash during browser creation.
# https://bitbucket.org/chromiumembedded/cef/issues/1984 # 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', 'name': 'rwh_background_color_1984',
}, },
{ {

View File

@ -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 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
+++ 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; background_color_ = color;
bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
@ -15,3 +29,19 @@ index 91e326b..8f22548 100644
} }
bool RenderWidgetHostViewAura::IsMouseLocked() { 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;