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

Unified Diff: content/public/browser/render_process_host.h

Issue 2569963002: MemoryCoordinator checks if ServiceWorker exists on the suspending process (Closed)
Patch Set: Descriptive -> imperative 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/public/browser/render_process_host.h
diff --git a/content/public/browser/render_process_host.h b/content/public/browser/render_process_host.h
index 8edeb8458a3428f17d5d3b0b7348886335a15989..3bdae8d874aca6a4e2f220c680ae9952a13a57a1 100644
--- a/content/public/browser/render_process_host.h
+++ b/content/public/browser/render_process_host.h
@@ -304,10 +304,28 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::Sender,
// Returns true if this process currently has backgrounded priority.
virtual bool IsProcessBackgrounded() const = 0;
- // Called when the existence of the other renderer process which is connected
- // to the Worker in this renderer process has changed.
+ // Returns the sum of the shared worker and service worker ref counts.
+ virtual size_t GetWorkerRefCount() const = 0;
+
+ // Counts the number of service workers who live on this process. The service
+ // worker ref count is incremented when this process is allocated to the
+ // worker, and decremented when worker's shutdown sequence is completed.
virtual void IncrementServiceWorkerRefCount() = 0;
virtual void DecrementServiceWorkerRefCount() = 0;
+
+ // Called when the existence of the other renderer process which is connected
+ // to the Worker in this renderer process has changed.
+
+ // The shared worker ref count is nonzero if any other process is connected to
+ // a shared worker in this process, or a new shared worker is being created in
+ // this process. IncrementSharedWorkerRefCount is called in two cases:
+ // - there was no external renderer connected to a shared worker in this
+ // process, and now there is at least one
+ // - a new worker is being created in this process.
+ // DecrementSharedWorkerRefCount is called in two cases:
+ // - there was an external renderer connected to a shared worker in this
+ // process, and now there is none
+ // - a new worker finished being created in this process
virtual void IncrementSharedWorkerRefCount() = 0;
virtual void DecrementSharedWorkerRefCount() = 0;

Powered by Google App Engine
This is Rietveld 408576698