Skip to content

Commit

Permalink
Merge branch 'main' into read2
Browse files Browse the repository at this point in the history
  • Loading branch information
VergeA authored Jan 29, 2025
2 parents e786201 + d0d2cb4 commit 561c8f8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Build
on:
pull_request:
branches: [main]
paths: ["**.bs"]
push:
branches: [main]
paths: ["**.bs"]
Expand Down
47 changes: 29 additions & 18 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ spec: private-aggregation-api; urlPrefix: https://patcg-individual-drafts.github
for: pre-specified report parameters
text: context ID
text: filtering ID max bytes
text: max contributions
text: batching scope
text: debug scope
text: process contributions for a batching scope
Expand Down Expand Up @@ -581,11 +582,20 @@ Moreover, each {{SharedStorageWorklet}}'s [=global scopes|list of global scopes=
1. If |filteringIdMaxBytes| is not the [=default filtering ID max bytes=] or
|contextId| is not null, return a new {{DOMException}} with name
"`DataError`".
1. Let |maxContributions| be null.
1. If
|privateAggregationConfig|["{{SharedStoragePrivateAggregationConfig/maxContributions}}"]
[=map/exists=], set |maxContributions| to
|privateAggregationConfig|["{{SharedStoragePrivateAggregationConfig/maxContributions}}"].
1. If |maxContributions| is zero, return a new {{DOMException}} with name
"`DataError`".
1. Return a new [=pre-specified report parameters=] with the items:
: <a spec="private-aggregation-api" for="pre-specified report parameters">context ID</a>
:: |contextId|
: [=pre-specified report parameters/filtering ID max bytes=]
:: |filteringIdMaxBytes|
: [=pre-specified report parameters/max contributions=]
:: |maxContributions|
</div>

<div algorithm>
Expand Down Expand Up @@ -695,12 +705,12 @@ Moreover, each {{SharedStorageWorklet}}'s [=global scopes|list of global scopes=

The {{Worklet/addModule()}} method steps for {{Worklet}} will need to include the following step before the step "Let |promise| be a new promise":

4. If |this| is of type {{SharedStorageWorklet}}:
1. Let |addModuleAllowedResult| be the result of running [=check if addModule is allowed and update state=] given |this| and <var ignore=''>moduleURLRecord</var>.
4. If [=this=] is of type {{SharedStorageWorklet}}:
1. Let |addModuleAllowedResult| be the result of running [=check if addModule is allowed and update state=] given [=this=] and <var ignore=''>moduleURLRecord</var>.
1. If |addModuleAllowedResult| is "DisallowedDueToNonPreferenceError":
1. Return [=a promise rejected with=] a {{TypeError}}.
1. Else if |addModuleAllowedResult| is "DisallowedDueToPreferenceError":
1. If |this|'s [=SharedStorageWorklet/has cross-origin data origin=] is false, then return [=a promise rejected with=] a {{TypeError}}.
1. If [=this=]'s [=SharedStorageWorklet/has cross-origin data origin=] is false, then return [=a promise rejected with=] a {{TypeError}}.
1. Else:
1. [=Assert=]: |addModuleAllowedResult| is "Allowed".

Expand All @@ -714,7 +724,7 @@ Moreover, each {{SharedStorageWorklet}}'s [=global scopes|list of global scopes=

After the step "Let <var ignore=''>addedSuccessfully</var> be false", we need to include the following step:

4. If |this| is of type {{SharedStorageWorklet}}, [=SharedStorageWorklet/has cross-origin data origin=] is true, and [=SharedStorageWorklet/data origin=] is not `"script-origin"`:
4. If [=this=] is of type {{SharedStorageWorklet}}, [=SharedStorageWorklet/has cross-origin data origin=] is true, and [=SharedStorageWorklet/data origin=] is not `"script-origin"`:
1. [=Assert=] |pendingTasks| is 1.
1. Set |pendingTasks| to 2.
1. [=Queue a global task=] on the [=networking task source=] given <var ignore=''>workletGlobalScope</var> to perform the following steps:
Expand Down Expand Up @@ -750,7 +760,7 @@ Moreover, each {{SharedStorageWorklet}}'s [=global scopes|list of global scopes=
1. Abort these steps.
1. Let |doesMatch| be the result of running [=check for script and context origin match=] on |item|[`scriptOrigin`], <var ignore=''>moduleURLRecord</var>'s [=url/origin=], |item|[`contextOrigin`], and |outsideSettings|'s [=environment settings object/origin=].
1. If |doesMatch| is true:
1. [=Queue a global task=] on the [=networking task source=] given |this|'s [=relevant global object=] to perform the following steps:
1. [=Queue a global task=] on the [=networking task source=] given [=this=]'s [=relevant global object=] to perform the following steps:
1. If |pendingTasks| is not −1, then:
1. Set |pendingTasks| to |pendingTasks| − 1.
1. If |pendingTasks| is 0, perform the following steps:
Expand All @@ -771,9 +781,9 @@ Moreover, each {{SharedStorageWorklet}}'s [=global scopes|list of global scopes=

Just before the final step, currently "Return <var ignore>promise</var>.", add the following step:

