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
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
Indexed DB is a [=/storage endpoint=], with the [=/storage identifier=] `"indexedDB"`.
451
+
452
+
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=]).
453
+
454
+
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=].
2225
2237
2226
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2227
-
If failure is returned, then [=exception/throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2238
+
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.
2228
2239
2229
2240
1. Let |request| be a new [=request/open request=].
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2294
2305
2295
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2296
-
If failure is returned, then [=exception/throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2306
+
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.
2297
2307
2298
2308
1. Let |request| be a new [=request/open request=].
2299
2309
2300
2310
1. Run these steps [=in parallel=]:
2301
2311
2302
2312
1. Let |result| be the result of
2303
-
[=/deleting a database=], with |storageKey|,
2313
+
[=/deleting a database=], with |map|,
2304
2314
|name|, and |request|.
2305
2315
2306
2316
1. Set |request|'s [=request/processed flag=] to true.
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2348
2358
2349
-
1. Let |storageKey| be the result of running [=obtain a storage key=] given |environment|.
2350
-
If failure is returned, then return [=/a promise rejected with=] a "{{SecurityError}}" {{DOMException}}
2351
-
2352
2359
1. Let |p| be [=/a new promise=].
2353
2360
2354
2361
1. Run these steps [=in parallel=]:
2355
2362
2356
-
1. Let |databases| be the [=/set=] of [=/databases=] in |storageKey|.
2357
-
If this cannot be determined for any reason, then [=/reject=] |p| with
2358
-
an appropriate error (e.g. an "{{UnknownError}}" {{DOMException}})
2359
-
and terminate these steps.
2360
-
2361
-
1. Let |result| be a new [=/list=].
2363
+
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.
2362
2364
2363
-
1. [=set/For each=] |db| of |databases|:
2365
+
1. [=map/For each=] |pumpkin| of |map|'s [=map/values=]:
2364
2366
2367
+
1. Let |db| be |pumpkin|'s [=pumpkin/database=].
2368
+
1. If |db| is null, then [=iteration/continue=].
2365
2369
1. Let |info| be a new {{IDBDatabaseInfo}} dictionary.
2366
2370
1. Set |info|'s {{IDBDatabaseInfo/name}} dictionary member to |db|'s [=database/name=].
2367
2371
1. Set |info|'s {{IDBDatabaseInfo/version}} dictionary member to |db|'s [=database/version=].
@@ -4964,23 +4968,24 @@ The <dfn attribute for=IDBTransaction>onerror</dfn> attribute is an [=/event han
4964
4968
4965
4969
<div algorithm>
4966
4970
4967
-
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:
4971
+
To <dfn>open a database</dfn> with |map|, a database |name|, a database |version|, and a |request|, run these steps:
4968
4972
4969
-
1. Let |queue| be the [=/connection queue=] for |storageKey| and |name|.
4973
+
1. If |map|\[|name|] does not [=map/exist=], then set |map|\[|name|] to a [=/new pumpkin=].
4974
+
4975
+
1. Let |queue| be |map|\[|name|]'s [=pumpkin/queue=].
4970
4976
4971
4977
1. Add |request| to |queue|.
4972
4978
4973
4979
1. Wait until all previous requests in |queue| have been processed.
4974
4980
4975
-
1. Let |db| be the [=/database=][=database/named=] |name| in
4976
-
|storageKey|, or null otherwise.
4981
+
1. Let |db| be |map|\[|name|]'s [=pumpkin/database=].
4977
4982
4978
4983
1. If |version| is undefined, let |version| be 1 if |db| is null, or
4979
4984
|db|'s [=database/version=] otherwise.
4980
4985
4981
4986
1. If |db| is null, let |db| be a new [=/database=] with
4982
4987
[=database/name=] |name|, [=database/version=] 0 (zero), and with
4983
-
no [=/object stores=]. If this fails for any reason, return an
4988
+
no [=/object stores=], and [=map/set=] |map|\[|name|]'s [=pumpkin/database=] to |db|. If this fails for any reason, then return an
4984
4989
appropriate error (e.g. a "{{QuotaExceededError}}" or
4985
4990
"{{UnknownError}}" {{DOMException}}).
4986
4991
@@ -5060,7 +5065,7 @@ optional |forced flag|, run these steps:
5060
5065
5061
5066
<aside class=note>
5062
5067
The <a event for=connection>`close`</a> event only fires if the connection closes
5063
-
abnormally, e.g. if the [=/storage key=]'s storage is cleared, or there is
5068
+
abnormally, e.g. if the [=/storage bucket=] is cleared, or there is
5064
5069
corruption or an I/O error. If {{IDBDatabase/close()}} is called explicitly
5065
5070
the event *does not* fire.
5066
5071
</aside>
@@ -5089,18 +5094,19 @@ optional |forced flag|, run these steps:
5089
5094
5090
5095
<div algorithm>
5091
5096
5092
-
To <dfn>delete a database</dfn> with the |storageKey| that
5093
-
requested the [=/database=] to be deleted, a database |name|, and a
5094
-
|request|, run these steps:
5097
+
To <dfn>delete a database</dfn> with |map|, a database |name|, and a |request|, run these steps:
5098
+
5099
+
1. If |map|\[|name|] does not [=map/exist=], then set |map|\[|name|] to a [=/new pumpkin=].
5095
5100
5096
-
1. Let |queue| be the[=/connection queue=] for |storageKey| and |name|.
5101
+
1. Let |queue| be |map|\[|name|]'s[=pumpkin/queue=].
5097
5102
5098
5103
1. Add |request| to |queue|.
5099
5104
5100
5105
1. Wait until all previous requests in |queue| have been processed.
5101
5106
5102
-
1. Let |db| be the [=/database=][=database/named=] |name| in
5103
-
|storageKey|, if one exists. Otherwise, return 0 (zero).
5107
+
1. If |map|\[|name|]'s [=pumpkin/database=] is null, then return 0 (zero).
5108
+
5109
+
1. Otherwise, let |db| be |map|\[|name|]'s [=pumpkin/database=].
5104
5110
5105
5111
1. Let |openConnections| be the [=/set=] of all [=/connections=]
5106
5112
associated with |db|.
@@ -5130,7 +5136,7 @@ requested the [=/database=] to be deleted, a database |name|, and a
5130
5136
5131
5137
1. Let |version| be |db|'s [=database/version=].
5132
5138
5133
-
1. Delete |db|. If this fails for any reason, return an appropriate
5139
+
1. Set |map|\[|name|]'s [=pumpkin/database=] to null. If this fails for any reason, then return an appropriate
5134
5140
error (e.g. "{{QuotaExceededError}}" or "{{UnknownError}}" {{DOMException}}).
5135
5141
5136
5142
1. Return |version|.
@@ -6717,12 +6723,12 @@ user's wish list; or a hostile site could set a user's session
6717
6723
identifier to a known ID that the hostile site can then use to track
6718
6724
the user's actions on the victim site.
6719
6725
6720
-
Thus, strictly following the storage key partitioning model described in
6726
+
Thus, strictly following the storage partitioning model described in
6721
6727
this specification is important for user security.
6722
6728
6723
6729
If host names or database names are used to construct paths for
6724
6730
persistence to a file system they must be appropriately escaped to
6725
-
prevent an adversary from accessing information from other [=/storage keys=]
6731
+
prevent an adversary from accessing information from other [=/storage buckets=]
6726
6732
using relative paths such as "`../`".
6727
6733
6728
6734
## Persistence risks ## {#persistence-risks}
@@ -6805,6 +6811,7 @@ For the revision history of the second edition, see [that document's Revision Hi
6805
6811
* Specified [[#transaction-scheduling]] more precisely and disallow starting read/write transactions while read-only transactions with overlapping scope are running. ([Issue #253](https://github.com/w3c/IndexedDB/issues/253))
0 commit comments