From 2cb97dc9178080f3fb7b7127fff6a47466f582e9 Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Wed, 4 Jan 2023 19:14:15 +0000 Subject: [PATCH 1/2] Enhance IDB, CacheStorage algorithms. Also distinguish between the conceptual bottle and the StorageBottle object in the open() definition. --- index.bs | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/index.bs b/index.bs index 36b9a76..8096ea7 100644 --- a/index.bs +++ b/index.bs @@ -124,7 +124,11 @@ dictionary StorageBucketOptions { 1. Set |bucket|'s [=bucket expiration|expiration=] to |expires|. - 1. Return |bucket|. + 1. Let |storageBucket| be a new {{StorageBucket}}. + + 1. Set |storageBucket|'s [=/storage bucket=] to |bucket|. + + 1. Return |storageBucket|. @@ -175,6 +179,9 @@ To delete a bucket for a |storageKey| given a bucket |name|, run the +Issue: [[Storage]] needs to define bucket removal/clearing. The bucket needs to be internally marked as +removed and subsequent attempts to access it (through associated storage endpoints) should fail. +

Enumerating buckets

@@ -227,6 +234,8 @@ interface StorageBucket { }; +A {{StorageBucket}} has an associated [=/storage bucket=]. + A {{StorageBucket}} has a bucket quota, a number-or-null, initially null. Specifies the upper limit of usage which can be used by the bucket. The user agent MAY further limit the realized storage space. @@ -250,8 +259,19 @@ The user agent MUST ignore the [=bucket durability=] for operations that otherwi

Using Indexed Database

-A {{StorageBucket}} has an {{IDBFactory}} object. [[IndexedDB]] objects created through -{{StorageBucket/indexedDB}} are associated with the bucket. +Issue: {{IDBFactory}} methods need to take a storage bottle map rather than a storageKey. + +A {{StorageBucket}} has an {{IDBFactory}} object. {{StorageBucket/indexedDB}} getter steps are: + +1. Let |bucket| be [=this=]'s [=/storage bucket=]. + +1. Let |bottle map| be the result of [=obtain a local storage bottle map=] with |bucket| and `"indexedDB"`. + +1. Let |indexedDB| be an {{IDBFactory}} object. + +1. Set the [=bottle map=] for |indexedDB| to |bottle map|. + +1. Return |indexedDB|.
@@ -269,7 +289,17 @@ of an {{IDBTransaction}} |transaction|. To calculate the effective Using CacheStorage -A {{StorageBucket}} has a {{CacheStorage}} object. [[service-workers#cache-objects]] objects created through {{StorageBucket/caches}} are associated with the bucket. +A {{StorageBucket}} has a {{CacheStorage}} object. {{StorageBucket/caches}} getter steps are: + +1. Let |bucket| be [=this=]'s [=/storage bucket=]. + +1. Let |bottle map| be the result of [=obtain a local storage bottle map=] with |bucket| and `"cacheStorage"`. + +1. Let |cacheStorage| be a {{CacheStorage}} object. + +1. Set the relevant name to cache map for |cacheStorage| to |bottle map|. + +1. Return |cacheStorage|.

Using an Origin Private File System

@@ -279,9 +309,9 @@ Issue: [[FS]] needs to define a helper to retrieve an OPFS given a bottle map.
-The getDirectory() steps for |bucket| are: +The getDirectory() steps are: -1. Let |map| be the result of [=obtain a local storage bottle map=] with |bucket| and `"fileSystem"`. +1. Let |map| be the result of [=obtain a local storage bottle map=] with [=this=]'s [=/storage bucket=] and `"fileSystem"`. 1. Return the result of retrieving a [[FS#sandboxed-filesystem]] with |map|. From 4cec5749b1dd6ed2b273da34ec516d8dcd1f130b Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Wed, 4 Jan 2023 20:33:44 +0000 Subject: [PATCH 2/2] algo tags --- index.bs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 8096ea7..6682568 100644 --- a/index.bs +++ b/index.bs @@ -261,7 +261,9 @@ The user agent MUST ignore the [=bucket durability=] for operations that otherwi Issue: {{IDBFactory}} methods need to take a storage bottle map rather than a storageKey. -A {{StorageBucket}} has an {{IDBFactory}} object. {{StorageBucket/indexedDB}} getter steps are: +
+ +A {{StorageBucket}} has an {{IDBFactory}} object. The indexedDB getter steps are: 1. Let |bucket| be [=this=]'s [=/storage bucket=]. @@ -273,6 +275,8 @@ A {{StorageBucket}} has an {{IDBFactory}} object. {{StorageBucket/indexedDB}} ge 1. Return |indexedDB|. +
+