Bug 1910206 - chore(webgpu): warn on use of deprecated GPUAdapter.requestAdapterInfo r=webgpu-reviewers,jgilbert

@jimb and I thought this would be an important signal for users while we wait to land D222065.

Differential Revision: https://phabricator.services.mozilla.com/D222336
This commit is contained in:
Erich Gubler 2024-09-19 16:01:37 +00:00
parent a365040bcc
commit 6d717fde3f
2 changed files with 8 additions and 0 deletions

View File

@ -494,6 +494,13 @@ already_AddRefed<dom::Promise> Adapter::RequestDevice(
already_AddRefed<dom::Promise> Adapter::RequestAdapterInfo(
const dom::Sequence<nsString>& /*aUnmaskHints*/, ErrorResult& aRv) const {
dom::AutoJSAPI api;
if (api.Init(GetParentObject())) {
JS::WarnUTF8(api.cx(),
"`GPUAdapter.requestAdapterInfo()` is deprecated. "
"Please use `GPUAdapter.info` instead.");
}
RefPtr<dom::Promise> promise = dom::Promise::Create(GetParentObject(), aRv);
if (!promise) return nullptr;

View File

@ -1 +1,2 @@
[cts.https.html?q=webgpu:api,operation,adapter,info:adapter_info:*]
[:]