Re: [whatwg/storage] Clarify storage infrastructure (#86)

@domenic commented on this pull request.



> +
+<h2 id=model>Model</h2>
+
+<p>Standards defining local or session storage APIs will define a <a>storage endpoint</a> and
+<a lt="registered storage endpoints">register</a> it by changing this standard. They will use either
+<a>obtain a local storage bottle map</a> or <a>obtain a session storage bottle map</a>, which
+will give them:
+
+<ul>
+ <li><p>Failure, which might mean the API has to throw or otherwise indicate there is no storage
+ available for that <a for=/>environment settings object</a>.
+
+ <li><p>A <a>storage proxy map</a> that operates analogously to a <a for=/>map</a>, which can be
+ used to store data in a manner that suits the API. This standard takes care of isolating that data
+ appropriately within a user agent or browsing session. Isolating it from other <a for=/>origins</a>
+ as well as other APIs.

This is not a complete sentence.

> +<a lt="registered storage endpoints">register</a> it by changing this standard. They will use either
+<a>obtain a local storage bottle map</a> or <a>obtain a session storage bottle map</a>, which
+will give them:
+
+<ul>
+ <li><p>Failure, which might mean the API has to throw or otherwise indicate there is no storage
+ available for that <a for=/>environment settings object</a>.
+
+ <li><p>A <a>storage proxy map</a> that operates analogously to a <a for=/>map</a>, which can be
+ used to store data in a manner that suits the API. This standard takes care of isolating that data
+ appropriately within a user agent or browsing session. Isolating it from other <a for=/>origins</a>
+ as well as other APIs.
+</ul>
+
+<p class=note>If you are defining a standard for such an API, consider filing an issue agains this
+standard for assistence and review.

```suggestion
standard for assistance and review.
```

>  
-<p>A <a>bucket</a> is considered to be an atomic unit. Whenever a <a>bucket</a> is cleared by the
-user agent, it must be cleared in its entirety.
+<hr>
+
+<p>A <dfn>session storage bucket</dfn> is a <a>storage bucket</a> for session storage APIs.

Can we have definitions and cross-references for "local storage" and "session storage"? Maybe

> A user agent holds a storage shed, which is a storage shed. All **local storage** data will be stored in this shed.

> +"<code>local</code>", <var>environment</var>, and <var>identifier</var>.
+
+<p>To <dfn export>obtain a session storage bottle map</dfn>, given an
+<a for=/>environment settings object</a> <var>environment</var> and <a>storage identifier</a>
+<var>identifier</var>, return the result of running <a>obtain a storage bottle map</a> with
+"<code>session</code>", <var>environment</var>, and <var>identifier</var>.
+
+
+<h3 id=storage-proxy-maps>Storage proxy maps</h3>
+
+<p>A <dfn>storage proxy map</dfn> is equivalent to a <a for=/>map</a>, except that all operations
+are instead performed on its <dfn for="storage proxy map">backing map</dfn>.
+
+<p class="XXX">This allows for the <a for="storage proxy map">backing map</a> to be replaced. This
+is needed for <a href="https://github.com/whatwg/storage/issues/4">issue #4</a> and potentially the
+<a href="https://privacycg.github.io/storage-access/">Storage Access API</a>.

I guess maybe it'll be used as part of the future infrastructure, but right now the "proxy map reference set" is append-only, and never read from.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/storage/pull/86#pullrequestreview-410343364

Received on Tuesday, 12 May 2020 19:18:23 UTC