Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should DedicatedWorkers select their own ServiceWorkerRegistration? #423

Closed
jakearchibald opened this issue Aug 21, 2014 · 9 comments
Closed
Labels

Comments

@jakearchibald
Copy link
Contributor

We need to define which things are ServiceWorker clients, meaning they independently select a ServiceWorkerRegistration to use for their own loading and their subresources.

A SharedWorker should, I don't think anyone disagrees there, but DedicatedWorkers?

@michael-nordman
Copy link
Collaborator

I thought this was decided long ago? DedicatedWorkers probably should not.

In the context of ApplicationCaches, shared workers are viewed as a distinct top-level-browsing-context and dedicated workers are not. Dedicated workers are completely encapsulated by their owner. The ower makes resource loads on behalf of its dedicated workers. The Web Workers spec describes this more plainly...

"For the purposes of the application cache networking model, a dedicated worker is an extension of the cache host from which it was created."

I don't think there's compelling reason to deviate from that model.

@annevk
Copy link
Member

annevk commented Aug 21, 2014

The reason would that they have a distinct global, have their own CSP, etc.

@jungkees
Copy link
Collaborator

Has it been decided to consider dedicated worker a service worker client?
Assumed so in the related discussion: #516 (comment).

@annevk
Copy link
Member

annevk commented Nov 18, 2014

Yeah, there's no reason to treat them differently from other workers. Not sure why AppCache was weird about it.

@michael-nordman
Copy link
Collaborator

Because a dedicated worker does not define it's own browsing context, they inherit their parents browsing context. Is there compelling reason for this to different compared to how its handled in appcache, otherwise it seems like an arbitrary difference?

Fyi, Chromium's current implementation treats the dedicated worker resource and any resources loaded by a dedicated worker similar to a subresource loaded by the main document. Altering that behavior would probably be a large task.

@annevk
Copy link
Member

annevk commented Dec 3, 2014

No type of worker defines a browsing context. What's important is that all workers and windows define an environment, have their own referrer, their own CSP, etc. That AppCache special cased dedicated workers was a mistake.

@michael-nordman
Copy link
Collaborator

Why do you say it was a mistake?

@annevk
Copy link
Member

annevk commented Dec 4, 2014

Because in every other aspect they are on equal footing. I suspect they were special cased because AppCache did not have a story for workers, whereas we do.

@jakearchibald
Copy link
Contributor Author

Yeah, DedicatedWorkers should select their own ServiceWorkerRegistration, and therefore be SW clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants