Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IndexedDB text. #46

Merged
merged 6 commits into from
Dec 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ dictionary StorageBucketOptions {
</xmp>

<h3 id="storage-bucket-open">Creating a bucket</h3>

When not null, {{StorageBucketOptions/durability}} is a hint to the user agent
specifying the desired {{StorageBucket/durability}}. The user agent MAY
create a new {{StorageBucket}} with this [=bucket durability=]. The user agent
MUST NOT modify the [=bucket durability=] of an existing bucket.

<h3 id="storage-bucket-delete">Deleting a bucket</h3>
<h3 id="storage-bucket-keys">Enumerating buckets</h3>

Expand All @@ -78,4 +84,36 @@ interface StorageBucket {
};
</xmp>

<h3 id="storage-bucket-durability">Durability</h3>

A {{StorageBucket}} has a <dfn>bucket durability</dfn>. This reflects whether the user agent
will prioritize performance or durability when completing operations on data in the bucket.
The value is one of the following:

: "{{StorageBucketDurability/strict}}"
:: The user agent MUST consider that operations on data in the bucket are successful only after verifying that outstanding changes have been written to a persistent storage medium.
: "{{StorageBucketDurability/relaxed}}"
:: The user agent MUST consider that operations on data in the bucket are successful as soon as all outstanding changes have been written to the operating system, without subsequent verification.

The user agent MUST ignore the [=bucket durability=] for operations that otherwise override default durability behavior.

<h3 id="storage-bucket-indexeddb">Creating an Indexed Database</h3>

Each {{StorageBucket}} has an {{IDBFactory}} object. {{IDBDatabase}} objects created by
{{StorageBucket/indexedDB}} are associated with the bucket.

<div algorithm>

The user agent should consider the associated {{StorageBucket/durability}} when evaluating the <a spec="IndexedDB">durability hint</a> |durability|
of an {{IDBTransaction}} |transaction|. To <dfn>calculate the effective <a spec="IndexedDB">durability hint</a></dfn> for |transaction| with associated
|bucket|:

1. If |durability| is not "{{IDBTransactionDurability/default}}", then return |durability|.

1. If |bucket|'s [=bucket durability=] is "{{StorageBucketDurability/strict}}", then return "{{IDBTransactionDurability/strict}}".

1. Return "{{IDBTransactionDurability/relaxed}}".

</div>

<h2 id="security-privacy">Security and privacy considerations</h2>