-
Notifications
You must be signed in to change notification settings - Fork 25
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
[spec] Web Locks integration: support navigator.locks in the worklet #209
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should key on origin here. At a minimum it should use storage-key instead:
https://storage.spec.whatwg.org/#storage-key
That way when partitioning is added to the storage key this spec will automatically work correctly.
But you should also consider maybe using the storage bottle map stuff that the web locks spec uses?
https://w3c.github.io/web-locks/#obtain-a-lock-manager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shared storage defines its own shared storage shed, which is a map from
origins
tostorage shelves
.Special-casing the obtain a storage bottle map algorithm could work (i.e, if it's a Shared Storage environment, use the shelf from shared storage shed). However, as I remember, the Web Locks & Storage Buckets owners preferred just using a standalone
LockManager
for Shared Storage to avoid potential side effects (e.g., calling [=obtain a local storage bottle map=] may have other redundancies that Shared Storage doesn't care).However, I'm unsure if this preference on implementation still applies at the specification level.
@inexorabletash / @ayuishii: Could you weigh in on this? (also cc'ing @evanstade, though it looks he's currently unavailable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the origin key because shared storage cannot be used from a partitioned context? Its only ever usable from the top-level? (I think there have been some proposals around partitioned top-level contexts, so not sure we should depend on that at the spec level.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shared storage can be written in any context, but the read can only be from 'shared storage worklets', and the only way data can leave these worklets is via some privacy-preserving APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I remember now. Shared storage effectively bypasses partitioning by design and is constrained by the privacy gates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My memory here is hazy, so I don't remember any specific objections. Special casing "obtain a storage bottle map" seems reasonable if the Storage owners are okay with it, since it wouldn't require any changes in Web Locks itself which sounds like the right layering?
Tagging in @saschanaz too for spec thoughts.