这是indexloc提供的服务,不要输入任何密码
Skip to content

[explainer] Web Locks integration #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 16, 2024
Merged

[explainer] Web Locks integration #199

merged 10 commits into from
Oct 16, 2024

Conversation

xyaoinum
Copy link
Collaborator

@xyaoinum xyaoinum commented Sep 27, 2024

Today, concurrent execution of shared storage worklets in scenarios like cross-site reach measurement can result in duplicate reporting, due to the potential race conditions within the "get() and set()" logic. To address this issue, we propose integrating the Web Locks API into Shared Storage.

Specifically,

  • Introduce withLock: <resource> option to all modifier methods.
  • Introduce navigator.locks.request to the worklet environment.
  • Introduce a batch modify method: sharedStorage.batchUpdate(methods, options). This method, with the withLock option, allows multiple modifier methods to be executed atomically, enabling use cases where a website needs to maintain consistency while updating data organized across multiple keys.

@xyaoinum xyaoinum requested a review from jkarlin September 27, 2024 21:41
Remove trailing whitespaces
remove trailing whitespaces for select-url.md
@xyaoinum
Copy link
Collaborator Author

@jkarlin I've addressed most of your comments % still struggling with a good example for withLock. PTAL. Thanks!

@xyaoinum xyaoinum requested a review from jkarlin September 30, 2024 19:03
aarongable pushed a commit to chromium/chromium that referenced this pull request Sep 30, 2024
This allows lock requests to be identified by types beyond just storage
bucket IDs. This generalization supports use cases like the shared
storage web locks proposal ([1]), which requires its own lock scope
(i.e. per-origin) without integrating with storage buckets or the quota
database. The term "bucket" has been replaced with the more generic
"lock_group" throughout the code.

[1] WICG/shared-storage#199

Bug: 368816425
Change-Id: Iaabd48c4fc5e64d302b2efdadba5cac6f99ebe3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5879028
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1362083}
Copy link
Collaborator

@jkarlin jkarlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm w/ comment

@xyaoinum xyaoinum merged commit 834c46b into main Oct 16, 2024
1 check passed
@xyaoinum xyaoinum deleted the yao-web-locks branch October 16, 2024 16:05
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 18, 2024
Explainer: WICG/shared-storage#199

Key points:
- `SharedStorageWorkletNavigator` is a new interface that only
  supports `locks`. Implementation-wise, we inherit NavigatorBase
  so it's compatible with the LockManager implementation. Some
  methods are obviously unreachable (e.g. GetAcceptLanguages()).
- Add the member `LockManager<OriginLockGroupId> lock_manager_;` to
  SharedStorageWorkletHostManager: The locks have a shared storage
  specific scope (separate from the Window/Worker locks), and are
  further partitioned by shared storage origin.

Bug: 373899210
Change-Id: I9908962949088356c2a61c1556183ccd5772985f
aarongable pushed a commit to chromium/chromium that referenced this pull request Oct 18, 2024
Explainer: WICG/shared-storage#199

Key points:
- `SharedStorageWorkletNavigator` is a new interface that only
  supports `locks`. Implementation-wise, we inherit NavigatorBase
  so it's compatible with the LockManager implementation. Some
  methods are obviously unreachable (e.g. GetAcceptLanguages()).
- Add the member `LockManager<OriginLockGroupId> lock_manager_;` to
  SharedStorageWorkletHostManager: The locks have a shared storage
  specific scope (separate from the Window/Worker locks), and are
  further partitioned by shared storage origin.

Bug: 373899210
Change-Id: I9908962949088356c2a61c1556183ccd5772985f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5937903
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1370865}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 18, 2024
Explainer: WICG/shared-storage#199

Key points:
- `SharedStorageWorkletNavigator` is a new interface that only
  supports `locks`. Implementation-wise, we inherit NavigatorBase
  so it's compatible with the LockManager implementation. Some
  methods are obviously unreachable (e.g. GetAcceptLanguages()).
