mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: bump chromium in DEPS to 148.0.7739.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: bump chromium in DEPS to 148.0.7740.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * 7654582: Delete obsolete kEnableServiceWorkersForChromeScheme feature flag. https://chromium-review.googlesource.com/c/chromium/src/+/7654582 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fixup patch indices Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fixup patch indices Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 7664982: Move SharedModuleService to //extensions https://chromium-review.googlesource.com/c/chromium/src/+/7664982 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump chromium in DEPS to 148.0.7741.0 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: fixup patch indices Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 7666060: [CodeHealth] Replace `RequestPermissions` with `RequestPermissionsFromCurrentDocument` https://chromium-review.googlesource.com/c/chromium/src/+/7666060 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
25 lines
1.7 KiB
Diff
25 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 2375ed828ee173932754c49299ccb6e5b0521a1c..cbdbbdba6d5d836a7e942450a87510c1873bbbca 100644
|
|
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
@@ -588,7 +588,11 @@
|
|
}
|
|
|
|
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);
|
|
|
|
// Headless mode forces focus change propagation inside Focus(), since there
|
|
// is no NSWindow to deliver the normal focus change notifications. As a
|