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

Unified Diff: content/browser/service_worker/embedded_worker_registry.h

Issue 2638313002: Manage ServiceWorkerDispatcherHost in ServiceWorkerContextCore (Closed)
Patch Set: Fix an include guard Created 3 years, 10 months 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/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 09b925b918007e85c5071d24b25ae609c6098e08..98b88a62e3d20e2ecc085d3ec0f81eee3bd75eaf 100644
--- a/content/browser/service_worker/embedded_worker_registry.h
+++ b/content/browser/service_worker/embedded_worker_registry.h
@@ -22,7 +22,6 @@ class GURL;
namespace IPC {
class Message;
-class Sender;
}
namespace content {
@@ -88,12 +87,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,
- MessagePortMessageFilter* message_port_message_filter);
- 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);
@@ -112,9 +112,6 @@ class CONTENT_EXPORT EmbeddedWorkerRegistry
RemoveWorkerInSharedProcess);
using WorkerInstanceMap = std::map<int, EmbeddedWorkerInstance*>;
- using ProcessToSenderMap = std::map<int, IPC::Sender*>;
- using ProcessToMessagePortMessageFilterMap =
- std::map<int, MessagePortMessageFilter*>;
EmbeddedWorkerRegistry(
const base::WeakPtr<ServiceWorkerContextCore>& context,
@@ -143,8 +140,6 @@ class CONTENT_EXPORT EmbeddedWorkerRegistry
base::WeakPtr<ServiceWorkerContextCore> context_;
WorkerInstanceMap worker_map_;
- ProcessToSenderMap process_sender_map_;
- ProcessToMessagePortMessageFilterMap process_message_port_message_filter_map_;
// Map from process_id to embedded_worker_id.
// This map only contains starting and running workers.

Powered by Google App Engine
This is Rietveld 408576698