- Add the member `LockManager<OriginLockGroupId> lock_manager_;` to
  SharedStorageWorkletHostManager: The locks have a shared storage
  specific scope (separate from the Window/Worker locks), and are
  further partitioned by shared storage origin.

Bug: 373899210
Change-Id: I9908962949088356c2a61c1556183ccd5772985f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5937903
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1370865}
aarongable pushed a commit to chromium/chromium that referenced this pull request Jan 3, 2025
Add sharedStorage.batchUpdate() function. Parse arguments into
the 'methods' sequence and a 'with_lock' optional flag, and
propagate the result to the browser process to invoke the
`SharedStorageLockManager::SharedStorageBatchUpdate()` API.

This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
Lock integration proposal:
- WICG/shared-storage#199
- WICG/shared-storage#205

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 373899210
Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401673}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 3, 2025
Add sharedStorage.batchUpdate() function. Parse arguments into
the 'methods' sequence and a 'with_lock' optional flag, and
propagate the result to the browser process to invoke the
`SharedStorageLockManager::SharedStorageBatchUpdate()` API.

This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
Lock integration proposal:
- WICG/shared-storage#199
- WICG/shared-storage#205

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 373899210
Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401673}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 3, 2025
Add sharedStorage.batchUpdate() function. Parse arguments into
the 'methods' sequence and a 'with_lock' optional flag, and
propagate the result to the browser process to invoke the
`SharedStorageLockManager::SharedStorageBatchUpdate()` API.

This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
Lock integration proposal:
- WICG/shared-storage#199
- WICG/shared-storage#205

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 373899210
Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401673}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 3, 2025
… worklet"

This reverts commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af.

Reason for revert: New tests are failing on linux-chromeos-dbg:

https://ci.chromium.org/ui/p/chromium/builders/ci/linux-chromeos-dbg/38480/test-results

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I46c27d924dae0684a07ec081095d8dbde970b6ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6123546
Owners-Override: Tim Sergeant <tsergeant@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tim Sergeant <tsergeant@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401696}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 3, 2025
… worklet"

This reverts commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af.

Reason for revert: New tests are failing on linux-chromeos-dbg:

https://ci.chromium.org/ui/p/chromium/builders/ci/linux-chromeos-dbg/38480/test-results

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I46c27d924dae0684a07ec081095d8dbde970b6ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6123546
Owners-Override: Tim Sergeant <tsergeant@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tim Sergeant <tsergeant@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401696}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 8, 2025
… worklet"

This is a reland of commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af

The original CL incorrectly attempted to access
args[0].As<v8::Object>() even when the initial IDL validation
(args_converter.is_success() && !args[0]->IsObject()) failed. This
could lead to unpredictable behavior as args[0] might not be a valid
object. This reland fixes this by ensuring that
args[0].As<v8::Object>() is only accessed when
args_converter.is_success() is true.

Code changes: see the diff between Patchset 1 and Patchset 2

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I1782e6af1de95cc643053aa80c2a15f601da56a5
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 9, 2025
… worklet"

This is a reland of commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af

The original CL incorrectly attempted to access
args[0].As<v8::Object>() even when the initial IDL validation
(args_converter.is_success() && !args[0]->IsObject()) failed. This
could lead to unpredictable behavior as args[0] might not be a valid
object. This reland fixes this by ensuring that
args[0].As<v8::Object>() is only accessed when
args_converter.is_success() is true.

Code changes: see the diff between Patchset 1 and Patchset 2

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I1782e6af1de95cc643053aa80c2a15f601da56a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6132126
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403952}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 9, 2025
… worklet"

This is a reland of commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af

The original CL incorrectly attempted to access
args[0].As<v8::Object>() even when the initial IDL validation
(args_converter.is_success() && !args[0]->IsObject()) failed. This
could lead to unpredictable behavior as args[0] might not be a valid
object. This reland fixes this by ensuring that
args[0].As<v8::Object>() is only accessed when
args_converter.is_success() is true.

Code changes: see the diff between Patchset 1 and Patchset 2

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I1782e6af1de95cc643053aa80c2a15f601da56a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6132126
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403952}
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jan 10, 2025
….batchUpdate() for PA worklet, a=testonly

