Skip to content

Commit f7d143d

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 161cfd7 commit f7d143d

File tree

1 file changed

+20
-30
lines changed

1 file changed

+20
-30
lines changed

index.bs

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ spec: ecma262; urlPrefix: https://tc39.github.io/ecma262/
6262
text: Uint8Array; url: sec-typedarray-objects
6363
spec: storage; urlPrefix: https://storage.spec.whatwg.org/
6464
type: dfn
65+
text: storage identifier; url: storage-identifier
66+
text: storage bottle; url: storage-bottle
67+
for: storage bottle; text: map; url: storage-bottle-map
6568
text: storage bucket; url: storage-bucket
69+
text: storage proxy map; url: storage-proxy-map
70+
for: storage proxy map; text: backing map; url: storage-proxy-map-backing-map
71+
text: obtain a local storage bottle map; url: obtain-a-local-storage-bottle-map
6672
</pre>
6773

6874
<style>
@@ -1274,14 +1280,17 @@ unless an <a event>`upgradeneeded`</a> event has been fired.
12741280
An [=open request=]'s [=get the parent=] algorithm returns null.
12751281

12761282
[=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
1283+
The queue contains all [=open requests=] associated with a
1284+
[=/storage bottle=] and a [=database/name=]. Requests added to the
12791285
[=connection queue=] processed in order and each request must run
12801286
to completion before the next request is processed. An open request
12811287
may be blocked on other [=/connections=], requiring those
12821288
connections to [=connection/close=] before the request can complete and allow
12831289
further requests to be processed.
12841290

1291+
Issue: Make the queue/bottle (or bottle map) association more rigorous.
1292+
1293+
12851294
<aside class=note>
12861295
A [=connection queue=] is not a [=task queue=] associated with
12871296
an [=/event loop=], as the requests are processed outside any
@@ -2208,17 +2217,14 @@ The <dfn method for=IDBFactory>open(|name|, |version|)</dfn> method steps are:
22082217

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

2211-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
2212-
2213-
1. If |origin| is an [=opaque origin=], [=throw=] a
2214-
"{{SecurityError}}" {{DOMException}} and abort these steps.
2220+
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.
22152221

22162222
1. Let |request| be a new [=open request=].
22172223

22182224
1. Run these steps [=in parallel=]:
22192225

22202226
1. Let |result| be the result of running
2221-
[=open a database=], with |environment|,
2227+
[=open a database=], with |map|,
22222228
|name|, |version| if given and undefined
22232229
otherwise, and |request|.
22242230

@@ -2279,17 +2285,14 @@ The <dfn method for=IDBFactory>deleteDatabase(|name|)</dfn> method steps are:
22792285

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

2282-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
2283-
2284-
1. If |origin| is an [=opaque origin=], [=throw=] a
2285-
"{{SecurityError}}" {{DOMException}} and abort these steps.
2288+
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.
22862289

22872290
1. Let |request| be a new [=open request=].
22882291

22892292
1. Run these steps [=in parallel=]:
22902293

22912294
1. Let |result| be the result of running
2292-
[=delete a database=], with |environment|,
2295+
[=delete a database=], with |map|,
22932296
|name|, and |request|.
22942297

22952298
1. Set |request|'s [=request/processed flag=] to true.
@@ -2335,16 +2338,11 @@ The <dfn method for=IDBFactory>databases()</dfn> method steps are:
23352338

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

2338-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
2339-
2340-
1. If |origin| is an [=opaque origin=],
2341-
then return [=/a promise rejected with=] a "{{SecurityError}}" {{DOMException}}.
2342-
23432341
1. Let |p| be [=/a new promise=].
23442342

23452343
1. Run these steps [=in parallel=]:
23462344

2347-
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.
2345+
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.
23482346

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

@@ -4946,18 +4944,14 @@ The <dfn attribute for=IDBTransaction>onerror</dfn> attribute is an [=/event han
49464944

49474945
<div algorithm>
49484946

4949-
To <dfn>open a database</dfn> with [=/environment settings object=] |environment|, a database |name|, a database |version|, and a |request|, run these steps:
4950-
4951-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
4947+
To <dfn>open a database</dfn> with [=/storage proxy map=] |map|, a database |name|, a database |version|, and a |request|, run these steps:
49524948

4953-
1. Let |queue| be the [=connection queue=] for |origin| and |name|.
4949+
1. Let |queue| be the [=connection queue=] for |map|'s [=storage proxy map/backing map=] and |name|.
49544950

49554951
1. Add |request| to |queue|.
49564952

49574953
1. Wait until all previous requests in |queue| have been processed.
49584954

4959-
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}}).
4960-
49614955
1. Let |db| be |map|\[|name|] if it [=map/exists=], or null otherwise.
49624956

49634957
1. If |version| is undefined, let |version| be 1 if |db| is null, or
@@ -5074,18 +5068,14 @@ optional |forced flag|, run these steps:
50745068

50755069
<div algorithm>
50765070

5077-
To <dfn>delete a database</dfn> with [=/environment settings object=] |environment|, a database |name|, and a |request|, run these steps:
5071+
To <dfn>delete a database</dfn> with [=/storage proxy map=] |map|, a database |name|, and a |request|, run these steps:
50785072

5079-
1. Let |origin| be |environment|'s [=environment settings object/origin=].
5080-
5081-
1. Let |queue| be the [=connection queue=] for |origin| and |name|.
5073+
1. Let |queue| be the [=connection queue=] for |map|'s [=storage proxy map/backing map=] and |name|.
50825074

50835075
1. Add |request| to |queue|.
50845076

50855077
1. Wait until all previous requests in |queue| have been processed.
50865078

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

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

0 commit comments

Comments
 (0)