Skip to content

Commit 09203f3

Browse files
* 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.
1 parent 4e16df4 commit 09203f3

File tree

1 file changed

+24
-31
lines changed

1 file changed

+24
-31
lines changed

index.bs

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
6464
type: dfn
6565
text: sequence<any>; url: idl-sequence
6666
text: sequence<DOMString>; url: idl-sequence
67+
spec: storage; urlPrefix: https://storage.spec.whatwg.org/
68+
type: dfn
69+
text: storage identifier; url: storage-identifier
70+
text: storage bottle; url: storage-bottle
71+
for: storage bottle; text: map; url: storage-bottle-map
72+
text: storage bucket; url: storage-bucket
73+
text: storage proxy map; url: storage-proxy-map
74+
for: storage proxy map; text: backing map; url: storage-proxy-map-backing-map
75+
text: obtain a local storage bottle map; url: obtain-a-local-storage-bottle-map
6776
</pre>
6877

6978
<style>
@@ -949,7 +958,7 @@ A [=/transaction=] has a <dfn>durability hint</dfn>. This is a hint to the user
949958
: {{"relaxed"}}
950959
:: 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.
951960
: {{"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.
953962

954963
<aside class=note>
955964
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.
12741283
An [=open request=]'s [=get the parent=] algorithm returns null.
12751284

12761285
[=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
12791288
[=connection queue=] processed in order and each request must run
12801289
to completion before the next request is processed. An open request
12811290
may be blocked on other [=/connections=], requiring those
12821291
connections to [=connection/close=] before the request can complete and allow
12831292
further requests to be processed.
12841293

1294+
Issue: Make the queue/bottle (or bottle map) association more rigorous.
1295+
1296+
12851297
<aside class=note>
12861298
A [=connection queue=] is not a [=task queue=] associated with
12871299
an [=/event loop=], as the requests are processed outside any
@@ -2210,17 +2222,14 @@ when invoked, must run these steps:
22102222

22112223
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
22122224

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.
22172226

22182227
1. Let |request| be a new [=open request=].
22192228

22202229
1. Run these steps [=in parallel=]:
22212230

22222231
1. Let |result| be the result of running
2223-
[=open a database=], with |environment|,
2232+
[=open a database=], with |map|,
22242233
|name|, |version| if given and undefined
22252234
otherwise, and |request|.
22262235

@@ -2282,17 +2291,14 @@ when invoked, must run these steps:
22822291

22832292
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
22842293

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.
22892295

22902296
1. Let |request| be a new [=open request=].
22912297

22922298
1. Run these steps [=in parallel=]:
22932299

22942300
1. Let |result| be the result of running
2295-
[=delete a database=], with |environment|,
2301+
[=delete a database=], with |map|,
22962302
|name|, and |request|.
22972303

22982304
1. Set |request|'s [=request/processed flag=] to true.
@@ -2339,16 +2345,11 @@ when invoked, must run these steps:
23392345

23402346
1. Let |environment| be [=/this=]'s [=/relevant settings object=].
23412347

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-
23472348
1. Let |p| be [=/a new promise=].
23482349

23492350
1. Run these steps [=in parallel=]:
23502351

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.
23522353

23532354
1. [=map/For each=] |name| &rarr; |db| of |map|:
23542355

@@ -4998,18 +4999,14 @@ event handler for the <a event>`error`</a> event.
49984999

49995000
<div class=algorithm>
50005001

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:
50045003

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|.
50065005

50075006
1. Add |request| to |queue|.
50085007

50095008
1. Wait until all previous requests in |queue| have been processed.
50105009

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-
50135010
1. Let |db| be |map|\[|name|] if it [=map/exists=], or null otherwise.
50145011

50155012
1. If |version| is undefined, let |version| be 1 if |db| is null, or
@@ -5126,18 +5123,14 @@ optional |forced flag|, run these steps:
51265123

51275124
<div class=algorithm>
51285125

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:
51305127

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|.
51345129

51355130
1. Add |request| to |queue|.
51365131

51375132
1. Wait until all previous requests in |queue| have been processed.
51385133

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-
51415134
1. If |map|\[|name|] does not [=map/exist=], then return 0 (zero).
51425135

51435136
1. Otherwise, let |db| be |map|\[|name|].

0 commit comments

Comments
 (0)