Automatic update from web-platform-tests
[shared storage] Implement sharedStorage.batchUpdate() for PA worklet

Add sharedStorage.batchUpdate() function. Parse arguments into
the 'methods' sequence and a 'with_lock' optional flag, and
propagate the result to the browser process to invoke the
`SharedStorageLockManager::SharedStorageBatchUpdate()` API.

This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
Lock integration proposal:
- WICG/shared-storage#199
- WICG/shared-storage#205

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 373899210
Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401673}

--

wpt-commits: 078605da614507d4428c3cc92040ad750959018f
wpt-pr: 49893
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jan 10, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Revert "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This reverts commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af.

Reason for revert: New tests are failing on linux-chromeos-dbg:

https://ci.chromium.org/ui/p/chromium/builders/ci/linux-chromeos-dbg/38480/test-results

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I46c27d924dae0684a07ec081095d8dbde970b6ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6123546
Owners-Override: Tim Sergeant <tsergeant@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tim Sergeant <tsergeant@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401696}

--

wpt-commits: 7ceee79ca23ba6491a966206a7a6c34c3738fe60
wpt-pr: 49895
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jan 10, 2025
….batchUpdate() for PA worklet, a=testonly

Automatic update from web-platform-tests
[shared storage] Implement sharedStorage.batchUpdate() for PA worklet

Add sharedStorage.batchUpdate() function. Parse arguments into
the 'methods' sequence and a 'with_lock' optional flag, and
propagate the result to the browser process to invoke the
`SharedStorageLockManager::SharedStorageBatchUpdate()` API.

This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
Lock integration proposal:
- WICG/shared-storage#199
- WICG/shared-storage#205

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 373899210
Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401673}

--

wpt-commits: 078605da614507d4428c3cc92040ad750959018f
wpt-pr: 49893
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jan 10, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Revert "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This reverts commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af.

Reason for revert: New tests are failing on linux-chromeos-dbg:

https://ci.chromium.org/ui/p/chromium/builders/ci/linux-chromeos-dbg/38480/test-results

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I46c27d924dae0684a07ec081095d8dbde970b6ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6123546
Owners-Override: Tim Sergeant <tsergeant@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tim Sergeant <tsergeant@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401696}

--

wpt-commits: 7ceee79ca23ba6491a966206a7a6c34c3738fe60
wpt-pr: 49895
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jan 13, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Reland "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This is a reland of commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af

The original CL incorrectly attempted to access
args[0].As<v8::Object>() even when the initial IDL validation
(args_converter.is_success() && !args[0]->IsObject()) failed. This
could lead to unpredictable behavior as args[0] might not be a valid
object. This reland fixes this by ensuring that
args[0].As<v8::Object>() is only accessed when
args_converter.is_success() is true.

Code changes: see the diff between Patchset 1 and Patchset 2

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I1782e6af1de95cc643053aa80c2a15f601da56a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6132126
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403952}

--

wpt-commits: 7d409e8d192247cc8131665c486977213b925257
wpt-pr: 49976
sadym-chromium pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 14, 2025
Add sharedStorage.batchUpdate() function. Parse arguments into
the 'methods' sequence and a 'with_lock' optional flag, and
propagate the result to the browser process to invoke the
`SharedStorageLockManager::SharedStorageBatchUpdate()` API.

This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
Lock integration proposal:
- WICG/shared-storage#199
- WICG/shared-storage#205

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 373899210
Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401673}
sadym-chromium pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 14, 2025
… worklet"

This reverts commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af.

Reason for revert: New tests are failing on linux-chromeos-dbg:

https://ci.chromium.org/ui/p/chromium/builders/ci/linux-chromeos-dbg/38480/test-results

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I46c27d924dae0684a07ec081095d8dbde970b6ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6123546
Owners-Override: Tim Sergeant <tsergeant@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tim Sergeant <tsergeant@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401696}
sadym-chromium pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 14, 2025
… worklet"

