Index: content/browser/service_worker/embedded_worker_registry.h |
diff --git a/content/browser/service_worker/embedded_worker_registry.h b/content/browser/service_worker/embedded_worker_registry.h |
index 8561ce4816430f757214017c0198590a970721e6..75b7666cad52371ab84242ee06aa7b6926c86fbb 100644 |
--- a/content/browser/service_worker/embedded_worker_registry.h |
+++ b/content/browser/service_worker/embedded_worker_registry.h |
@@ -10,7 +10,6 @@ |
#include <set> |
#include <vector> |
-#include "base/callback_forward.h" |
#include "base/gtest_prod_util.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
@@ -23,7 +22,6 @@ class GURL; |
namespace IPC { |
class Message; |
-class Sender; |
} |
namespace content { |
@@ -39,8 +37,6 @@ class ServiceWorkerContextCore; |
class CONTENT_EXPORT EmbeddedWorkerRegistry |
: public NON_EXPORTED_BASE(base::RefCounted<EmbeddedWorkerRegistry>) { |
public: |
- typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; |
- |
static scoped_refptr<EmbeddedWorkerRegistry> Create( |
const base::WeakPtr<ServiceWorkerContextCore>& contxet); |
@@ -88,9 +84,13 @@ class CONTENT_EXPORT EmbeddedWorkerRegistry |
int line_number, |
const GURL& source_url); |
- // Keeps a map from process_id to sender information. |
- void AddChildProcessSender(int process_id, IPC::Sender* sender); |
- void RemoveChildProcessSender(int process_id); |
+ // Removes information about the service workers running on the process and |
+ // calls ServiceWorkerVersion::OnDetached() on each. Called when the process |
+ // is terminated. Under normal operation, the workers should already have |
+ // been stopped before the process is terminated, in which case this function |
+ // does nothing. But in some cases the process can be terminated unexpectedly |
+ // or the workers can fail to stop cleanly. |
+ void RemoveProcess(int process_id); |
// Returns an embedded worker instance for given |embedded_worker_id|. |
EmbeddedWorkerInstance* GetWorker(int embedded_worker_id); |
@@ -107,7 +107,6 @@ class CONTENT_EXPORT EmbeddedWorkerRegistry |
RemoveWorkerInSharedProcess); |
using WorkerInstanceMap = std::map<int, EmbeddedWorkerInstance*>; |
- using ProcessToSenderMap = std::map<int, IPC::Sender*>; |
EmbeddedWorkerRegistry( |
const base::WeakPtr<ServiceWorkerContextCore>& context, |
@@ -136,7 +135,6 @@ class CONTENT_EXPORT EmbeddedWorkerRegistry |
base::WeakPtr<ServiceWorkerContextCore> context_; |
WorkerInstanceMap worker_map_; |
- ProcessToSenderMap process_sender_map_; |
// Map from process_id to embedded_worker_id. |
// This map only contains starting and running workers. |