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

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

Issue 2569963002: MemoryCoordinator checks if ServiceWorker exists on the suspending process (Closed)
Patch Set: Updated several comments 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..bc0de81fc23cad1e9beccaac01f192781ce699b6 100644
--- a/content/public/browser/render_process_host.h
+++ b/content/public/browser/render_process_host.h
@@ -304,10 +304,29 @@ 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 total number of shared worker and service workers.
falken 2016/12/14 08:21:15 nit: This isn't really the total number of workers
shimazu 2016/12/14 09:34:04 Thanks, updated.
+ 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 the worker is trying to look for or
+ // allocate a process, 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