This is a reland of commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af

The original CL incorrectly attempted to access
args[0].As<v8::Object>() even when the initial IDL validation
(args_converter.is_success() && !args[0]->IsObject()) failed. This
could lead to unpredictable behavior as args[0] might not be a valid
object. This reland fixes this by ensuring that
args[0].As<v8::Object>() is only accessed when
args_converter.is_success() is true.

Code changes: see the diff between Patchset 1 and Patchset 2

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I1782e6af1de95cc643053aa80c2a15f601da56a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6132126
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403952}
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jan 14, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Reland "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This is a reland of commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af

The original CL incorrectly attempted to access
args[0].As<v8::Object>() even when the initial IDL validation
(args_converter.is_success() && !args[0]->IsObject()) failed. This
could lead to unpredictable behavior as args[0] might not be a valid
object. This reland fixes this by ensuring that
args[0].As<v8::Object>() is only accessed when
args_converter.is_success() is true.

Code changes: see the diff between Patchset 1 and Patchset 2

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1401673}

Bug: 373899210
Change-Id: I1782e6af1de95cc643053aa80c2a15f601da56a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6132126
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403952}

--

wpt-commits: 7d409e8d192247cc8131665c486977213b925257
wpt-pr: 49976
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jan 16, 2025
….batchUpdate() for PA worklet, a=testonly

Automatic update from web-platform-tests
[shared storage] Implement sharedStorage.batchUpdate() for PA worklet

Add sharedStorage.batchUpdate() function. Parse arguments into
the 'methods' sequence and a 'with_lock' optional flag, and
propagate the result to the browser process to invoke the
`SharedStorageLockManager::SharedStorageBatchUpdate()` API.

