diff --git a/index.bs b/index.bs index b9756ea..231e683 100644 --- a/index.bs +++ b/index.bs @@ -308,17 +308,19 @@ The persist() method steps are: 1. Run the following steps [=in parallel=]: - 1. If |bucket|'s [=storage bucket/removed=] flag is true, [=reject=] |p| with {{InvalidStateError}}. + 1. If |bucket|'s [=storage bucket/removed=] flag is true, then [=queue a storage task=] to [=reject=] |p| with an {{InvalidStateError}}. - 1. If |bucket|'s [=bucket mode=] is `"persistent"`, [=/resolve=] |p| with true. + 1. Let |persisted| be true if |bucket|'s [=bucket mode=] is `"persistent"`. 1. Otherwise, 1. Let |permission| be the result of [=getting the current permission state=] with `"persistent-storage"` and |environment|. - 1. If |permission| is "{{PermissionState/granted}}", then set |bucket|'s [=bucket mode=] to `"persistent"` and [=queue a storage task=] to [=/resolve=] |p| with true. + 1. If |permission| is "{{PermissionState/granted}}", then set |bucket|'s [=bucket mode=] to `"persistent"` and set |persisted| to true. - 1. Otherwise, [=/resolve=] |p| with false. + 1. Otherwise, set |persisted| to false. + + 1. [=Queue a storage task=] to [=resolve=] |p| with |persisted|. 1. Return |p|. @@ -332,13 +334,13 @@ The persisted() method steps are: 1. Let |bucket| be [=this=]'s [=/storage bucket=]. -1. If |bucket|'s [=storage bucket/removed=] flag is true, then [=queue a storage task=] to [=reject=] |p| with an {{InvalidStateError}}. +1. Otherwise, run these steps [=in parallel=]: -1. Otherwise, + 1. If |bucket|'s [=storage bucket/removed=] flag is true, then [=queue a storage task=] to [=reject=] |p| with an {{InvalidStateError}}. - 1. If |bucket|'s [=bucket mode=] is `"persistent"`, then [=queue a storage task=] to [=/resolve=] |p| with true. + 1. Let |persistent| be true if |bucket|'s [=bucket mode=] is `"persistent"`, otherwise false. - 1. Otherwise, [=queue a storage task=] to [=/resolve=] |p| with false. + 1. [=Queue a storage task=] to [=resolve=] |p| with |persistent|. 1. Return |p|. @@ -379,7 +381,7 @@ The estimate() method steps are: 1. Let |dictionary| be a new {{StorageEstimate}} dictionary whose {{StorageEstimate/usage}} member is |usage| and {{StorageEstimate/quota}} member is |quota|. - 1. [=/Resolve=] |p| with |dictionary|. + 1. [=Queue a storage task=] to [=resolve=] |p| with |dictionary|. 1. Return |p|. @@ -410,9 +412,13 @@ The setExpires(|expires|) method steps are 1. Let |bucket| be [=this=]'s [=/storage bucket=]. -1. If |bucket|'s [=storage bucket/removed=] flag is true, [=queue a storage task=] to [=reject=] |p| with an {{InvalidStateError}}. +1. Otherwise, run these steps [=in parallel=]: + + 1. If |bucket|'s [=storage bucket/removed=] flag is true, then [=queue a storage task=] to [=reject=] |p| with an {{InvalidStateError}}. + + 1. Otherwise, set |bucket|'s [=StorageBucket/expiration time=] to |expires| milliseconds after the [=Unix epoch=]. -1. Otherwise, set |bucket|'s [=StorageBucket/expiration time=] to |expires| milliseconds after the [=Unix epoch=] and [=queue a storage task=] to [=/resolve=] |p|. + 1. [=Queue a storage task=] to [=resolve=] |p|. 1. Return |p|. @@ -426,9 +432,13 @@ The expires() method steps are: 1. Let |bucket| be [=this=]'s [=/storage bucket=]. -1. If |bucket|'s [=storage bucket/removed=] flag is true, [=queue a storage task=] to [=reject=] |p| with an {{InvalidStateError}}. +1. Otherwise, run these steps [=in parallel=]: + + 1. If |bucket|'s [=storage bucket/removed=] flag is true, then [=queue a storage task=] to [=reject=] |p| with an {{InvalidStateError}}. + + 1. Otherwise, let |expiration| be |bucket|'s [=StorageBucket/expiration time=]. -1. Otherwise, [=queue a storage task=] to [=/resolve=] |p| with |bucket|'s [=StorageBucket/expiration time=]. + 1. [=Queue a storage task=] to [=resolve=] |p| with |expiration|. 1. Return |p|.