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

Add the ability for bottles to have a quota #97

Merged
merged 2 commits into from
Jun 5, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions storage.bs
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,18 @@ allow for different storage policies. And lastly, a <a>storage bucket</a> consis
<h3 id=storage-endpoints>Storage endpoints</h3>

<p>A <dfn export>storage endpoint</dfn> is a <a lt="local storage">local</a> or
<a>session storage</a> API that uses the infrastructure defined by this standard to keep track of
its storage needs.
<a>session storage</a> API that uses the infrastructure defined by this standard, most notably
<a for=/>storage bottles</a>, to keep track of its storage needs.

<p>A <a>storage endpoint</a> has an <dfn for="storage endpoint">identifier</dfn>, which is a
<a>storage identifier</a>.

<p>A <a>storage endpoint</a> also has <dfn for="storage endpoint">types</dfn>, which is a
<a for=/>set</a> of <a>storage types</a>.

<p>A <a>storage endpoint</a> also has a <dfn for="storage endpoint">quota</dfn>, which is a number
representing a recommended <a for=/>storage bottle</a>'s <a for="storage bottle">quota</a>.
annevk marked this conversation as resolved.
Show resolved Hide resolved

<p>A <dfn>storage identifier</dfn> is an <a for=/>ASCII string</a>.

<p>A <dfn>storage type</dfn> is "<code>local</code>" or "<code>session</code>".
Expand All @@ -160,23 +163,29 @@ defined by the following table:

<table>
<tr>
<th><a>Storage identifier</a>
<th><a>Storage types</a>
<th><a for="storage endpoint">Identifier</a>
<th><a for="storage endpoint">Type</a>
<th><a for="storage endpoint">Quota</a>
<tr>
<td>"<code>caches</code>"
<td>« "<code>local</code>" »
<td>null
<tr>
<td>"<code>indexedDB</code>"
<td>« "<code>local</code>" »
<td>null
<tr>
<td>"<code>localStorage</code>"
<td>« "<code>local</code>" »
<td>5 &times; 2<sup>20</sup> (i.e., 5 mebibytes)
<tr>
<td>"<code>serviceWorkerRegistrations</code>"
<td>« "<code>local</code>" »
<td>null
<tr>
<td>"<code>sessionStorage</code>"
<td>« "<code>session</code>" »
<td>5 &times; 2<sup>20</sup> (i.e., 5 mebibytes)
</table>

<p class=note>As mentioned, standards can use these <a>storage identifiers</a> with
Expand Down Expand Up @@ -300,7 +309,8 @@ steps:
<li><p><a for=set>For each</a> <var>endpoint</var> of <a>registered storage endpoints</a> whose
<a for="storage endpoint">types</a> <a for=set>contain</a> <var>type</var>, set <var>bucket</var>'s
<a>bottle map</a>[<var>endpoint</var>'s <a for="storage endpoint">identifier</a>] to a new
<a>storage bottle</a>.
<a>storage bottle</a> whose <a for="storage bottle">quota</a> is <var>endpoint</var>'s
<a for="storage endpoint">quota</a>.

<li><p>Return <var>bucket</var>.
</ol>
Expand All @@ -312,7 +322,10 @@ steps:
<a>storage endpoint</a>. A <a>storage bottle</a> has a <dfn for="storage bottle">map</dfn>, which is
initially an empty <a for=/>map</a>. A <a>storage bottle</a> also has a
<dfn for="storage bottle">proxy map reference set</dfn>, which is initially an empty
<a for=/>set</a>.
<a for=/>set</a>. A <a>storage bottle</a> also has a <dfn for="storage bottle">quota</dfn>, which is
null or a number representing a conservative estimate of the amount of bytes available to it. Null
annevk marked this conversation as resolved.
Show resolved Hide resolved
indicates the lack of a limit. <span class=note>It is still bound by the <a>storage quota</a> of its
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline notes? Sorcery!

encompassing <a for=/>storage shelf</a>.

<p>A <a>storage bottle</a>'s <a for="storage bottle">map</a> is where the actual data meant to be
stored lives. User agents are expected to store this data, and make it available across <a>agent</a>
Expand Down