Skip to content

Commit

Permalink
Use queue a task (#81)
Browse files Browse the repository at this point in the history
* Use [=queue a task=]

* Additional changes
  • Loading branch information
ayuishii authored Mar 16, 2023
1 parent 752569c commit a253cb5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ The <dfn method for="StorageBucketManager">keys()</dfn> method steps are:

1. If |bucket| is non-null, [=list/append=] |key| to |keys|.

1. [=/Resolve=] |p| with |keys|.
1. [=Queue a task=] to [=/resolve=] |p| with |keys|.

1. Return |p|.

Expand Down Expand Up @@ -301,19 +301,19 @@ The <dfn method for="StorageBucket">persist()</dfn> method steps are:

1. Let |bucket| be [=this=]'s [=/storage bucket=].

1. If |bucket|'s [=storage bucket/removed=] flag is true, [=reject=] |p| with {{InvalidStateError}}.
1. If |bucket|'s [=storage bucket/removed=] flag is true, [=queue a task=] to [=reject=] |p| with {{InvalidStateError}}.

1. If |bucket|'s [=bucket mode=] is `"persistent"`, [=/resolve=] |p| with true.
1. If |bucket|'s [=bucket mode=] is `"persistent"`, [=queue a task=] to [=/resolve=] |p| with true.

1. Otherwise,

1. Let |environment| be [=/this=]'s [=/relevant settings object=].

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 [=/resolve=] |p| with true.
1. If |permission| is "{{PermissionState/granted}}", then set |bucket|'s [=bucket mode=] to `"persistent"` and [=queue a task=] to [=/resolve=] |p| with true.

1. Otherwise, [=/resolve=] |p| with false.
1. Otherwise, [=queue a task=] to [=/resolve=] |p| with false.

1. Return |p|.

Expand All @@ -327,13 +327,13 @@ The <dfn method for="StorageBucket">persisted()</dfn> method steps are:

1. Let |bucket| be [=this=]'s [=/storage bucket=].

1. If |bucket|'s [=storage bucket/removed=] flag is true, then [=reject=] |p| with an {{InvalidStateError}}.
1. If |bucket|'s [=storage bucket/removed=] flag is true, then [=queue a task=] to [=reject=] |p| with an {{InvalidStateError}}.

1. Otherwise,

1. If |bucket|'s [=bucket mode=] is `"persistent"`, then [=/resolve=] |p| with true.
1. If |bucket|'s [=bucket mode=] is `"persistent"`, then [=queue a task=] to [=/resolve=] |p| with true.

1. Otherwise, [=/resolve=] |p| with false.
1. Otherwise, [=queue a task=] to [=/resolve=] |p| with false.

1. Return |p|.

Expand Down Expand Up @@ -402,9 +402,9 @@ The <dfn method for="StorageBucket">durability()</dfn> method steps are:

1. Let |bucket| be [=this=]'s [=/storage bucket=].

1. If |bucket|'s [=storage bucket/removed=] flag is true, [=reject=] |p| with an {{InvalidStateError}}.
1. If |bucket|'s [=storage bucket/removed=] flag is true, [=queue a task=] to [=reject=] |p| with an {{InvalidStateError}}.

1. Otherwise, [=/resolve=] |p| with |bucket|'s [=StorageBucket/durability value=].
1. Otherwise, [=queue a task=] to [=/resolve=] |p| with |bucket|'s [=StorageBucket/durability value=].

1. Return |p|.

Expand Down Expand Up @@ -442,9 +442,9 @@ The <dfn method for="StorageBucket">setExpires(|expires|)</dfn> method steps are

1. Let |bucket| be [=this=]'s [=/storage bucket=].

1. If |bucket|'s [=storage bucket/removed=] flag is true, [=reject=] |p| with an {{InvalidStateError}}.
1. If |bucket|'s [=storage bucket/removed=] flag is true, [=queue a task=] to [=reject=] |p| with an {{InvalidStateError}}.

1. Otherwise, set |bucket|'s [=StorageBucket/expiration time=] to |expires| milliseconds after the [=Unix epoch=] and [=/resolve=] |p|.
1. Otherwise, set |bucket|'s [=StorageBucket/expiration time=] to |expires| milliseconds after the [=Unix epoch=] and [=queue a task=] to [=/resolve=] |p|.

1. Return |p|.

Expand All @@ -458,9 +458,9 @@ The <dfn method for="StorageBucket">expires()</dfn> method steps are:

1. Let |bucket| be [=this=]'s [=/storage bucket=].

1. If |bucket|'s [=storage bucket/removed=] flag is true, [=reject=] |p| with an {{InvalidStateError}}.
1. If |bucket|'s [=storage bucket/removed=] flag is true, [=queue a task=] to [=reject=] |p| with an {{InvalidStateError}}.

1. Otherwise, [=/resolve=] |p| with |bucket|'s [=StorageBucket/expiration time=].
1. Otherwise, [=queue a task=] to [=/resolve=] |p| with |bucket|'s [=StorageBucket/expiration time=].

1. Return |p|.

Expand Down

0 comments on commit a253cb5

Please sign in to comment.