-
Notifications
You must be signed in to change notification settings - Fork 142
[worklets] Queue a task to reject addModule() #967
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
Conversation
This is a follow-up patch for w3c#958. A task to reject addModule() should be queued with script's error to rethrow to run on the thread where addModule() is called.
@hiroshige-g @bfgeek Hi, can you review this? |
This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2
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.
Also, given that we missed this bug in the previous PR, it might be better to split out the postTask + promise-related blocks that should be executed on the main thread to a helper method.
|
||
1. If |pendingTaskStruct|'s <a for="pending tasks struct">counter</a> is not <b>-1</b>, then | ||
run these steps: | ||
|
||
1. Set |pendingTaskStruct|'s <a for="pending tasks struct">counter</a> to <b>-1</b>. | ||
|
||
2. Reject |promise| with |script|'s <a>error to rethrow</a>. |
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.
I assume the intention of this change is to reference the local argument passed to the task (i.e. avoid dereferencing |script| here), but <a>error to rethrow</a>
still references #concept-script
's error to rethrow
.
This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2
This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2
This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1258785 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#703606}
This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1258785 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#703606}
This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1258785 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#703606}
…s error to rethrow if available, a=testonly Automatic update from web-platform-tests Worklet: Reject addModule() with script's error to rethrow if available This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1258785 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#703606} -- wpt-commits: 162858b9961ab26dbbe27e07bea2d6e6d10702df wpt-pr: 19462
…s error to rethrow if available, a=testonly Automatic update from web-platform-tests Worklet: Reject addModule() with script's error to rethrow if available This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1258785 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#703606} -- wpt-commits: 162858b9961ab26dbbe27e07bea2d6e6d10702df wpt-pr: 19462
…s error to rethrow if available, a=testonly Automatic update from web-platform-tests Worklet: Reject addModule() with script's error to rethrow if available This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1258785 Reviewed-by: Kouhei Ueno <kouheichromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshigechromium.org> Commit-Queue: Hiroki Nakagawa <nhirokichromium.org> Cr-Commit-Position: refs/heads/master{#703606} -- wpt-commits: 162858b9961ab26dbbe27e07bea2d6e6d10702df wpt-pr: 19462 UltraBlame original commit: be5a525dc0ae96f3bca68b403b22e4bb3bfc56b0
…s error to rethrow if available, a=testonly Automatic update from web-platform-tests Worklet: Reject addModule() with script's error to rethrow if available This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1258785 Reviewed-by: Kouhei Ueno <kouheichromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshigechromium.org> Commit-Queue: Hiroki Nakagawa <nhirokichromium.org> Cr-Commit-Position: refs/heads/master{#703606} -- wpt-commits: 162858b9961ab26dbbe27e07bea2d6e6d10702df wpt-pr: 19462 UltraBlame original commit: be5a525dc0ae96f3bca68b403b22e4bb3bfc56b0
…s error to rethrow if available, a=testonly Automatic update from web-platform-tests Worklet: Reject addModule() with script's error to rethrow if available This CL makes Worklet#addModule() fail with a more specific error object compared to before. Before this change, Worklet::addModule() was rejected with AbortError regardless of an actual error reason, and that made it difficult for developers to debug worklets. This behavior was defined in the Worklets spec, but it was changed recently (see the links below). After this change, Worklet::addModule() is rejected with script's error to rethrow when it is available as the new spec defines. Spec changes: - w3c/css-houdini-drafts#958 - w3c/css-houdini-drafts#967 Chromestatus: - https://www.chromestatus.com/feature/5116796497559552 Bug: 782066 Change-Id: Iabd30eff28ed1bffed9219898649a89b8abebbb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1258785 Reviewed-by: Kouhei Ueno <kouheichromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshigechromium.org> Commit-Queue: Hiroki Nakagawa <nhirokichromium.org> Cr-Commit-Position: refs/heads/master{#703606} -- wpt-commits: 162858b9961ab26dbbe27e07bea2d6e6d10702df wpt-pr: 19462 UltraBlame original commit: be5a525dc0ae96f3bca68b403b22e4bb3bfc56b0
This is a follow-up patch for #958. A task to reject addModule() should
be queued with script's error to rethrow to run on the thread where
addModule() is called.
This fixes #509