cad2d8b4aa
* chore: bump chromium in DEPS to c04c17506a1b5941370b91dfa44eda7ec31e9793 * update patches * chore: bump chromium in DEPS to 8a4687263763f306659d04cef8f0a12a9e504d57 * chore: bump chromium in DEPS to 3a75ada69d1ac06d6903a2c981ab90a8162f1ba0 * update patches * chore: sync StartRemoteDebuggingPipeHandler usage CL: https://chromium-review.googlesource.com/c/chromium/src/+/2536354 Added 'on_disconnect' OnceClosure arg to StartRemoteDebuggingPipeHandler * chore: add WebSocketHandshakeClient::OnFailurea CL: https://chromium-review.googlesource.com/c/chromium/src/+/2527889 Add an empty stub to satisfy parent class' pure virtual method OnFailure(). NB: Use of empty impl comes from WebRequestProxyingWebSocket. Co-authored-by: Charles Kerr <charles@charleskerr.com>
24 lines
1.7 KiB
Diff
24 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Andy Locascio <andy@slack-corp.com>
|
|
Date: Wed, 21 Aug 2019 12:09:10 -0700
|
|
Subject: fix: disabling compositor recycling
|
|
|
|
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
|
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
index a96abfa0a50cbbdedd82ea8c884c3c8bf1ab3fc3..87ee42a34b4121eddda2765953f51ac65d5d03b8 100644
|
|
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
@@ -484,7 +484,11 @@
|
|
return;
|
|
|
|
host()->WasHidden();
|
|
- browser_compositor_->SetRenderWidgetHostIsHidden(true);
|
|
+ // Consider the RWHV occluded only if it is not attached to a window
|
|
+ // (e.g. unattached BrowserView). Otherwise we treat it as visible to
|
|
+ // prevent unnecessary compositor recycling.
|
|
+ const bool unattached = ![GetInProcessNSView() window];
|
|
+ browser_compositor_->SetRenderWidgetHostIsHidden(unattached);
|
|
}
|
|
|
|
void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) {
|