Skip to content

Commit 91642aa

Browse files
authored
Add missing parallel step and define queue a database task (#456)
* add and use `queue a database task` concept * Queue a database task for resolving promise in databases() * Update revision history * Add missing issue reference
1 parent 812ee6f commit 91642aa

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

index.bs

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ The <dfn>lifetime</dfn> of a
10111011
1. When an implementation is able to enforce the constraints for the
10121012
transaction's [=transaction/scope=] and [=transaction/mode=],
10131013
defined [below](#transaction-scheduling), the implementation must
1014-
[=queue a task=] to <dfn lt="start|started">start</dfn> the
1014+
[=queue a database task=] to <dfn lt="start|started">start</dfn> the
10151015
transaction asynchronously.
10161016

10171017
Once the transaction has been [=transaction/started=] the
@@ -1927,6 +1927,12 @@ through the properties of the {{IDBRequest}} instance.
19271927

19281928
The <span>task source</span> for these tasks is the <dfn id=database-access-task-source export>database access task source</dfn>.
19291929

1930+
<div algorithm>
1931+
1932+
To <dfn>queue a database task</dfn>, perform [=queue a task=] on the [=database access task source=].
1933+
1934+
</div>
1935+
19301936

19311937
<!-- ============================================================ -->
19321938
## The {{IDBRequest}} interface ## {#request-api}
@@ -2223,7 +2229,7 @@ The <dfn method for=IDBFactory>open(|name|, |version|)</dfn> method steps are:
22232229

22242230
1. Set |request|'s [=request/processed flag=] to true.
22252231

2226-
1. [=Queue a task=] to run these steps:
2232+
1. [=Queue a database task=] to run these steps:
22272233

22282234
1. If |result| is an error, then:
22292235

@@ -2282,7 +2288,7 @@ The <dfn method for=IDBFactory>deleteDatabase(|name|)</dfn> method steps are:
22822288

22832289
1. Set |request|'s [=request/processed flag=] to true.
22842290

2285-
1. [=Queue a task=] to run these steps:
2291+
1. [=Queue a database task=] to run these steps:
22862292
1. If |result| is an error,
22872293
set |request|'s [=request/error=] to |result|,
22882294
set |request|'s [=request/done flag=] to true,
@@ -2331,7 +2337,7 @@ The <dfn method for=IDBFactory>databases()</dfn> method steps are:
23312337
1. Run these steps [=in parallel=]:
23322338

23332339
1. Let |databases| be the [=/set=] of [=/databases=] in |storageKey|.
2334-
If this cannot be determined for any reason, then [=/reject=] |p| with
2340+
If this cannot be determined for any reason, then [=queue a database task=] to [=/reject=] |p| with
23352341
an appropriate error (e.g. an "{{UnknownError}}" {{DOMException}})
23362342
and terminate these steps.
23372343

@@ -2345,7 +2351,7 @@ The <dfn method for=IDBFactory>databases()</dfn> method steps are:
23452351
1. Set |info|'s {{IDBDatabaseInfo/version}} dictionary member to |db|'s [=database/version=].
23462352
1. [=list/Append=] |info| to |result|.
23472353

2348-
1. [=/Resolve=] |p| with |result|.
2354+
1. [=Queue a database task=] to [=/resolve=] |p| with |result|.
23492355

23502356
1. Return |p|.
23512357

@@ -3459,7 +3465,7 @@ which violates these constraints, this must not cause the
34593465
implementation of {{IDBObjectStore/createIndex()}} to throw an
34603466
exception or affect what it returns. The implementation must still
34613467
create and return an {{IDBIndex}} object, and the implementation must
3462-
[=queue a task=] to abort the [=/upgrade transaction=] which was
3468+
[=queue a database task=] to abort the [=/upgrade transaction=] which was
34633469
used for the {{IDBObjectStore/createIndex()}} call.
34643470

34653471
This method synchronously modifies the {{IDBObjectStore/indexNames}}
@@ -4930,7 +4936,7 @@ To <dfn>open a database connection</dfn> with |storageKey| which requested the [
49304936
except |connection|, associated with |db|.
49314937

49324938
1. [=set/For each=] |entry| of |openConnections| that does not have its
4933-
[=connection/close pending flag=] set to true, [=queue a task=] to [=fire a
4939+
[=connection/close pending flag=] set to true, [=queue a database task=] to [=fire a
49344940
version change event=] named {{IDBDatabase/versionchange!!event}} at
49354941
|entry| with |db|'s [=database/version=] and |version|.
49364942

@@ -4943,7 +4949,7 @@ To <dfn>open a database connection</dfn> with |storageKey| which requested the [
49434949
1. Wait for all of the events to be fired.
49444950

49454951
1. If any of the [=/connections=] in |openConnections| are still
4946-
not closed, [=queue a task=] to [=fire a version change
4952+
not closed, [=queue a database task=] to [=fire a version change
49474953
event=] named {{IDBOpenDBRequest/blocked!!event}} at |request| with
49484954
|db|'s [=database/version=] and |version|.
49494955

@@ -5034,7 +5040,7 @@ requested the [=/database=] to be deleted, a database |name|, and a
50345040
associated with |db|.
50355041

50365042
1. [=set/For each=] |entry| of |openConnections| that does not have its
5037-
[=connection/close pending flag=] set to true, [=queue a task=] to [=fire a version
5043+
[=connection/close pending flag=] set to true, [=queue a database task=] to [=fire a version
50385044
change event=] named {{IDBDatabase/versionchange!!event}} at |entry| with
50395045
|db|'s [=database/version=] and null.
50405046

@@ -5047,7 +5053,7 @@ requested the [=/database=] to be deleted, a database |name|, and a
50475053
1. Wait for all of the events to be fired.
50485054

50495055
1. If any of the [=/connections=] in |openConnections| are still not
5050-
closed, [=queue a task=] to [=fire a version change event=] named
5056+
closed, [=queue a database task=] to [=fire a version change event=] named
50515057
{{IDBOpenDBRequest/blocked!!event}} at |request| with |db|'s
50525058
[=database/version=] and null.
50535059

@@ -5090,7 +5096,7 @@ To <dfn>commit a transaction</dfn> with the |transaction| to commit, run these s
50905096
appropriate type for the error, for example "{{QuotaExceededError}}" or
50915097
"{{UnknownError}}" {{DOMException}}, and terminate these steps.
50925098

5093-
1. [=Queue a task=] to run these steps:
5099+
1. [=Queue a database task=] to run these steps:
50945100

50955101
1. If |transaction| is an [=/upgrade transaction=], then set |transaction|'s
50965102
[=transaction/connection=]'s associated [=/database=]'s [=database/upgrade transaction=] to null.
@@ -5144,7 +5150,7 @@ To <dfn>abort a transaction</dfn> with the |transaction| to abort, and |error|,
51445150
1. [=list/For each=] |request| of |transaction|'s [=transaction/request list=],
51455151
abort the steps to [=asynchronously execute a request=] for |request|,
51465152
set |request|'s [=request/processed flag=] to true,
5147-
and [=queue a task=] to run these steps:
5153+
and [=queue a database task=] to run these steps:
51485154

51495155
1. Set |request|'s [=request/done flag=] to true.
51505156
1. Set |request|'s [=request/result=] to undefined.
@@ -5160,7 +5166,7 @@ To <dfn>abort a transaction</dfn> with the |transaction| to abort, and |error|,
51605166
error while [=transaction/committing=] the transaction,
51615167
or if it was the last remaining request that failed.
51625168

5163-
1. [=Queue a task=] to run these steps:
5169+
1. [=Queue a database task=] to run these steps:
51645170

51655171
1. If |transaction| is an [=/upgrade transaction=], then set |transaction|'s
51665172
[=transaction/connection=]'s associated [=/database=]'s [=database/upgrade transaction=] to null.
@@ -5220,7 +5226,7 @@ created [=/request=] belongs to is [=transaction/aborted=] using the steps to
52205226

52215227
1. Set |request|'s [=request/processed flag=] to true.
52225228

5223-
1. [=Queue a task=] to run these steps:
5229+
1. [=Queue a database task=] to run these steps:
52245230

52255231
1. Remove |request| from |transaction|'s [=transaction/request list=].
52265232

@@ -5277,7 +5283,7 @@ To <dfn>upgrade a database</dfn> with |connection| (a [=/connection=]), a new |v
52775283

52785284
1. Set |request|'s [=request/processed flag=] to true.
52795285

5280-
1. [=Queue a task=] to run these steps:
5286+
1. [=Queue a database task=] to run these steps:
52815287

52825288
1. Set |request|'s [=request/result=] to |connection|.
52835289
1. Set |request|'s [=request/transaction=] to |transaction|.
@@ -6714,12 +6720,14 @@ For the revision history of the second edition, see [that document's Revision Hi
67146720
* Added a definition for [=transaction/live=] transactions, and renamed "run an upgrade transaction" to [=/upgrade a database=], to disambiguate "running". (<#408>)
67156721
* Specified the {{DOMException}} type for failures when reading a value from the underlying storage in [[#object-store-retrieval-operation]]. (<#423>)
67166722
* Updated [=convert a value to a key=] to return invalid for detached array buffers. (<#417>)
6717-
* Updated {{IDBFactory/open()}} to set its request's [=request/processed flag=] to true.
6723+
* Updated {{IDBFactory/open()}} to set its request's [=request/processed flag=] to true. (<#434>)
67186724
* Don't include databases that aren't done being created in {{IDBFactory/databases()}}. (<#442>)
67196725
* Clarify that only [=transaction/inactive=] [=/transactions=] should attempt to auto-commit. (<#436>)
67206726
* Correct [=/upgrade a database=] steps to handle aborted transactions. (<#436>)
67216727
* Update [=/iterate a cursor=] value serialization to use [=/value=] for [=/object stores=] instead of [=index/referenced values=]. (<#452>)
67226728
* Add [=cursor/source handle=] to [=/cursor=] to avoid exposing internal indexes and object stores to script. (<#445>)
6729+
* Define [=Queue a database task=] and replace [=Queue a task=] with it (<#421>)
6730+
* Add missing parallel step to {{IDBFactory/databases()|databases}}() (<#421>)
67236731

67246732
<!-- ============================================================ -->
67256733
# Acknowledgements # {#acknowledgements}

0 commit comments

Comments
 (0)