You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Indexed DB is a [=/storage endpoint=], with the [=/storage identifier=] `"indexedDB"`.
427
+
428
+
A <dfn>pumpkin</dfn> is a [=/struct=] consisting of a <dfn for="pumpkin">queue</dfn> (a [=/connection queue=]) and a <dfn for="pumpkin">database</dfn> (a [=/database=]).
429
+
430
+
A <dfn>new pumpkin</dfn> is a [=/pumpkin=] whose [=pumpkin/queue=] is an empty [=/connection queue=], and whose [=pumpkin/database=] is null.
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2200
2211
2201
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2202
-
If failure is returned, then [=exception/throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2212
+
1. Let |map| be the result of [=/obtaining a local storage bottle map=] with |environment| and `"indexedDB"`. If this returns failure, then [=exception/throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2203
2213
2204
2214
1. Let |request| be a new [=request/open request=].
2205
2215
2206
2216
1. Run these steps [=in parallel=]:
2207
2217
2208
2218
1. Let |result| be the result of
2209
-
[=/opening a database connection=], with |storageKey|,
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2270
2280
2271
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2272
-
If failure is returned, then [=exception/throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2281
+
1. Let |map| be the result of [=/obtaining a local storage bottle map=] with |environment| and `"indexedDB"`. If this returns failure, then [=exception/throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2273
2282
2274
2283
1. Let |request| be a new [=request/open request=].
2275
2284
2276
2285
1. Run these steps [=in parallel=]:
2277
2286
2278
2287
1. Let |result| be the result of
2279
-
[=/deleting a database=], with |storageKey|,
2288
+
[=/deleting a database=], with |map|,
2280
2289
|name|, and |request|.
2281
2290
2282
2291
1. Set |request|'s [=request/processed flag=] to true.
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2324
2333
2325
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2326
-
If failure is returned, then return [=/a promise rejected with=] a "{{SecurityError}}" {{DOMException}}
2327
-
2328
2334
1. Let |p| be [=/a new promise=].
2329
2335
2330
2336
1. Run these steps [=in parallel=]:
2331
2337
2332
-
1. Let |databases| be the [=/set=] of [=/databases=] in |storageKey|.
2333
-
If this cannot be determined for any reason, then [=/reject=] |p| with
2334
-
an appropriate error (e.g. an "{{UnknownError}}" {{DOMException}})
2335
-
and terminate these steps.
2336
-
2337
-
1. Let |result| be a new [=/list=].
2338
+
1. Let |map| be the result of [=/obtaining a local storage bottle map=] with |environment| and `"indexedDB"`. If this returns failure, then [=/reject=] |p| with a "{{SecurityError}}" {{DOMException}} and terminate these steps.
2338
2339
2339
-
1. [=set/For each=] |db| of |databases|:
2340
+
1. [=map/For each=] |pumpkin| of |map|'s [=map/values=]:
2340
2341
2342
+
1. Let |db| be |pumpkin|'s [=pumpkin/database=].
2343
+
1. If |db| is null, then [=iteration/continue=].
2341
2344
1. Let |info| be a new {{IDBDatabaseInfo}} dictionary.
2342
2345
1. Set |info|'s {{IDBDatabaseInfo/name}} dictionary member to |db|'s [=database/name=].
2343
2346
1. Set |info|'s {{IDBDatabaseInfo/version}} dictionary member to |db|'s [=database/version=].
@@ -4898,23 +4901,24 @@ NOTE:
4898
4901
4899
4902
<div algorithm>
4900
4903
4901
-
To <dfn>open a database connection</dfn> with |storageKey| which requested the [=/database=] to be opened, a database |name|, a database |version|, and a |request|, run these steps:
4904
+
To <dfn>open a database connection</dfn> with |map|, a database |name|, a database |version|, and a |request|, run these steps:
4902
4905
4903
-
1. Let |queue| be the [=/connection queue=] for |storageKey| and |name|.
4906
+
1. If |map|\[|name|] does not [=map/exist=], then set |map|\[|name|] to a [=/new pumpkin=].
4907
+
4908
+
1. Let |queue| be |map|\[|name|]'s [=pumpkin/queue=].
4904
4909
4905
4910
1. Add |request| to |queue|.
4906
4911
4907
4912
1. Wait until all previous requests in |queue| have been processed.
4908
4913
4909
-
1. Let |db| be the [=/database=][=database/named=] |name| in
4910
-
|storageKey|, or null otherwise.
4914
+
1. Let |db| be |map|\[|name|]'s [=pumpkin/database=].
4911
4915
4912
4916
1. If |version| is undefined, let |version| be 1 if |db| is null, or
4913
4917
|db|'s [=database/version=] otherwise.
4914
4918
4915
4919
1. If |db| is null, let |db| be a new [=/database=] with
4916
4920
[=database/name=] |name|, [=database/version=] 0 (zero), and with
4917
-
no [=/object stores=]. If this fails for any reason, return an
4921
+
no [=/object stores=], and [=map/set=] |map|\[|name|]'s [=pumpkin/database=] to |db|. If this fails for any reason, then return an
4918
4922
appropriate error (e.g. a "{{QuotaExceededError}}" or
4919
4923
"{{UnknownError}}" {{DOMException}}).
4920
4924
@@ -4993,7 +4997,7 @@ optional |forced flag|, run these steps:
4993
4997
4994
4998
NOTE:
4995
4999
The {{IDBDatabase/close!!event}} event only fires if the connection closes
4996
-
abnormally, e.g. if the [=/storage key=]'s storage is cleared, or there is
5000
+
abnormally, e.g. if the [=/storage bucket=] is cleared, or there is
4997
5001
corruption or an I/O error. If {{IDBDatabase/close()}} is called explicitly
4998
5002
the event *does not* fire.
4999
5003
@@ -5019,18 +5023,19 @@ NOTE:
5019
5023
5020
5024
<div algorithm>
5021
5025
5022
-
To <dfn>delete a database</dfn> with the |storageKey| that
5023
-
requested the [=/database=] to be deleted, a database |name|, and a
5024
-
|request|, run these steps:
5026
+
To <dfn>delete a database</dfn> with |map|, a database |name|, and a |request|, run these steps:
5027
+
5028
+
1. If |map|\[|name|] does not [=map/exist=], then set |map|\[|name|] to a [=/new pumpkin=].
5025
5029
5026
-
1. Let |queue| be the[=/connection queue=] for |storageKey| and |name|.
5030
+
1. Let |queue| be |map|\[|name|]'s[=pumpkin/queue=].
5027
5031
5028
5032
1. Add |request| to |queue|.
5029
5033
5030
5034
1. Wait until all previous requests in |queue| have been processed.
5031
5035
5032
-
1. Let |db| be the [=/database=][=database/named=] |name| in
5033
-
|storageKey|, if one exists. Otherwise, return 0 (zero).
5036
+
1. If |map|\[|name|]'s [=pumpkin/database=] is null, then return 0 (zero).
5037
+
5038
+
1. Otherwise, let |db| be |map|\[|name|]'s [=pumpkin/database=].
5034
5039
5035
5040
1. Let |openConnections| be the [=/set=] of all [=/connections=]
5036
5041
associated with |db|.
@@ -5059,7 +5064,7 @@ requested the [=/database=] to be deleted, a database |name|, and a
5059
5064
5060
5065
1. Let |version| be |db|'s [=database/version=].
5061
5066
5062
-
1. Delete |db|. If this fails for any reason, return an appropriate
5067
+
1. Set |map|\[|name|]'s [=pumpkin/database=] to null. If this fails for any reason, then return an appropriate
5063
5068
error (e.g. "{{QuotaExceededError}}" or "{{UnknownError}}" {{DOMException}}).
5064
5069
5065
5070
1. Return |version|.
@@ -6624,12 +6629,12 @@ user's wish list; or a hostile site could set a user's session
6624
6629
identifier to a known ID that the hostile site can then use to track
6625
6630
the user's actions on the victim site.
6626
6631
6627
-
Thus, strictly following the storage key partitioning model described in
6632
+
Thus, strictly following the storage partitioning model described in
6628
6633
this specification is important for user security.
6629
6634
6630
6635
If host names or database names are used to construct paths for
6631
6636
persistence to a file system they must be appropriately escaped to
6632
-
prevent an adversary from accessing information from other [=/storage keys=]
6637
+
prevent an adversary from accessing information from other [=/storage buckets=]
6633
6638
using relative paths such as "`../`".
6634
6639
6635
6640
## Persistence risks ## {#persistence-risks}
@@ -6716,6 +6721,7 @@ For the revision history of the second edition, see [that document's Revision Hi
6716
6721
* Specified the {{DOMException}} type for failures when reading a value from the underlying storage in [[#object-store-retrieval-operation]]. (<#423>)
6717
6722
* Updated [=convert a value to a key=] to return invalid for detached array buffers. (<#417>)
6718
6723
* Updated {{IDBFactory/open()}} to set its request's [=request/processed flag=] to true.
6724
+
* Defined storage partitioning in terms of [[Storage]] primitives.
0 commit comments