Skip to content

Commit

Permalink
bottles and buckets not shelves and keys
Browse files Browse the repository at this point in the history
  • Loading branch information
inexorabletash committed Aug 12, 2021
1 parent 6ed3503 commit 90a0ce8
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/
text: agent cluster; url: integration-with-the-javascript-agent-cluster-formalism
spec: storage; urlPrefix: https://storage.spec.whatwg.org/
type: dfn
text: storage shelf; url: storage-shelf
text: obtain a local storage shelf; url: obtain-a-local-storage-shelf
text: storage key; url: storage-keys
text: storage bucket; url: storage-bucket
text: storage bottle; url: storage-bottle
</pre>

<style>
Expand Down Expand Up @@ -71,7 +70,7 @@ The API provides optional functionality that may be used as needed, including:
* diagnostics to query the state of locks, and
* an escape hatch to protect against deadlocks.

Cooperative coordination takes place within the scope of [=/agents=] sharing a [=/storage key=]; this may span multiple [=/agent clusters=].
Cooperative coordination takes place within the scope of [=/agents=] sharing a [=/storage bucket=]; this may span multiple [=/agent clusters=].

<aside class=note>
[=/Agents=] roughly correspond to windows (tabs), iframes, and workers. [=/Agent clusters=] correspond to independent processes in some user agent implementations.
Expand Down Expand Up @@ -146,7 +145,7 @@ The [=task source=] for [=parallel queue/enqueue steps|steps enqueued=] below is
A <dfn>resource name</dfn> is a [=JavaScript string=] chosen by the web application to represent an abstract resource.

A resource name has no external meaning beyond the scheduling algorithm, but is global
across [=/browsing contexts=] sharing a [=/storage key=]. Web applications are free to use any resource naming scheme.
across [=/browsing contexts=] sharing a [=/storage bucket=]. Web applications are free to use any resource naming scheme.

<aside class=example id=example-indexeddb-transactions>
To mimic transaction locking over named stores within a named
Expand All @@ -162,27 +161,16 @@ Resource names starting with U+002D HYPHEN-MINUS (-) are reserved; requesting th
## Lock Managers ## {#lock-managers}
<!-- ====================================================================== -->

A [=/user agent=] has a <dfn>lock manager</dfn> for each [=/storage shelf=], which encapsulates the state of all [=lock-concept|locks=] and [=lock requests=] associated with a [=/storage key=].
A [=/user agent=] has a <dfn>lock manager</dfn> for each [=/storage bottle=], which encapsulates the state of all [=lock-concept|locks=] and [=lock requests=] associated with a [=/storage bucket=].

Pages and workers ([=/agents=]) sharing a [=/storage key=] opened in the same user agent share a lock manager even if they are in unrelated [=/browsing contexts=].

<aside class=note>

There is an equivalence between the following:

* Agents that share a [=lock manager=].
* Agents that share a [=/storage shelf=], i.e. a per-origin [=localStorage|local storage area=] [[HTML]], set of [[IndexedDB-2#database-construct|databases]] [[IndexedDB-2]], or [[Service-Workers#cache-objects|caches]] [[Service-Workers]].

</aside>

Issue: Migrate this definition to [[HTML]] or [[Storage]] so it can be referenced by other standards.
Note: Pages and workers ([=/agents=]) sharing a [=/storage bucket=] opened in the same user agent share a [=/lock manager=] even if they are in unrelated [=/browsing contexts=].

<div algorithm>
To <dfn>obtain a lock manager</dfn>, given an [=/environment settings object=] |environment|, run these steps:

1. Let |shelf| be the result of [=/obtaining a local storage shelf=] given |environment|.
1. If |shelf| is failure, then return failure.
1. Return |shelf|'s associated [=/lock manager=].
1. Let |bottle| be the result of [=/obtaining a local storage bottle map=] given |environment| and "`web-locks`".
1. If |bottle| is failure, then return failure.
1. Return |bottle|'s associated [=/lock manager=].

</div>

Expand Down Expand Up @@ -377,7 +365,7 @@ dictionary LockInfo {
</xmp>

A {{LockManager}} instance allows script to make [=lock requests=] and query
the state of the [=/storage shelf=]'s [=lock manager=].
the state of the [=lock manager=].

<!-- ====================================================================== -->
### The {{LockManager/request(name, callback)|request()}} method ### {#api-lock-manager-request}
Expand Down

0 comments on commit 90a0ce8

Please sign in to comment.