Closed
Bug 1032521
Opened 10 years ago
Closed 7 years ago
ServiceWorker: Represent other workers as clients
Categories
(Core :: DOM: Service Workers, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: catalinb, Assigned: bkelly)
References
(Blocks 1 open bug)
Details
Service workers should handle the case when the controlled clients are also Workers.
Catalin, are you talking about exposing them via clients? Because network requests are already intercepted.
Flags: needinfo?(catalin.badea392)
Reporter | ||
Comment 2•10 years ago
|
||
This more of a default TODO reference used whenever worker clients were involved. I guess now it should track exposing workers as clients and getting postMessaging to work.
Flags: needinfo?(catalin.badea392)
Updated•10 years ago
|
Summary: ServiceWorker: Intercept other workers → ServiceWorker: Represent other workers as clients
Updated•10 years ago
|
Assignee: nobody → alberto.crespellperez
Updated•10 years ago
|
Status: NEW → ASSIGNED
Updated•10 years ago
|
Blocks: nga-toolkit-service-workers
Comment 3•9 years ago
|
||
not working on this for the current sprint (NGA S3) so releasing it for now
Assignee: alberto.crespellperez → nobody
Status: ASSIGNED → NEW
Component: DOM → DOM: Service Workers
Updated•9 years ago
|
Assignee | ||
Comment 4•9 years ago
|
||
Ehsan, this is another compat bug you could possibly work.
Flags: needinfo?(ehsan)
Assignee | ||
Updated•9 years ago
|
Blocks: ServiceWorkers-compat
Comment 5•9 years ago
|
||
In some places we would need to enumerate all clients (such as Clients.getAll()) and because of nested dedicated workers, maintaining a list of all WorkerPrivates that currently exist is problematic because the WorkerPrivate for nested workers can't be accessed on the main thread. Here is my plan for this:
* Give each worker private an immutable clientId. The clientId will be accessible both on the worker thread and the parent thread as it's immutable.
* When enumerating the list of clients, use the runtime service to find workers associated with a window. That gives us shared workers and top-level dedicated workers.
* Iterate over mChildWorkers and post messages to the nested workers as needed.
* Since the clientId for mChildWorkers can be read from the parent thread, we'd be able to find the clientId we're looking for always on the main thread.
Assignee: nobody → ehsan
Flags: needinfo?(ehsan)
Assignee | ||
Comment 6•9 years ago
|
||
Seems reasonable. Especially given we need a client ID for bug 1222464.
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Comment 7•8 years ago
|
||
This depends on my work in bug 1293277.
Assignee | ||
Comment 8•7 years ago
|
||
This was fixed by bug 1293277 and bug 1231211. You now get a FetchEvent.clientId for subresource requests coming from a controlled worker thread.
You need to log in
before you can comment on or make changes to this bug.
Description
•