Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: content/browser/memory/memory_coordinator.cc

Issue 2569963002: MemoryCoordinator checks if ServiceWorker exists on the suspending process (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/memory/memory_coordinator.cc
diff --git a/content/browser/memory/memory_coordinator.cc b/content/browser/memory/memory_coordinator.cc
index b691322002007921695018b1e3ae16c69fec041d..fdbae591e30bed26ab77087b856eb79495dc0075 100644
--- a/content/browser/memory/memory_coordinator.cc
+++ b/content/browser/memory/memory_coordinator.cc
@@ -167,6 +167,8 @@ bool MemoryCoordinator::CanSuspendRenderer(int render_process_id) {
auto* render_process_host = RenderProcessHost::FromID(render_process_id);
if (!render_process_host || !render_process_host->IsProcessBackgrounded())
return false;
+ if (render_process_host->GetWorkerRefCount() > 0)
+ return false;
return delegate_->CanSuspendBackgroundedRenderer(render_process_id);
}

Powered by Google App Engine
This is Rietveld 408576698