8edc7a1fb1
* chore: bump chromium in DEPS to 53836640273c3d45b05ad74bdff7323ef0ffc610 * chore: bump chromium in DEPS to 17da1064b910f4170320ff37e971064916aed1dc * Rename attach_same_site_cookies param to force_ignore_site_for_cookies https://chromium-review.googlesource.com/c/chromium/src/+/2162209 * chore: update patch indices * Remove single argument HttpResponseHeaders::AddHeader() method https://chromium-review.googlesource.com/c/chromium/src/+/2155353 * Rename attach_same_site_cookies param to force_ignore_site_for_cookies https://chromium-review.googlesource.com/c/chromium/src/+/2162209 * fixup! Remove single argument HttpResponseHeaders::AddHeader() method * Exchange SandboxType::kInvalid for a CHECK. https://chromium-review.googlesource.com/c/chromium/src/+/2167995 * chore: fix string type on windows Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: deepak1556 <hop2deep@gmail.com>
48 lines
2.2 KiB
Diff
48 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Thu, 20 Sep 2018 17:45:47 -0700
|
|
Subject: disable_hidden.patch
|
|
|
|
Electron uses this to disable background throttling for hidden windows.
|
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
|
index a0bb67b269f03ed6fa322fd156e9eb358eed1437..8c2d75c20afd5832371b04f50c9fb1ec5d9e8dc5 100644
|
|
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
|
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
|
@@ -653,6 +653,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
|
if (is_hidden_)
|
|
return;
|
|
|
|
+ if (disable_hidden_)
|
|
+ return;
|
|
+
|
|
RejectMouseLockOrUnlockIfNecessary(
|
|
blink::mojom::PointerLockResult::kWrongDocument);
|
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
|
|
index 947fb6ba02cde74da8787ccec689cd184f98aefd..67722b63693d28c828435d60ca167b5cda0a57b4 100644
|
|
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
|
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
|
@@ -179,6 +179,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
|
// RenderWidgetHostImpl.
|
|
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);
|
|
|
|
+ // Electron: Prevents the widget from getting hidden.
|
|
+ bool disable_hidden_ = false;
|
|
+
|
|
void set_new_content_rendering_delay_for_testing(
|
|
const base::TimeDelta& delay) {
|
|
new_content_rendering_delay_ = delay;
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
|
index 12e1923fd2943af92aaf6f691d28212bdd2a73dd..3b66abb180df5f3da7c4fa8de77279620cbc4aa3 100644
|
|
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
|
@@ -692,7 +692,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
|
DCHECK(visibility_ == Visibility::HIDDEN ||
|
|
visibility_ == Visibility::OCCLUDED);
|
|
|
|
- if (!host()->is_hidden()) {
|
|
+ if (!host()->is_hidden() && !host()->disable_hidden_) {
|
|
host()->WasHidden();
|
|
aura::WindowTreeHost* host = window_->GetHost();
|
|
if (delegated_frame_host_) {
|