[WebGPU] Move 'gpu' API entry point from DOMWindow to Navigator
https://bugs.webkit.org/show_bug.cgi?id=197348
Reviewed by Myles C. Maxfield.
Source/WebCore:
Latest API provides 'gpu' through Navigator instead of DOMWindow. Replace DOMWindowWebGPU with NavigatorGPU.
Existing tests updated to match. Add test: webgpu-enabled-in-worker.html to ensure workers can access WebGPU.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/NavigatorGPU.cpp:
(WebCore::NavigatorGPU::from):
(WebCore::NavigatorGPU::supplementName):
(WebCore::NavigatorGPU::gpu):
(WebCore::NavigatorGPU::gpu const):
* Modules/webgpu/NavigatorGPU.h:
* Modules/webgpu/NavigatorGPU.idl:
* Modules/webgpu/WorkerNavigatorGPU.cpp:
(WebCore::WorkerNavigatorGPU::from):
(WebCore::WorkerNavigatorGPU::supplementName):
(WebCore::WorkerNavigatorGPU::gpu):
(WebCore::WorkerNavigatorGPU::gpu const):
* Modules/webgpu/WorkerNavigatorGPU.h:
* Modules/webgpu/WorkerNavigatorGPU.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
LayoutTests:
WebGPU is now accessed through navigator.gpu instead of window.gpu.
Add webgpu-enabled-in-worker to ensure workers can access WebGPU.
* webgpu/adapter-options.html:
* webgpu/js/create-worker-device.js: Added.
(async.tryCreateDevice):
* webgpu/js/webgpu-functions.js:
(async.getBasicDevice):
* webgpu/queue-creation.html:
* webgpu/webgpu-enabled-in-worker-expected.txt: Added.
* webgpu/webgpu-enabled-in-worker.html: Added.
* webgpu/webgpu-enabled.html:
* webgpu/whlsl.html:
Add navigator.gpu to expectations for navigator-detached-no-crash.
* fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244777
268f45cc-cd09-0410-ab3c-
d52691b4dbfc