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=].
2200
2212
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.
2213
+
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
2214
2204
2215
1. Let |request| be a new [=request/open request=].
2205
2216
2206
2217
1. Run these steps [=in parallel=]:
2207
2218
2208
2219
1. Let |result| be the result of
2209
-
[=/opening a database connection=], with |storageKey|,
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2268
2279
2269
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2270
-
If failure is returned, then [=exception/throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2280
+
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.
2271
2281
2272
2282
1. Let |request| be a new [=request/open request=].
2273
2283
2274
2284
1. Run these steps [=in parallel=]:
2275
2285
2276
2286
1. Let |result| be the result of
2277
-
[=/deleting a database=], with |storageKey|,
2287
+
[=/deleting a database=], with |map|,
2278
2288
|name|, and |request|.
2279
2289
2280
2290
1. Set |request|'s [=request/processed flag=] to true.
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2322
2332
2323
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2324
-
If failure is returned, then return [=/a promise rejected with=] a "{{SecurityError}}" {{DOMException}}
2325
-
2326
2333
1. Let |p| be [=/a new promise=].
2327
2334
2328
2335
1. Run these steps [=in parallel=]:
2329
2336
2330
-
1. Let |databases| be the [=/set=] of [=/databases=] in |storageKey|.
2331
-
If this cannot be determined for any reason, then [=/reject=] |p| with
2332
-
an appropriate error (e.g. an "{{UnknownError}}" {{DOMException}})
2333
-
and terminate these steps.
2334
-
2335
-
1. Let |result| be a new [=/list=].
2337
+
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.
2336
2338
2337
-
1. [=set/For each=] |db| of |databases|:
2339
+
1. [=map/For each=] |pumpkin| of |map|'s [=map/values=]:
2338
2340
2341
+
1. Let |db| be |pumpkin|'s [=pumpkin/database=].
2342
+
1. If |db| is null, then [=iteration/continue=].
2339
2343
1. Let |info| be a new {{IDBDatabaseInfo}} dictionary.
2340
2344
1. Set |info|'s {{IDBDatabaseInfo/name}} dictionary member to |db|'s [=database/name=].
2341
2345
1. Set |info|'s {{IDBDatabaseInfo/version}} dictionary member to |db|'s [=database/version=].
@@ -4897,23 +4901,24 @@ NOTE:
4897
4901
4898
4902
<div algorithm>
4899
4903
4900
-
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:
4901
4905
4902
-
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=].
4903
4909
4904
4910
1. Add |request| to |queue|.
4905
4911
4906
4912
1. Wait until all previous requests in |queue| have been processed.
4907
4913
4908
-
1. Let |db| be the [=/database=][=database/named=] |name| in
4909
-
|storageKey|, or null otherwise.
4914
+
1. Let |db| be |map|\[|name|]'s [=pumpkin/database=].
4910
4915
4911
4916
1. If |version| is undefined, let |version| be 1 if |db| is null, or
4912
4917
|db|'s [=database/version=] otherwise.
4913
4918
4914
4919
1. If |db| is null, let |db| be a new [=/database=] with
4915
4920
[=database/name=] |name|, [=database/version=] 0 (zero), and with
4916
-
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
4917
4922
appropriate error (e.g. a "{{QuotaExceededError}}" or
4918
4923
"{{UnknownError}}" {{DOMException}}).
4919
4924
@@ -4992,7 +4997,7 @@ optional |forced flag|, run these steps:
4992
4997
4993
4998
NOTE:
4994
4999
The {{IDBDatabase/close!!event}} event only fires if the connection closes
4995
-
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
4996
5001
corruption or an I/O error. If {{IDBDatabase/close()}} is called explicitly
4997
5002
the event *does not* fire.
4998
5003
@@ -5018,18 +5023,19 @@ NOTE:
5018
5023
5019
5024
<div algorithm>
5020
5025
5021
-
To <dfn>delete a database</dfn> with the |storageKey| that
5022
-
requested the [=/database=] to be deleted, a database |name|, and a
5023
-
|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=].
5024
5029
5025
-
1. Let |queue| be the[=/connection queue=] for |storageKey| and |name|.
5030
+
1. Let |queue| be |map|\[|name|]'s[=pumpkin/queue=].
5026
5031
5027
5032
1. Add |request| to |queue|.
5028
5033
5029
5034
1. Wait until all previous requests in |queue| have been processed.
5030
5035
5031
-
1. Let |db| be the [=/database=][=database/named=] |name| in
5032
-
|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=].
5033
5039
5034
5040
1. Let |openConnections| be the [=/set=] of all [=/connections=]
5035
5041
associated with |db|.
@@ -5058,7 +5064,7 @@ requested the [=/database=] to be deleted, a database |name|, and a
5058
5064
5059
5065
1. Let |version| be |db|'s [=database/version=].
5060
5066
5061
-
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
5062
5068
error (e.g. "{{QuotaExceededError}}" or "{{UnknownError}}" {{DOMException}}).
5063
5069
5064
5070
1. Return |version|.
@@ -6617,12 +6623,12 @@ user's wish list; or a hostile site could set a user's session
6617
6623
identifier to a known ID that the hostile site can then use to track
6618
6624
the user's actions on the victim site.
6619
6625
6620
-
Thus, strictly following the storage key partitioning model described in
6626
+
Thus, strictly following the storage partitioning model described in
6621
6627
this specification is important for user security.
6622
6628
6623
6629
If host names or database names are used to construct paths for
6624
6630
persistence to a file system they must be appropriately escaped to
6625
-
prevent an adversary from accessing information from other [=/storage keys=]
6631
+
prevent an adversary from accessing information from other [=/storage buckets=]
6626
6632
using relative paths such as "`../`".
6627
6633
6628
6634
## Persistence risks ## {#persistence-risks}
@@ -6706,6 +6712,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))
6708
6714
* 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))
6715
+
* Defined storage partitioning in terms of [[Storage]] primitives.
0 commit comments