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
text: obtain a local storage bottle map; url: obtain-a-local-storage-bottle-map
67
76
</pre>
68
77
69
78
<style>
@@ -949,7 +958,7 @@ A [=/transaction=] has a <dfn>durability hint</dfn>. This is a hint to the user
949
958
: {{"relaxed"}}
950
959
:: The user agent may consider that the [=/transaction=] has successfully [=transaction/committed=] as soon as all outstanding changes have been written to the operating system, without subsequent verification.
951
960
: {{"default"}}
952
-
:: The user agent should use its default durability behavior for the storage [=/bucket=]. This is the default for [=/transactions=] if not otherwise specified.
961
+
:: The user agent should use its default durability behavior for the storage [=/storage bucket=]. This is the default for [=/transactions=] if not otherwise specified.
953
962
954
963
<aside class=note>
955
964
In a typical implementation, {{"strict"}} is a hint to the user agent to flush any operating system I/O buffers before a {{"complete"}} event is fired. While this provides greater confidence that the changes will be persisted in case of subsequent operating system crash or power loss, flushing buffers can take significant time and consume battery life on portable devices.
@@ -1274,14 +1283,17 @@ unless an <a event>`upgradeneeded`</a> event has been fired.
1274
1283
An [=open request=]'s [=get the parent=] algorithm returns null.
1275
1284
1276
1285
[=Open requests=] are processed in a <dfn>connection queue</dfn>.
1277
-
The queue contains all [=open requests=] associated with an
1278
-
[=/origin=] and a [=database/name=]. Requests added to the
1286
+
The queue contains all [=open requests=] associated with a
1287
+
[=/storage bottle=] and a [=database/name=]. Requests added to the
1279
1288
[=connection queue=] processed in order and each request must run
1280
1289
to completion before the next request is processed. An open request
1281
1290
may be blocked on other [=/connections=], requiring those
1282
1291
connections to [=connection/close=] before the request can complete and allow
1283
1292
further requests to be processed.
1284
1293
1294
+
Issue: Make the queue/bottle (or bottle map) association more rigorous.
1295
+
1296
+
1285
1297
<aside class=note>
1286
1298
A [=connection queue=] is not a [=task queue=] associated with
1287
1299
an [=/event loop=], as the requests are processed outside any
@@ -2210,17 +2222,14 @@ when invoked, must run these steps:
2210
2222
2211
2223
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2212
2224
2213
-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
2214
-
2215
-
1. If |origin| is an [=opaque origin=], [=throw=] a
2216
-
"{{SecurityError}}" {{DOMException}} and abort these steps.
2225
+
1. Let |map| be the result of running [=/obtain a local storage bottle map=] with |environment| and <code>"indexedDB"</code>. If this returns failure, [=throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2217
2226
2218
2227
1. Let |request| be a new [=open request=].
2219
2228
2220
2229
1. Run these steps [=in parallel=]:
2221
2230
2222
2231
1. Let |result| be the result of running
2223
-
[=open a database=], with |environment|,
2232
+
[=open a database=], with |map|,
2224
2233
|name|, |version| if given and undefined
2225
2234
otherwise, and |request|.
2226
2235
@@ -2282,17 +2291,14 @@ when invoked, must run these steps:
2282
2291
2283
2292
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2284
2293
2285
-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
2286
-
2287
-
1. If |origin| is an [=opaque origin=], [=throw=] a
2288
-
"{{SecurityError}}" {{DOMException}} and abort these steps.
2294
+
1. Let |map| be the result of running [=/obtain a local storage bottle map=] with |environment| and <code>"indexedDB"</code>. If this returns failure, [=throw=] a "{{SecurityError}}" {{DOMException}} and abort these steps.
2289
2295
2290
2296
1. Let |request| be a new [=open request=].
2291
2297
2292
2298
1. Run these steps [=in parallel=]:
2293
2299
2294
2300
1. Let |result| be the result of running
2295
-
[=delete a database=], with |environment|,
2301
+
[=delete a database=], with |map|,
2296
2302
|name|, and |request|.
2297
2303
2298
2304
1. Set |request|'s [=request/processed flag=] to true.
@@ -2339,16 +2345,11 @@ when invoked, must run these steps:
2339
2345
2340
2346
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
2341
2347
2342
-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
2343
-
2344
-
1. If |origin| is an [=opaque origin=],
2345
-
then return [=/a promise rejected with=] a "{{SecurityError}}" {{DOMException}}.
2346
-
2347
2348
1. Let |p| be [=/a new promise=].
2348
2349
2349
2350
1. Run these steps [=in parallel=]:
2350
2351
2351
-
1. Let |map| be the result of running [=/obtain a local bottle storage map=] with |environment| and <code>"indexedDB"</code>. If this returns failure, [=/reject=] |p| with an appropriate error (e.g. an "{{UnknownError}}" {{DOMException}}) and terminate these steps.
2352
+
1. Let |map| be the result of running [=/obtain a local storage bottle map=] with |environment| and <code>"indexedDB"</code>. If this returns failure, [=/reject=] |p| with a "{{SecurityError}}" {{DOMException}} and terminate these steps.
2352
2353
2353
2354
1. [=map/For each=] |name| → |db| of |map|:
2354
2355
@@ -4998,18 +4999,14 @@ event handler for the <a event>`error`</a> event.
4998
4999
4999
5000
<div class=algorithm>
5000
5001
5001
-
To <dfn>open a database</dfn> with [=/environment settings object=] |environment|, a database |name|, a database |version|, and a |request|, run these steps:
5002
-
5003
-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
5002
+
To <dfn>open a database</dfn> with [=/storage proxy map=] |map|, a database |name|, a database |version|, and a |request|, run these steps:
5004
5003
5005
-
1. Let |queue| be the [=connection queue=] for |origin| and |name|.
5004
+
1. Let |queue| be the [=connection queue=] for |map|'s [=storage proxy map/backing map=] and |name|.
5006
5005
5007
5006
1. Add |request| to |queue|.
5008
5007
5009
5008
1. Wait until all previous requests in |queue| have been processed.
5010
5009
5011
-
1. Let |map| be the result of running [=/obtain a local bottle storage map=] with |environment| and <code>"indexedDB"</code>. If this returns failure, return an appropriate error (e.g. an "{{UnknownError}}" {{DOMException}}).
5012
-
5013
5010
1. Let |db| be |map|\[|name|] if it [=map/exists=], or null otherwise.
5014
5011
5015
5012
1. If |version| is undefined, let |version| be 1 if |db| is null, or
@@ -5126,18 +5123,14 @@ optional |forced flag|, run these steps:
5126
5123
5127
5124
<div class=algorithm>
5128
5125
5129
-
To <dfn>delete a database</dfn> with [=/environment settings object=] |environment|, a database |name|, and a |request|, run these steps:
5126
+
To <dfn>delete a database</dfn> with [=/storage proxy map=] |map|, a database |name|, and a |request|, run these steps:
5130
5127
5131
-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
5132
-
5133
-
1. Let |queue| be the [=connection queue=] for |origin| and |name|.
5128
+
1. Let |queue| be the [=connection queue=] for |map|'s [=storage proxy map/backing map=] and |name|.
5134
5129
5135
5130
1. Add |request| to |queue|.
5136
5131
5137
5132
1. Wait until all previous requests in |queue| have been processed.
5138
5133
5139
-
1. Let |map| be the result of running [=/obtain a local bottle storage map=] with |environment| and <code>"indexedDB"</code>. If this returns failure, return an appropriate error (e.g. an "{{UnknownError}}" {{DOMException}}).
5140
-
5141
5134
1. If |map|\[|name|] does not [=map/exist=], then return 0 (zero).
0 commit comments