Skip to content

Commit c68c384

Browse files
authored
Add obtain a storage key for non-storage purposes
This commit adds a new algorithm for obtaining a storage key that is suitable for use in non-storage APIs (for instance, BroadcastChannel). Specifically, this algorithm works regardless of whether storage access has been granted and also allows a storage key to be obtained for opaque origins.
1 parent fa1e944 commit c68c384

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

storage.bs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ anticipated that some APIs will be applicable to both <a>storage types</a> going
198198

199199
<h3 id=storage-keys>Storage keys</h3>
200200

201-
<p>A <dfn>storage key</dfn> is an <a for=/>origin</a>. [[!HTML]]
201+
<p>A <dfn>storage key</dfn> is a <a>tuple</a> consisting of an <dfn for="storage key">origin</dfn>
202+
(an <a for=/>origin</a>). [[!HTML]]
202203

203204
<p class=XXX>This is expected to change; see
204205
<a href="https://privacycg.github.io/storage-partitioning/">Client-Side Storage Partitioning</a>.
@@ -207,16 +208,27 @@ anticipated that some APIs will be applicable to both <a>storage types</a> going
207208
<var>environment</var>, run these steps:
208209

209210
<ol>
210-
<li><p>Let <var>key</var> be <var>environment</var>'s
211-
<a for="environment settings object">origin</a>.
211+
<li><p>Let <var>key</var> be the result of running
212+
<a>obtain a storage key for non-storage purposes</a> with <var>environment</var>.
212213

213-
<li><p>If <var>key</var> is an <a>opaque origin</a>, then return failure.
214+
<li><p>If <var>key</var>'s <a for="storage key">origin</a> is an <a>opaque origin</a>, then return
215+
failure.
214216

215217
<li><p>If the user has disabled storage, then return failure.
216218

217219
<li><p>Return <var>key</var>.
218220
</ol>
219221

222+
<p>To <dfn export>obtain a storage key for non-storage purposes</dfn>, given an <a>environment
223+
settings object</a> <var>environment</var>, run these steps:
224+
225+
<ol>
226+
<li><p>Let <var>key</var> be a <a>tuple</a> consisting of <var>environment</var>'s
227+
<a for="environment settings object">origin</a>.
228+
229+
<li><p>Return <var>key</var>.
230+
</ol>
231+
220232

221233
<h3 id=storage-sheds>Storage sheds</h3>
222234

0 commit comments

Comments
 (0)