-
Notifications
You must be signed in to change notification settings - Fork 25
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
Handle Shared-Storage-Write as a single batchUpdate(); Respect withLo… #205
Conversation
…ck for inner methods within batchUpdate() Two revisions to our initial proposal: 1. Our initial proposal included individual methods like set(), append(), delete(), and clear(), alongside a batchUpdate() method requiring a serialized string for its `methods` parameter. To make things simpler, we revise the proposal to treat everything as a single batchUpdate(). 2. Our initial proposal ignored the `withLock` option for individual methods within a batchUpdate() operation. This approach lacked flexibility and could lead to unintended behavior, as developers might assume the lock should still be acquired. We've revised the proposal to respect the `withLock` option for each individual method within the batch.
@pythagoraskitty / @jkarlin : PTAL. Thanks! |
Should there be any updates to the examples section for response headers? Otherwise I think it is looking good % my question above. I will take another pass if you make more changes. :) |
Updated to using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm w/ comment
…d SharedStorageWorklet Implement the { withLock: <lock resource name> } option for the modifier methods for Window and SharedStorageWorklet context. The SharedStorageLockManager manages the state of the locks and locked requests. It acts as the LockRequest receiver to listen to Granted() calls to resolve those requests. The locks uses the shared storage origin as the partitioning origin, and thus can interact with the regular Web Locks API (i.e. navigator.locks.request()) from within the shared storage worklet. The locking function is gated behind features::kSharedStorageWebLocks, which is checked in the browser process in SharedStorageLockManager::SharedStorageUpdate(). Explainer PR(s): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I7003d392076a65a9ff2d277f9f0c2791436d2f68
…d SharedStorageWorklet Implement the { withLock: <lock resource name> } option for the modifier methods for Window and SharedStorageWorklet context. The SharedStorageLockManager manages the state of the locks and locked requests. It acts as the LockRequest receiver to listen to Granted() calls to resolve those requests. The locks uses the shared storage origin as the partitioning origin, and thus can interact with the regular Web Locks API (i.e. navigator.locks.request()) from within the shared storage worklet. The locking function is gated behind features::kSharedStorageWebLocks, which is checked in the browser process in SharedStorageLockManager::SharedStorageUpdate(). Explainer PR(s): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I7003d392076a65a9ff2d277f9f0c2791436d2f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020796 Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/main@{#1387751}
…d SharedStorageWorklet Implement the { withLock: <lock resource name> } option for the modifier methods for Window and SharedStorageWorklet context. The SharedStorageLockManager manages the state of the locks and locked requests. It acts as the LockRequest receiver to listen to Granted() calls to resolve those requests. The locks uses the shared storage origin as the partitioning origin, and thus can interact with the regular Web Locks API (i.e. navigator.locks.request()) from within the shared storage worklet. The locking function is gated behind features::kSharedStorageWebLocks, which is checked in the browser process in SharedStorageLockManager::SharedStorageUpdate(). Explainer PR(s): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I7003d392076a65a9ff2d277f9f0c2791436d2f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020796 Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/main@{#1387751}
…d SharedStorageWorklet Implement the { withLock: <lock resource name> } option for the modifier methods for Window and SharedStorageWorklet context. The SharedStorageLockManager manages the state of the locks and locked requests. It acts as the LockRequest receiver to listen to Granted() calls to resolve those requests. The locks uses the shared storage origin as the partitioning origin, and thus can interact with the regular Web Locks API (i.e. navigator.locks.request()) from within the shared storage worklet. The locking function is gated behind features::kSharedStorageWebLocks, which is checked in the browser process in SharedStorageLockManager::SharedStorageUpdate(). Explainer PR(s): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I7003d392076a65a9ff2d277f9f0c2791436d2f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020796 Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/main@{#1387751}
… 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}
… 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}
…odifier options for Window and SharedStorageWorklet, a=testonly Automatic update from web-platform-tests [shared storage] Implement 'with_lock' modifier options for Window and SharedStorageWorklet Implement the { withLock: <lock resource name> } option for the modifier methods for Window and SharedStorageWorklet context. The SharedStorageLockManager manages the state of the locks and locked requests. It acts as the LockRequest receiver to listen to Granted() calls to resolve those requests. The locks uses the shared storage origin as the partitioning origin, and thus can interact with the regular Web Locks API (i.e. navigator.locks.request()) from within the shared storage worklet. The locking function is gated behind features::kSharedStorageWebLocks, which is checked in the browser process in SharedStorageLockManager::SharedStorageUpdate(). Explainer PR(s): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I7003d392076a65a9ff2d277f9f0c2791436d2f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020796 Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/main@{#1387751} -- wpt-commits: 7e168195e3629f88bef6293c18ae8674f90893fd wpt-pr: 49359
…ion for methods from response headers, a=testonly Automatic update from web-platform-tests [shared storage] Implement with_lock option for methods from response 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} -- wpt-commits: 7658fedd9f51c501150e3b70705e48e81887a095 wpt-pr: 49376
…odifier options for Window and SharedStorageWorklet, a=testonly Automatic update from web-platform-tests [shared storage] Implement 'with_lock' modifier options for Window and SharedStorageWorklet Implement the { withLock: <lock resource name> } option for the modifier methods for Window and SharedStorageWorklet context. The SharedStorageLockManager manages the state of the locks and locked requests. It acts as the LockRequest receiver to listen to Granted() calls to resolve those requests. The locks uses the shared storage origin as the partitioning origin, and thus can interact with the regular Web Locks API (i.e. navigator.locks.request()) from within the shared storage worklet. The locking function is gated behind features::kSharedStorageWebLocks, which is checked in the browser process in SharedStorageLockManager::SharedStorageUpdate(). Explainer PR(s): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I7003d392076a65a9ff2d277f9f0c2791436d2f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020796 Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/main@{#1387751} -- wpt-commits: 7e168195e3629f88bef6293c18ae8674f90893fd wpt-pr: 49359
…ion for methods from response headers, a=testonly Automatic update from web-platform-tests [shared storage] Implement with_lock option for methods from response 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} -- wpt-commits: 7658fedd9f51c501150e3b70705e48e81887a095 wpt-pr: 49376
…odifier options for Window and SharedStorageWorklet, a=testonly Automatic update from web-platform-tests [shared storage] Implement 'with_lock' modifier options for Window and SharedStorageWorklet Implement the { withLock: <lock resource name> } option for the modifier methods for Window and SharedStorageWorklet context. The SharedStorageLockManager manages the state of the locks and locked requests. It acts as the LockRequest receiver to listen to Granted() calls to resolve those requests. The locks uses the shared storage origin as the partitioning origin, and thus can interact with the regular Web Locks API (i.e. navigator.locks.request()) from within the shared storage worklet. The locking function is gated behind features::kSharedStorageWebLocks, which is checked in the browser process in SharedStorageLockManager::SharedStorageUpdate(). Explainer PR(s): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I7003d392076a65a9ff2d277f9f0c2791436d2f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020796 Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org> Commit-Queue: Yao Xiao <yaoxiachromium.org> Cr-Commit-Position: refs/heads/main{#1387751} -- wpt-commits: 7e168195e3629f88bef6293c18ae8674f90893fd wpt-pr: 49359 UltraBlame original commit: 452dfd2d01858996047826957a14f49748455f2f
…ion for methods from response headers, a=testonly Automatic update from web-platform-tests [shared storage] Implement with_lock option for methods from response 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 <garykacchromium.org> Commit-Queue: Yao Xiao <yaoxiachromium.org> Reviewed-by: Cammie Smith Barnes <cammiechromium.org> Reviewed-by: Kenichi Ishibashi <bashichromium.org> Reviewed-by: Hidehiko Abe <hidehikochromium.org> Reviewed-by: Joe Mason <joenotcharlesgoogle.com> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Cr-Commit-Position: refs/heads/main{#1388298} -- wpt-commits: 7658fedd9f51c501150e3b70705e48e81887a095 wpt-pr: 49376 UltraBlame original commit: 880a4df5d51660e9cb2d441528e85800b42a9315
…odifier options for Window and SharedStorageWorklet, a=testonly Automatic update from web-platform-tests [shared storage] Implement 'with_lock' modifier options for Window and SharedStorageWorklet Implement the { withLock: <lock resource name> } option for the modifier methods for Window and SharedStorageWorklet context. The SharedStorageLockManager manages the state of the locks and locked requests. It acts as the LockRequest receiver to listen to Granted() calls to resolve those requests. The locks uses the shared storage origin as the partitioning origin, and thus can interact with the regular Web Locks API (i.e. navigator.locks.request()) from within the shared storage worklet. The locking function is gated behind features::kSharedStorageWebLocks, which is checked in the browser process in SharedStorageLockManager::SharedStorageUpdate(). Explainer PR(s): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I7003d392076a65a9ff2d277f9f0c2791436d2f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020796 Reviewed-by: Giovanni Ortuno Urquidi <ortunochromium.org> Commit-Queue: Yao Xiao <yaoxiachromium.org> Cr-Commit-Position: refs/heads/main{#1387751} -- wpt-commits: 7e168195e3629f88bef6293c18ae8674f90893fd wpt-pr: 49359 UltraBlame original commit: 452dfd2d01858996047826957a14f49748455f2f
…ion for methods from response headers, a=testonly Automatic update from web-platform-tests [shared storage] Implement with_lock option for methods from response 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 <garykacchromium.org> Commit-Queue: Yao Xiao <yaoxiachromium.org> Reviewed-by: Cammie Smith Barnes <cammiechromium.org> Reviewed-by: Kenichi Ishibashi <bashichromium.org> Reviewed-by: Hidehiko Abe <hidehikochromium.org> Reviewed-by: Joe Mason <joenotcharlesgoogle.com> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Cr-Commit-Position: refs/heads/main{#1388298} -- wpt-commits: 7658fedd9f51c501150e3b70705e48e81887a095 wpt-pr: 49376 UltraBlame original commit: 880a4df5d51660e9cb2d441528e85800b42a9315
Implement the constructor for `SharedStorageSetMethod`, etc. The error handling logic mirrors the existing sharedStorage.set(), etc. To allow code reuse, the sharedStorage.set(), etc. methods now creates the object and early return on exceptions. Note that even though we no longer explicitly call resolver->Reject() for sharedStorage.set(), etc., Chrome still converts thrown exceptions to rejected promises (to adhere to the specification [1]), so the end result is the same. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 [1] https://w3ctag.github.io/promises-guide/#always-return-promises Bug: 373899210 Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138
Implement the constructor for `SharedStorageSetMethod`, etc. The error handling logic mirrors the existing sharedStorage.set(), etc. To allow code reuse, the sharedStorage.set(), etc. methods now creates the object and early return on exceptions. Note that even though we no longer explicitly call resolver->Reject() for sharedStorage.set(), etc., Chrome still converts thrown exceptions to rejected promises (to adhere to the specification [1]), so the end result is the same. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 [1] https://w3ctag.github.io/promises-guide/#always-return-promises Bug: 373899210 Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054694 Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1390779}
Implement the constructor for `SharedStorageSetMethod`, etc. The error handling logic mirrors the existing sharedStorage.set(), etc. To allow code reuse, the sharedStorage.set(), etc. methods now creates the object and early return on exceptions. Note that even though we no longer explicitly call resolver->Reject() for sharedStorage.set(), etc., Chrome still converts thrown exceptions to rejected promises (to adhere to the specification [1]), so the end result is the same. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 [1] https://w3ctag.github.io/promises-guide/#always-return-promises Bug: 373899210 Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054694 Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1390779}
Implement the constructor for `SharedStorageSetMethod`, etc. The error handling logic mirrors the existing sharedStorage.set(), etc. To allow code reuse, the sharedStorage.set(), etc. methods now creates the object and early return on exceptions. Note that even though we no longer explicitly call resolver->Reject() for sharedStorage.set(), etc., Chrome still converts thrown exceptions to rejected promises (to adhere to the specification [1]), so the end result is the same. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 [1] https://w3ctag.github.io/promises-guide/#always-return-promises Bug: 373899210 Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054694 Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1390779}
…orklet Implement the constructor for `SharedStorageSetMethod`, etc in PA worklet. The error handling logic mirrors the existing sharedStorage.set(), etc. Drive-by: fix an ordering issue between IDL error and permissions policy error. The IDL error should be reported first. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I42563d7e5c2b6d705b015579b72f7254e2dfa11f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6060413 Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by: Nate Chapin <japhet@chromium.org> Reviewed-by: Maks Orlovich <morlovich@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391782}
Introduce a new `SharedStorageModifierMethod` IDL interface that is inherited by individual methods. This prepares for a follow-up change to add the `batchUpdate(methods)` API, as part of the Web Locks integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: Id6e21c87c4c58bc2cadd1afb28e528243e800e72 Fuchsia-Binary-Size: Size increase is unavoidable. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6069826 Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391791}
…Worklet context 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 How: - Add `batchUpdate(methods, options)` to the `SharedStorage` interface. - Hooks up the `batchUpdate()` method to the `SharedStorageLockManager::SharedStorageBatchUpdate()` API in the browser process. Bug: 373899210 Fuchsia-Binary-Size: Size increase is unavoidable. Change-Id: I0e1b355e3b3d28518396ae4333afe21e6d02e858
…Worklet context 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 How: - Add `batchUpdate(methods, options)` to the `SharedStorage` interface. - Hooks up the `batchUpdate()` method to the `SharedStorageLockManager::SharedStorageBatchUpdate()` API in the browser process. Bug: 373899210 Fuchsia-Binary-Size: Size increase is unavoidable. Change-Id: I0e1b355e3b3d28518396ae4333afe21e6d02e858 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6069087 Reviewed-by: Ayu Ishii <ayui@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391933}
…Worklet context 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 How: - Add `batchUpdate(methods, options)` to the `SharedStorage` interface. - Hooks up the `batchUpdate()` method to the `SharedStorageLockManager::SharedStorageBatchUpdate()` API in the browser process. Bug: 373899210 Fuchsia-Binary-Size: Size increase is unavoidable. Change-Id: I0e1b355e3b3d28518396ae4333afe21e6d02e858 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6069087 Reviewed-by: Ayu Ishii <ayui@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391933}
…pend/Delete/Clear IDL Interface, a=testonly Automatic update from web-platform-tests [shared storage] Add SharedStorageSet/Append/Delete/Clear IDL Interface Implement the constructor for `SharedStorageSetMethod`, etc. The error handling logic mirrors the existing sharedStorage.set(), etc. To allow code reuse, the sharedStorage.set(), etc. methods now creates the object and early return on exceptions. Note that even though we no longer explicitly call resolver->Reject() for sharedStorage.set(), etc., Chrome still converts thrown exceptions to rejected promises (to adhere to the specification [1]), so the end result is the same. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 [1] https://w3ctag.github.io/promises-guide/#always-return-promises Bug: 373899210 Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054694 Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1390779} -- wpt-commits: 6a83407ba15135836db19928b90a225bf74eaa1d wpt-pr: 49486
…pend/Delete/Clear IDL Interface, a=testonly Automatic update from web-platform-tests [shared storage] Add SharedStorageSet/Append/Delete/Clear IDL Interface Implement the constructor for `SharedStorageSetMethod`, etc. The error handling logic mirrors the existing sharedStorage.set(), etc. To allow code reuse, the sharedStorage.set(), etc. methods now creates the object and early return on exceptions. Note that even though we no longer explicitly call resolver->Reject() for sharedStorage.set(), etc., Chrome still converts thrown exceptions to rejected promises (to adhere to the specification [1]), so the end result is the same. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 [1] https://w3ctag.github.io/promises-guide/#always-return-promises Bug: 373899210 Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054694 Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1390779} -- wpt-commits: 6a83407ba15135836db19928b90a225bf74eaa1d wpt-pr: 49486
…rklet Introduce `SharedStorageModifierMethod` interface to PA worklet, that is inherited by individual methods. This is the proposed hierarchy, as part of the Web Locks integration proposal (e.g., This allows the IDL parameter to be written as sequence<SharedStorageModifierMethod>, and also allows the Blink class to store mojom object in the base class): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I2c83574bf9b87ab7c0cb9e6e4c656e742415b49f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072666 Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Commit-Queue: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1393929}
…rklet Introduce `SharedStorageModifierMethod` interface to PA worklet, that is inherited by individual methods. This is the proposed hierarchy, as part of the Web Locks integration proposal (e.g., This allows the IDL parameter to be written as sequence<SharedStorageModifierMethod>, and also allows the Blink class to store mojom object in the base class): - WICG/shared-storage#199 - WICG/shared-storage#205 Bug: 373899210 Change-Id: I2c83574bf9b87ab7c0cb9e6e4c656e742415b49f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072666 Reviewed-by: Maks Orlovich <morlovich@chromium.org> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Commit-Queue: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1393929}
… for Window and SharedStorageWorklet context, a=testonly Automatic update from web-platform-tests [shared storage] Implement batchUpdate() for Window and SharedStorageWorklet context 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 How: - Add `batchUpdate(methods, options)` to the `SharedStorage` interface. - Hooks up the `batchUpdate()` method to the `SharedStorageLockManager::SharedStorageBatchUpdate()` API in the browser process. Bug: 373899210 Fuchsia-Binary-Size: Size increase is unavoidable. Change-Id: I0e1b355e3b3d28518396ae4333afe21e6d02e858 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6069087 Reviewed-by: Ayu Ishii <ayui@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391933} -- wpt-commits: d54d933593b96018172d332ece95dcec9839a059 wpt-pr: 49533
… for Window and SharedStorageWorklet context, a=testonly Automatic update from web-platform-tests [shared storage] Implement batchUpdate() for Window and SharedStorageWorklet context 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 How: - Add `batchUpdate(methods, options)` to the `SharedStorage` interface. - Hooks up the `batchUpdate()` method to the `SharedStorageLockManager::SharedStorageBatchUpdate()` API in the browser process. Bug: 373899210 Fuchsia-Binary-Size: Size increase is unavoidable. Change-Id: I0e1b355e3b3d28518396ae4333afe21e6d02e858 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6069087 Reviewed-by: Ayu Ishii <ayui@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391933} -- wpt-commits: d54d933593b96018172d332ece95dcec9839a059 wpt-pr: 49533
…pend/Delete/Clear IDL Interface, a=testonly Automatic update from web-platform-tests [shared storage] Add SharedStorageSet/Append/Delete/Clear IDL Interface Implement the constructor for `SharedStorageSetMethod`, etc. The error handling logic mirrors the existing sharedStorage.set(), etc. To allow code reuse, the sharedStorage.set(), etc. methods now creates the object and early return on exceptions. Note that even though we no longer explicitly call resolver->Reject() for sharedStorage.set(), etc., Chrome still converts thrown exceptions to rejected promises (to adhere to the specification [1]), so the end result is the same. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 [1] https://w3ctag.github.io/promises-guide/#always-return-promises Bug: 373899210 Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054694 Commit-Queue: Yao Xiao <yaoxiachromium.org> Reviewed-by: Cammie Smith Barnes <cammiechromium.org> Cr-Commit-Position: refs/heads/main{#1390779} -- wpt-commits: 6a83407ba15135836db19928b90a225bf74eaa1d wpt-pr: 49486 UltraBlame original commit: 74a0444ed16ec0d2ce28a726317fdf8b3b7e8338
… for Window and SharedStorageWorklet context, a=testonly Automatic update from web-platform-tests [shared storage] Implement batchUpdate() for Window and SharedStorageWorklet context 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 How: - Add `batchUpdate(methods, options)` to the `SharedStorage` interface. - Hooks up the `batchUpdate()` method to the `SharedStorageLockManager::SharedStorageBatchUpdate()` API in the browser process. Bug: 373899210 Fuchsia-Binary-Size: Size increase is unavoidable. Change-Id: I0e1b355e3b3d28518396ae4333afe21e6d02e858 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6069087 Reviewed-by: Ayu Ishii <ayuichromium.org> Commit-Queue: Yao Xiao <yaoxiachromium.org> Cr-Commit-Position: refs/heads/main{#1391933} -- wpt-commits: d54d933593b96018172d332ece95dcec9839a059 wpt-pr: 49533 UltraBlame original commit: 6c2624a1e4d570d1bc51c4e3323a0f575f6b51a2
…pend/Delete/Clear IDL Interface, a=testonly Automatic update from web-platform-tests [shared storage] Add SharedStorageSet/Append/Delete/Clear IDL Interface Implement the constructor for `SharedStorageSetMethod`, etc. The error handling logic mirrors the existing sharedStorage.set(), etc. To allow code reuse, the sharedStorage.set(), etc. methods now creates the object and early return on exceptions. Note that even though we no longer explicitly call resolver->Reject() for sharedStorage.set(), etc., Chrome still converts thrown exceptions to rejected promises (to adhere to the specification [1]), so the end result is the same. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 [1] https://w3ctag.github.io/promises-guide/#always-return-promises Bug: 373899210 Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054694 Commit-Queue: Yao Xiao <yaoxiachromium.org> Reviewed-by: Cammie Smith Barnes <cammiechromium.org> Cr-Commit-Position: refs/heads/main{#1390779} -- wpt-commits: 6a83407ba15135836db19928b90a225bf74eaa1d wpt-pr: 49486 UltraBlame original commit: 74a0444ed16ec0d2ce28a726317fdf8b3b7e8338
… for Window and SharedStorageWorklet context, a=testonly Automatic update from web-platform-tests [shared storage] Implement batchUpdate() for Window and SharedStorageWorklet context 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 How: - Add `batchUpdate(methods, options)` to the `SharedStorage` interface. - Hooks up the `batchUpdate()` method to the `SharedStorageLockManager::SharedStorageBatchUpdate()` API in the browser process. Bug: 373899210 Fuchsia-Binary-Size: Size increase is unavoidable. Change-Id: I0e1b355e3b3d28518396ae4333afe21e6d02e858 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6069087 Reviewed-by: Ayu Ishii <ayuichromium.org> Commit-Queue: Yao Xiao <yaoxiachromium.org> Cr-Commit-Position: refs/heads/main{#1391933} -- wpt-commits: d54d933593b96018172d332ece95dcec9839a059 wpt-pr: 49533 UltraBlame original commit: 6c2624a1e4d570d1bc51c4e3323a0f575f6b51a2
…pend/Delete/Clear IDL Interface, a=testonly Automatic update from web-platform-tests [shared storage] Add SharedStorageSet/Append/Delete/Clear IDL Interface Implement the constructor for `SharedStorageSetMethod`, etc. The error handling logic mirrors the existing sharedStorage.set(), etc. To allow code reuse, the sharedStorage.set(), etc. methods now creates the object and early return on exceptions. Note that even though we no longer explicitly call resolver->Reject() for sharedStorage.set(), etc., Chrome still converts thrown exceptions to rejected promises (to adhere to the specification [1]), so the end result is the same. This prepares for the implementation of the `sharedStorage.batchUpdate(methods)` method, as part of the Web Lock integration proposal: - WICG/shared-storage#199 - WICG/shared-storage#205 [1] https://w3ctag.github.io/promises-guide/#always-return-promises Bug: 373899210 Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054694 Commit-Queue: Yao Xiao <yaoxiachromium.org> Reviewed-by: Cammie Smith Barnes <cammiechromium.org> Cr-Commit-Position: refs/heads/main{#1390779} -- wpt-commits: 6a83407ba15135836db19928b90a225bf74eaa1d wpt-pr: 49486 UltraBlame original commit: 74a0444ed16ec0d2ce28a726317fdf8b3b7e8338
… for Window and SharedStorageWorklet context, a=testonly Automatic update from web-platform-tests [shared storage] Implement batchUpdate() for Window and SharedStorageWorklet context 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 How: - Add `batchUpdate(methods, options)` to the `SharedStorage` interface. - Hooks up the `batchUpdate()` method to the `SharedStorageLockManager::SharedStorageBatchUpdate()` API in the browser process. Bug: 373899210 Fuchsia-Binary-Size: Size increase is unavoidable. Change-Id: I0e1b355e3b3d28518396ae4333afe21e6d02e858 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6069087 Reviewed-by: Ayu Ishii <ayuichromium.org> Commit-Queue: Yao Xiao <yaoxiachromium.org> Cr-Commit-Position: refs/heads/main{#1391933} -- wpt-commits: d54d933593b96018172d332ece95dcec9839a059 wpt-pr: 49533 UltraBlame original commit: 6c2624a1e4d570d1bc51c4e3323a0f575f6b51a2
…header Parse "options;with_lock=xxx" into the `with_lock` parameter. If multiple "options" Items appear in the List, the last one will be used. The parsed value is passed to the browser process's `BatchUpdate()` API in the lock manager. 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 Bug: 373899210 Change-Id: Id041e92075b22988656a3db4f1a74792312ee422
…header Parse "options;with_lock=xxx" into the `with_lock` parameter. If multiple "options" Items appear in the List, the last one will be used. The parsed value is passed to the browser process's `BatchUpdate()` API in the lock manager. 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 Bug: 373899210 Change-Id: Id041e92075b22988656a3db4f1a74792312ee422 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072742 Reviewed-by: Gary Kacmarcik <garykac@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by: Joe Mason <joenotcharles@google.com> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Reviewed-by: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/main@{#1397664}
…header Parse "options;with_lock=xxx" into the `with_lock` parameter. If multiple "options" Items appear in the List, the last one will be used. The parsed value is passed to the browser process's `BatchUpdate()` API in the lock manager. 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 Bug: 373899210 Change-Id: Id041e92075b22988656a3db4f1a74792312ee422 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072742 Reviewed-by: Gary Kacmarcik <garykac@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by: Joe Mason <joenotcharles@google.com> Reviewed-by: Cammie Smith Barnes <cammie@chromium.org> Reviewed-by: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/main@{#1397664}
…ck for inner methods within batchUpdate()
Two revisions to our initial proposal:
For
Shared-Storage-Write
, our initial proposal included individual methods like set(), append(), delete(), and clear(), alongside a batchUpdate() method requiring a serialized string for itsmethods
parameter. To make things simpler, we revise the proposal to treat everything as a single batchUpdate(). It's backward compatible.Our initial proposal ignored the
withLock
option for individual methods within a batchUpdate() operation. This approach lacked flexibility and could lead to unintended behavior, as developers might assume the lock should still be acquired. We've revised the proposal to respect thewithLock
option for each individual method within the batch.