Eliminate Top-Level worker invariant that the parent of top-level workers be the main thread. (For RemoteWorkerService)
Categories
(Core :: DOM: Workers, enhancement, P2)
Tracking
()
People
(Reporter: asuth, Assigned: edenchuang)
References
(Depends on 2 open bugs, Blocks 1 open bug)
Details
Currently we support nested workers (the parent of a worker is another worker) and top-level workers (no parent, the Worker is either owned directly by a window/document or lives in its own agent cluster with special semantics, namely SharedWorkers or ServiceWorkers). There are unfortunately baked-in assumptions and assertions[1] that require that top-level workers are owned by the main thread. This is a serious performance problem for ServiceWorkers and needs to be addressed. I will be filing the ServiceWorker bug shortly and making it depend on this bug.
1: Off the top of my head, the general problem is that the RuntimeService maintains canonical state about top-level workers which is surfaced via XPCOM. These can be seen in RuntimeService::RegisterWorker and RegisterWorkerDebugger. There was a level of isomorphism about how we handled debuggers for ServiceWorkers because they could be exposed to devtools both via nsIServiceWorkerManager in the parent process main thread and also in every content process main thread. It seems like this bug may be breaking the symmetry and we may therefore need to make all RemoteWorkers have their debugger API exposed in the parent process main thread and remoted. This isn't trivial but it also isn't non-trivial.
| Reporter | ||
Updated•4 years ago
|
| Reporter | ||
Updated•2 years ago
|
Description
•