diff --git a/index.bs b/index.bs index 189a2bc..4a6f471 100644 --- a/index.bs +++ b/index.bs @@ -11,6 +11,7 @@ Editor: Ayu Ishii, Google https://www.google.com/, ayui@google.com Former Editor: Victor Costan !Participate: GitHub WICG/storage-buckets (new issue, open issues) Abstract: The Storage Buckets API provides a way for sites to organize locally stored data into groupings called "storage buckets". This allows the user agent or sites to manage and delete buckets independently rather than applying the same treatment to all the data from a single origin. +Markup Shorthands: css no, markdown yes

The {{StorageBucketManager}} interface

@@ -52,6 +53,12 @@ dictionary StorageBucketOptions {

Creating a bucket

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

Deleting a bucket

Enumerating buckets

@@ -78,4 +85,56 @@ interface StorageBucket { }; +

Durability

+ +A {{StorageBucket}} has a bucket durability. 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. + +

Using Indexed Database

+ +A {{StorageBucket}} has an {{IDBFactory}} object. [[IndexedDB]] objects created through +{{StorageBucket/indexedDB}} are associated with the bucket. + +
+ +The user agent MUST consider the associated {{StorageBucket/durability}} when evaluating the durability hint |durability| +of an {{IDBTransaction}} |transaction|. To calculate the effective durability hint 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}}". + +
+ +

Using CacheStorage

+ +A {{StorageBucket}} has a {{CacheStorage}} object. [[service-workers#cache-objects]] objects created through {{StorageBucket/caches}} are associated with the bucket. + +

Using an Origin Private File System

+ +Issue: [[Storage]] needs to define helpers to retrieve the bottle map for a given (non-default) bucket. + +Issue: [[FS]] needs to define a helper to retrieve an OPFS given a bottle map. + +
+ +The getDirectory() steps for |bucket| are: + +1. Let |map| be the result of [=obtain a local storage bottle map=] with |bucket| and `"fileSystem"`. + +1. Return the result of retrieving a [[FS#sandboxed-filesystem]] with |map|. + +
+

Security and privacy considerations