Skip to content

script: JSContextify most of webgpu - #45552

Merged
sagudev merged 2 commits into
servo:mainfrom
Narfinger:webgpu-cx
Jun 10, 2026
Merged

script: JSContextify most of webgpu#45552
sagudev merged 2 commits into
servo:mainfrom
Narfinger:webgpu-cx

Conversation

@Narfinger

@Narfinger Narfinger commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This moves from CanGc to JSContext for most of dom/webgpu with exceptions where complications arose.

Special care should taken to review the following:

  • Promise::new_in_current_realm2,
  • DataBuffer::view,
  • Two Convert method were split into separate function as they require a &mut JSContext,

Testing: Describe the new automated tests that cover this change or explain why it doesn't require tests.
Fixes: Link to an issue this pull request fixes or remove this line if there is no issue.

Edit: The merged version does not have the Promise::new_in_current_realm2 as it was replaced with CurrentRealm.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
@Narfinger
Narfinger marked this pull request as ready for review June 10, 2026 12:20
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 10, 2026

@TimvdLippe TimvdLippe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work! Most of it looks good, but the realm code should use CurrentRealm instead so that it can use the existing promise methods.

Comment thread components/script/dom/webgpu/gpudevice.rs Outdated
Comment thread components/script/dom/webgpu/gpudevice.rs Outdated
Comment thread components/script/dom/webgpu/gpudevice.rs Outdated
Comment thread components/script/dom/promise.rs Outdated
@servo-highfive servo-highfive added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jun 10, 2026
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Jun 10, 2026
@Narfinger

Copy link
Copy Markdown
Contributor Author

Ah taht was the missing thing I didn't know about. I added a couple more CurrentRealm in it.

@TimvdLippe TimvdLippe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jun 10, 2026
@TimvdLippe
TimvdLippe added this pull request to the merge queue Jun 10, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 10, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jun 10, 2026
@sagudev
sagudev added this pull request to the merge queue Jun 10, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jun 10, 2026
Merged via the queue into servo:main with commit 60c8956 Jun 10, 2026
39 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 10, 2026
@Narfinger
Narfinger deleted the webgpu-cx branch June 11, 2026 07:18
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.

4 participants