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; |