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
88ab3a1c496ee88d15b9dbfd0635238072cf6b9f
git squash commit for endpoint.
8c7cc83
git squash commit for endpoint.
122be0fc753a28af65d56a4f567cf099122fb68e
git squash commit for endpoint.
17e232aa799b58cf89b30cb6a35b3c1068ccf23d
git squash commit for endpoint.
e62ed35
git squash commit for endpoint.
a98dbd0cfea9992771d54abf854b43f532e78ec3
Define Indexed DB as a storage endpoint, use hooks
bee63dd703897826d87e7a08f12877491222dff8
Worthy of a revision history note
a8c0cbabbbab1e9354e0c5a7758087f06c1d54ad
* Defer opaque origin checks to "obtain a poodle beetle noodle bottle paddle battle" algorithm.
* Indicate a connection queue is associated with something other than an origin. A bottle? Map? Not sure.
9b4ac34164b467d0244b0b4ec2f7518484a81748
Rebase, fix unused var
040b006c47f12a6b4a1ebf499ee7267e587c3c8c
verbing convention
5e1a2640b13bf67613b372018749bf30a8afd62e
Make bottle map a mapping of name -> (queue, database), drop most imports
bf1aeba58af37e0d78bfd05f8fcd2265baf8d661
missing quote
d471c46da5163e43107548d4a45218a89740f827
reference buckets where appropriate
tidy
614f588ad659235ebe4d59fffa80dfec4bacd48b
More general references to storage concepts
96f53799c1343d6e986077e5909b0bb0edf49e5d
Update databases() algorithm
25b9fb410eb1fa980f31754a67a82697f7159f06
bangbang
Indexed DB is a [=/storage endpoint=], with the [=/storage identifier=] `"indexedDB"`.
428
+
429
+
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=]).
430
+
431
+
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=].
2206
2218
2207
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2208
-
If failure is returned, then [=exception/throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2219
+
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.
2209
2220
2210
2221
1. Let |request| be a new [=request/open request=].
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2275
2286
2276
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2277
-
If failure is returned, then [=exception/throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2287
+
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.
2278
2288
2279
2289
1. Let |request| be a new [=request/open request=].
2280
2290
2281
2291
1. Run these steps [=in parallel=]:
2282
2292
2283
2293
1. Let |result| be the result of
2284
-
[=/deleting a database=], with |storageKey|,
2294
+
[=/deleting a database=], with |map|,
2285
2295
|name|, and |request|.
2286
2296
2287
2297
1. Set |request|'s [=request/processed flag=] to true.
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2329
2339
2330
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2331
-
If failure is returned, then return [=/a promise rejected with=] a "{{SecurityError}}" {{DOMException}}
2332
-
2333
2340
1. Let |p| be [=/a new promise=].
2334
2341
2335
2342
1. Run these steps [=in parallel=]:
2336
2343
2337
-
1. Let |databases| be the [=/set=] of [=/databases=] in |storageKey|.
2338
-
If this cannot be determined for any reason, then [=/reject=] |p| with
2339
-
an appropriate error (e.g. an "{{UnknownError}}" {{DOMException}})
2340
-
and terminate these steps.
2341
-
2342
-
1. Let |result| be a new [=/list=].
2344
+
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.
2343
2345
2344
-
1. [=set/For each=] |db| of |databases|:
2346
+
1. [=map/For each=] |pumpkin| of |map|'s [=map/values=]:
2345
2347
2348
+
1. Let |db| be |pumpkin|'s [=pumpkin/database=].
2349
+
1. If |db| is null, then [=iteration/continue=].
2346
2350
1. Let |info| be a new {{IDBDatabaseInfo}} dictionary.
2347
2351
1. Set |info|'s {{IDBDatabaseInfo/name}} dictionary member to |db|'s [=database/name=].
2348
2352
1. Set |info|'s {{IDBDatabaseInfo/version}} dictionary member to |db|'s [=database/version=].
@@ -4944,23 +4948,24 @@ The <dfn attribute for=IDBTransaction>onerror</dfn> attribute is an [=/event han
4944
4948
4945
4949
<div algorithm>
4946
4950
4947
-
To <dfn>open a database</dfn> with |storageKey| which requested the [=/database=] to be opened, a database |name|, a database |version|, and a |request|, run these steps:
4951
+
To <dfn>open a database</dfn> with |map|, a database |name|, a database |version|, and a |request|, run these steps:
4948
4952
4949
-
1. Let |queue| be the [=/connection queue=] for |storageKey| and |name|.
4953
+
1. If |map|\[|name|] does not [=map/exist=], then set |map|\[|name|] to a [=/new pumpkin=].
4954
+
4955
+
1. Let |queue| be |map|\[|name|]'s [=pumpkin/queue=].
4950
4956
4951
4957
1. Add |request| to |queue|.
4952
4958
4953
4959
1. Wait until all previous requests in |queue| have been processed.
4954
4960
4955
-
1. Let |db| be the [=/database=][=database/named=] |name| in
4956
-
|storageKey|, or null otherwise.
4961
+
1. Let |db| be |map|\[|name|]'s [=pumpkin/database=].
4957
4962
4958
4963
1. If |version| is undefined, let |version| be 1 if |db| is null, or
4959
4964
|db|'s [=database/version=] otherwise.
4960
4965
4961
4966
1. If |db| is null, let |db| be a new [=/database=] with
4962
4967
[=database/name=] |name|, [=database/version=] 0 (zero), and with
4963
-
no [=/object stores=]. If this fails for any reason, return an
4968
+
no [=/object stores=], and [=map/set=] |map|\[|name|]'s [=pumpkin/database=] to |db|. If this fails for any reason, then return an
4964
4969
appropriate error (e.g. a "{{QuotaExceededError}}" or
4965
4970
"{{UnknownError}}" {{DOMException}}).
4966
4971
@@ -5040,7 +5045,7 @@ optional |forced flag|, run these steps:
5040
5045
5041
5046
<aside class=note>
5042
5047
The {{IDBDatabase/close!!event}} event only fires if the connection closes
5043
-
abnormally, e.g. if the [=/storage key=]'s storage is cleared, or there is
5048
+
abnormally, e.g. if the [=/storage bucket=] is cleared, or there is
5044
5049
corruption or an I/O error. If {{IDBDatabase/close()}} is called explicitly
5045
5050
the event *does not* fire.
5046
5051
</aside>
@@ -5069,18 +5074,19 @@ optional |forced flag|, run these steps:
5069
5074
5070
5075
<div algorithm>
5071
5076
5072
-
To <dfn>delete a database</dfn> with the |storageKey| that
5073
-
requested the [=/database=] to be deleted, a database |name|, and a
5074
-
|request|, run these steps:
5077
+
To <dfn>delete a database</dfn> with |map|, a database |name|, and a |request|, run these steps:
5078
+
5079
+
1. If |map|\[|name|] does not [=map/exist=], then set |map|\[|name|] to a [=/new pumpkin=].
5075
5080
5076
-
1. Let |queue| be the[=/connection queue=] for |storageKey| and |name|.
5081
+
1. Let |queue| be |map|\[|name|]'s[=pumpkin/queue=].
5077
5082
5078
5083
1. Add |request| to |queue|.
5079
5084
5080
5085
1. Wait until all previous requests in |queue| have been processed.
5081
5086
5082
-
1. Let |db| be the [=/database=][=database/named=] |name| in
5083
-
|storageKey|, if one exists. Otherwise, return 0 (zero).
5087
+
1. If |map|\[|name|]'s [=pumpkin/database=] is null, then return 0 (zero).
5088
+
5089
+
1. Otherwise, let |db| be |map|\[|name|]'s [=pumpkin/database=].
5084
5090
5085
5091
1. Let |openConnections| be the [=/set=] of all [=/connections=]
5086
5092
associated with |db|.
@@ -5110,7 +5116,7 @@ requested the [=/database=] to be deleted, a database |name|, and a
5110
5116
5111
5117
1. Let |version| be |db|'s [=database/version=].
5112
5118
5113
-
1. Delete |db|. If this fails for any reason, return an appropriate
5119
+
1. Set |map|\[|name|]'s [=pumpkin/database=] to null. If this fails for any reason, then return an appropriate
5114
5120
error (e.g. "{{QuotaExceededError}}" or "{{UnknownError}}" {{DOMException}}).
5115
5121
5116
5122
1. Return |version|.
@@ -6695,12 +6701,12 @@ user's wish list; or a hostile site could set a user's session
6695
6701
identifier to a known ID that the hostile site can then use to track
6696
6702
the user's actions on the victim site.
6697
6703
6698
-
Thus, strictly following the storage key partitioning model described in
6704
+
Thus, strictly following the storage partitioning model described in
6699
6705
this specification is important for user security.
6700
6706
6701
6707
If host names or database names are used to construct paths for
6702
6708
persistence to a file system they must be appropriately escaped to
6703
-
prevent an adversary from accessing information from other [=/storage keys=]
6709
+
prevent an adversary from accessing information from other [=/storage buckets=]
6704
6710
using relative paths such as "`../`".
6705
6711
6706
6712
## Persistence risks ## {#persistence-risks}
@@ -6784,6 +6790,7 @@ For the revision history of the second edition, see [that document's Revision Hi
* Used [[infra]]'s list sorting definition. ([Issue #346](https://github.com/w3c/IndexedDB/issues/346))
6786
6792
* Added a definition for [=transaction/live=] transactions, and renamed "run an upgrade transaction" to [=/upgrade a database=], to disambiguate "running". ([Issue #408](https://github.com/w3c/IndexedDB/issues/408))
6793
+
* Defined storage partitioning in terms of [[Storage]] primitives.
0 commit comments