This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
Lock integration proposal:
- WICG/shared-storage#199
- WICG/shared-storage#205

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 373899210
Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Reviewed-by: Maks Orlovich <morlovichchromium.org>
Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
Cr-Commit-Position: refs/heads/main{#1401673}

--

wpt-commits: 078605da614507d4428c3cc92040ad750959018f
wpt-pr: 49893

UltraBlame original commit: 6c9bb3d400ca57aa2228bc148ec78a317433e0bc
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jan 16, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Revert "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This reverts commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af.

Reason for revert: New tests are failing on linux-chromeos-dbg:

https://ci.chromium.org/ui/p/chromium/builders/ci/linux-chromeos-dbg/38480/test-results

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxiachromium.org>
> Reviewed-by: Maks Orlovich <morlovichchromium.org>
> Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
> Cr-Commit-Position: refs/heads/main{#1401673}

Bug: 373899210
Change-Id: I46c27d924dae0684a07ec081095d8dbde970b6ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6123546
Owners-Override: Tim Sergeant <tsergeantchromium.org>
Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com>
Commit-Queue: Tim Sergeant <tsergeantchromium.org>
Cr-Commit-Position: refs/heads/main{#1401696}

--

wpt-commits: 7ceee79ca23ba6491a966206a7a6c34c3738fe60
wpt-pr: 49895

UltraBlame original commit: 6cd08500ad8b64636cf150d3d9d253e48705bedd
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jan 16, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Reland "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This is a reland of commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af

The original CL incorrectly attempted to access
args[0].As<v8::Object>() even when the initial IDL validation
(args_converter.is_success() && !args[0]->IsObject()) failed. This
could lead to unpredictable behavior as args[0] might not be a valid
object. This reland fixes this by ensuring that
args[0].As<v8::Object>() is only accessed when
args_converter.is_success() is true.

Code changes: see the diff between Patchset 1 and Patchset 2

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxiachromium.org>
> Reviewed-by: Maks Orlovich <morlovichchromium.org>
> Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
> Cr-Commit-Position: refs/heads/main{#1401673}

Bug: 373899210
Change-Id: I1782e6af1de95cc643053aa80c2a15f601da56a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6132126
Reviewed-by: Maks Orlovich <morlovichchromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Cr-Commit-Position: refs/heads/main{#1403952}

--

wpt-commits: 7d409e8d192247cc8131665c486977213b925257
wpt-pr: 49976

UltraBlame original commit: 3a359b9243066e47f2bbe59b772e85fd2f96ed7d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jan 16, 2025
….batchUpdate() for PA worklet, a=testonly

Automatic update from web-platform-tests
[shared storage] Implement sharedStorage.batchUpdate() for PA worklet

Add sharedStorage.batchUpdate() function. Parse arguments into
the 'methods' sequence and a 'with_lock' optional flag, and
propagate the result to the browser process to invoke the
`SharedStorageLockManager::SharedStorageBatchUpdate()` API.

This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
Lock integration proposal:
- WICG/shared-storage#199
- WICG/shared-storage#205

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 373899210
Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Reviewed-by: Maks Orlovich <morlovichchromium.org>
Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
Cr-Commit-Position: refs/heads/main{#1401673}

--

wpt-commits: 078605da614507d4428c3cc92040ad750959018f
wpt-pr: 49893

UltraBlame original commit: 6c9bb3d400ca57aa2228bc148ec78a317433e0bc
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jan 16, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Revert "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This reverts commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af.

Reason for revert: New tests are failing on linux-chromeos-dbg:

https://ci.chromium.org/ui/p/chromium/builders/ci/linux-chromeos-dbg/38480/test-results

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxiachromium.org>
> Reviewed-by: Maks Orlovich <morlovichchromium.org>
> Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
> Cr-Commit-Position: refs/heads/main{#1401673}

Bug: 373899210
Change-Id: I46c27d924dae0684a07ec081095d8dbde970b6ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6123546
Owners-Override: Tim Sergeant <tsergeantchromium.org>
Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com>
Commit-Queue: Tim Sergeant <tsergeantchromium.org>
Cr-Commit-Position: refs/heads/main{#1401696}

--

wpt-commits: 7ceee79ca23ba6491a966206a7a6c34c3738fe60
wpt-pr: 49895

UltraBlame original commit: 6cd08500ad8b64636cf150d3d9d253e48705bedd
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jan 16, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Reland "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This is a reland of commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af

The original CL incorrectly attempted to access
args[0].As<v8::Object>() even when the initial IDL validation
(args_converter.is_success() && !args[0]->IsObject()) failed. This
could lead to unpredictable behavior as args[0] might not be a valid
object. This reland fixes this by ensuring that
args[0].As<v8::Object>() is only accessed when
args_converter.is_success() is true.

Code changes: see the diff between Patchset 1 and Patchset 2

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxiachromium.org>
> Reviewed-by: Maks Orlovich <morlovichchromium.org>
> Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
> Cr-Commit-Position: refs/heads/main{#1401673}

Bug: 373899210
Change-Id: I1782e6af1de95cc643053aa80c2a15f601da56a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6132126
Reviewed-by: Maks Orlovich <morlovichchromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Cr-Commit-Position: refs/heads/main{#1403952}

--

wpt-commits: 7d409e8d192247cc8131665c486977213b925257
wpt-pr: 49976

UltraBlame original commit: 3a359b9243066e47f2bbe59b772e85fd2f96ed7d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 16, 2025
….batchUpdate() for PA worklet, a=testonly

Automatic update from web-platform-tests
[shared storage] Implement sharedStorage.batchUpdate() for PA worklet

Add sharedStorage.batchUpdate() function. Parse arguments into
the 'methods' sequence and a 'with_lock' optional flag, and
propagate the result to the browser process to invoke the
`SharedStorageLockManager::SharedStorageBatchUpdate()` API.

This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
Lock integration proposal:
- WICG/shared-storage#199
- WICG/shared-storage#205

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 373899210
Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Reviewed-by: Maks Orlovich <morlovichchromium.org>
Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
Cr-Commit-Position: refs/heads/main{#1401673}

--

wpt-commits: 078605da614507d4428c3cc92040ad750959018f
wpt-pr: 49893

UltraBlame original commit: 6c9bb3d400ca57aa2228bc148ec78a317433e0bc
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 16, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Revert "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This reverts commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af.

Reason for revert: New tests are failing on linux-chromeos-dbg:

https://ci.chromium.org/ui/p/chromium/builders/ci/linux-chromeos-dbg/38480/test-results

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxiachromium.org>
> Reviewed-by: Maks Orlovich <morlovichchromium.org>
> Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
> Cr-Commit-Position: refs/heads/main{#1401673}

Bug: 373899210
Change-Id: I46c27d924dae0684a07ec081095d8dbde970b6ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6123546
Owners-Override: Tim Sergeant <tsergeantchromium.org>
Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com>
Commit-Queue: Tim Sergeant <tsergeantchromium.org>
Cr-Commit-Position: refs/heads/main{#1401696}

--

wpt-commits: 7ceee79ca23ba6491a966206a7a6c34c3738fe60
wpt-pr: 49895

UltraBlame original commit: 6cd08500ad8b64636cf150d3d9d253e48705bedd
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 16, 2025
…dStorage.batchUpdate() for PA worklet", a=testonly

Automatic update from web-platform-tests
Reland "[shared storage] Implement sharedStorage.batchUpdate() for PA worklet"

This is a reland of commit f0cab8e2346b2a62aa3be1d5a41ec7737bf335af

The original CL incorrectly attempted to access
args[0].As<v8::Object>() even when the initial IDL validation
(args_converter.is_success() && !args[0]->IsObject()) failed. This
could lead to unpredictable behavior as args[0] might not be a valid
object. This reland fixes this by ensuring that
args[0].As<v8::Object>() is only accessed when
args_converter.is_success() is true.

Code changes: see the diff between Patchset 1 and Patchset 2

Original change's description:
> [shared storage] Implement sharedStorage.batchUpdate() for PA worklet
>
> Add sharedStorage.batchUpdate() function. Parse arguments into
> the 'methods' sequence and a 'with_lock' optional flag, and
> propagate the result to the browser process to invoke the
> `SharedStorageLockManager::SharedStorageBatchUpdate()` API.
>
> This allows developers to perform multiple Shared Storage operations atomically within a single lock, as part of the Web
> Lock integration proposal:
> - WICG/shared-storage#199
> - WICG/shared-storage#205
>
> Fuchsia-Binary-Size: Size increase is unavoidable.
> Bug: 373899210
> Change-Id: Ic6e9f794d78523ec9f6b87f37fb5e91f17635c58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072850
> Commit-Queue: Yao Xiao <yaoxiachromium.org>
> Reviewed-by: Maks Orlovich <morlovichchromium.org>
> Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
> Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
> Cr-Commit-Position: refs/heads/main{#1401673}

Bug: 373899210
Change-Id: I1782e6af1de95cc643053aa80c2a15f601da56a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6132126
Reviewed-by: Maks Orlovich <morlovichchromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org>
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Cr-Commit-Position: refs/heads/main{#1403952}

--

wpt-commits: 7d409e8d192247cc8131665c486977213b925257
wpt-pr: 49976

UltraBlame original commit: 3a359b9243066e47f2bbe59b772e85fd2f96ed7d
stevenmcdonald pushed a commit to stevenmcdonald/chromium that referenced this pull request Jun 3, 2025
… headers

Explainer PR(s):
- WICG/shared-storage#199
- WICG/shared-storage#205

How:
- Add the parameter parsing logic in the network service, and send the
  final request to the browser process's central
  SharedStorageLockManager component.
- Since SharedStorageLockManager::SharedStorageUpdate() hides the
  exact database result, we update observer's OnMethodFinished()'s
  parameters accordingly. In the test observer, the error message is
  further transformed into a boolean 'success' result. This callback
  is only used in tests and it's not important to assert the detailed
  result anyway.
- A new test, `SharedStorageHeaderObserverTest.Append_NoCapacity`,
  has been added to demonstrate the case where `SharedStorageUpdate`
  encounters an error.

Bug: 373899210
Change-Id: I4588c83174d465e7248cc1f41c9b7a693aa326f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6042601
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1388298}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants