Open Bug 1672491 Opened 5 years ago Updated 3 months ago

Eliminate Top-Level worker invariant that the parent of top-level workers be the main thread. (For RemoteWorkerService)

Categories

(Core :: DOM: Workers, enhancement, P2)

enhancement

Tracking

()

ASSIGNED

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.

Blocks: 1672493
Assignee: bugmail → echuang
Assignee: echuang → bugmail
Blocks: 1861785
Assignee: bugmail → echuang
No longer blocks: 1861785
Depends on: 1899503
Depends on: 1899507
Depends on: 1899509
No longer blocks: 1672493
Blocks: 1944242
You need to log in before you can comment on or make changes to this bug.