7. If |this| is a {{SharedStorageWorklet}}, [=upon fulfillment=] of |promise| or
7. If [=this=] is a {{SharedStorageWorklet}}, [=upon fulfillment=] of |promise| or
[=upon rejection=] of |promise|, run the following steps:
1. Let |globalScopes| be |this|'s [=Worklet/global scopes=].
1. Let |globalScopes| be [=this=]'s [=Worklet/global scopes=].
1. [=Assert=]: |globalScopes|' [=list/size=] equals 1.
1. Let |privateAggregationObj| be |globalScopes|[0]'s
{{SharedStorageWorkletGlobalScope/privateAggregation}}.
Expand Down Expand Up @@ -1479,12 +1489,12 @@ A {{SharedStorageDeleteMethod}} has the following associated fields:
1. Let |environment| be |context|'s [=active window=]'s [=relevant settings object=].
1. Let |databaseMap| be the result of running [=obtain a shared storage bottle map=] given |environment| and |environment|'s [=environment settings object/origin=].
1. If |databaseMap| is failure, throw a {{TypeError}}.
1. Set |this|'s [=SharedStorageSetMethod/key=] to |key|.
1. Set |this|'s [=SharedStorageSetMethod/value=] to |value|.
1. Set |this|'s [=SharedStorageSetMethod/ignore if present=] to |options|["{{SharedStorageSetMethodOptions/ignoreIfPresent}}"].
1. Set [=this=]'s [=SharedStorageSetMethod/key=] to |key|.
1. Set [=this=]'s [=SharedStorageSetMethod/value=] to |value|.
1. Set [=this=]'s [=SharedStorageSetMethod/ignore if present=] to |options|["{{SharedStorageSetMethodOptions/ignoreIfPresent}}"].
1. If |options|["{{SharedStorageModifierMethodOptions/withLock}}"] [=map/exists=]:
1. If |options|["{{SharedStorageModifierMethodOptions/withLock}}"] starts with U+002D HYPHEN-MINUS (-), throw a {{TypeError}}.
1. Set |this|'s [=SharedStorageModifierMethod/with lock=] to |options|["{{SharedStorageModifierMethodOptions/withLock}}"].
1. Set [=this=]'s [=SharedStorageModifierMethod/with lock=] to |options|["{{SharedStorageModifierMethodOptions/withLock}}"].
</div>

<div algorithm="SharedStorageAppendMethod">
Expand All @@ -1505,11 +1515,11 @@ A {{SharedStorageDeleteMethod}} has the following associated fields:
1. Let |environment| be |context|'s [=active window=]'s [=relevant settings object=].
1. Let |databaseMap| be the result of running [=obtain a shared storage bottle map=] given |environment| and |environment|'s [=environment settings object/origin=].
1. If |databaseMap| is failure, throw a {{TypeError}}.
1. Set |this|'s [=SharedStorageAppendMethod/key=] to |key|.
1. Set |this|'s [=SharedStorageAppendMethod/value=] to |value|.
1. Set [=this=]'s [=SharedStorageAppendMethod/key=] to |key|.
1. Set [=this=]'s [=SharedStorageAppendMethod/value=] to |value|.
1. If |options|["{{SharedStorageModifierMethodOptions/withLock}}"] [=map/exists=]:
1. If |options|["{{SharedStorageModifierMethodOptions/withLock}}"] starts with U+002D HYPHEN-MINUS (-), throw a {{TypeError}}.
1. Set |this|'s [=SharedStorageModifierMethod/with lock=] to |options|["{{SharedStorageModifierMethodOptions/withLock}}"].
1. Set [=this=]'s [=SharedStorageModifierMethod/with lock=] to |options|["{{SharedStorageModifierMethodOptions/withLock}}"].
</div>

<div algorithm="SharedStorageDeleteMethod">
Expand All @@ -1529,10 +1539,10 @@ A {{SharedStorageDeleteMethod}} has the following associated fields:
1. Let |environment| be |context|'s [=active window=]'s [=relevant settings object=].
1. Let |databaseMap| be the result of running [=obtain a shared storage bottle map=] given |environment| and |environment|'s [=environment settings object/origin=].
1. If |databaseMap| is failure, throw a {{TypeError}}.
1. Set |this|'s [=SharedStorageDeleteMethod/key=] to |key|.
1. Set [=this=]'s [=SharedStorageDeleteMethod/key=] to |key|.
1. If |options|["{{SharedStorageModifierMethodOptions/withLock}}"] [=map/exists=]:
1. If |options|["{{SharedStorageModifierMethodOptions/withLock}}"] starts with U+002D HYPHEN-MINUS (-), throw a {{TypeError}}.
1. Set |this|'s [=SharedStorageModifierMethod/with lock=] to |options|["{{SharedStorageModifierMethodOptions/withLock}}"].
1. Set [=this=]'s [=SharedStorageModifierMethod/with lock=] to |options|["{{SharedStorageModifierMethodOptions/withLock}}"].
</div>

<div algorithm="SharedStorageClearMethod">
Expand Down Expand Up @@ -1612,6 +1622,7 @@ Note: The [=determine if a navigable has fully revoked network=] algorithm ensur
USVString aggregationCoordinatorOrigin;
USVString contextId;
[EnforceRange] unsigned long long filteringIdMaxBytes;
[EnforceRange] unsigned long long maxContributions;
};

dictionary SharedStorageRunOperationMethodOptions {
Expand Down Expand Up @@ -2366,12 +2377,12 @@ SharedStorageWorkletNavigator includes NavigatorLocks;

The {{LockManager}} and {{Lock}} are additionally exposed to SharedStorageWorklet:

<xmp class='idl'>
<xmp class='idl' noexport>
[SecureContext, Exposed=(Window,Worker,SharedStorageWorklet)]
interface LockManager {};
</xmp>

<xmp class='idl'>
<xmp class='idl' noexport>
[SecureContext, Exposed=(Window,Worker,SharedStorageWorklet)]
interface Lock {};
</xmp>
Expand Down

0 comments on commit 561c8f8

Please sign in to comment.