Title: [244777] trunk
Revision
244777
Author
justin_...@apple.com
Date
2019-04-30 09:33:35 -0700 (Tue, 30 Apr 2019)

Log Message

[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:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (244776 => 244777)


--- trunk/LayoutTests/ChangeLog	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/LayoutTests/ChangeLog	2019-04-30 16:33:35 UTC (rev 244777)
@@ -1,3 +1,29 @@
+2019-04-30  Justin Fan  <justin_...@apple.com>
+
+        [WebGPU] Move 'gpu' API entry point from DOMWindow to Navigator
+        https://bugs.webkit.org/show_bug.cgi?id=197348
+
+        Reviewed by Myles C. Maxfield.
+
+        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:
+
 2019-04-30  Youenn Fablet  <you...@apple.com>
 
         Update WPT service-worker resource-timing test to use hosts[alt]

Modified: trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt (244776 => 244777)


--- trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt	2019-04-30 16:33:35 UTC (rev 244777)
@@ -8,6 +8,7 @@
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
+navigator.gpu is OK
 navigator.javaEnabled() is OK
 navigator.language is OK
 navigator.languages is OK
@@ -33,6 +34,7 @@
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
+navigator.gpu is OK
 navigator.javaEnabled() is OK
 navigator.language is OK
 navigator.languages is OK

Modified: trunk/LayoutTests/platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt (244776 => 244777)


--- trunk/LayoutTests/platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/LayoutTests/platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt	2019-04-30 16:33:35 UTC (rev 244777)
@@ -7,6 +7,7 @@
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
+navigator.gpu is OK
 navigator.javaEnabled() is OK
 navigator.language is OK
 navigator.languages is OK
@@ -30,6 +31,7 @@
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
+navigator.gpu is OK
 navigator.javaEnabled() is OK
 navigator.language is OK
 navigator.languages is OK

Modified: trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt (244776 => 244777)


--- trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt	2019-04-30 16:33:35 UTC (rev 244777)
@@ -8,6 +8,7 @@
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
+navigator.gpu is OK
 navigator.javaEnabled() is OK
 navigator.language is OK
 navigator.languages is OK
@@ -32,6 +33,7 @@
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
+navigator.gpu is OK
 navigator.javaEnabled() is OK
 navigator.language is OK
 navigator.languages is OK

Modified: trunk/LayoutTests/webgpu/adapter-options.html (244776 => 244777)


--- trunk/LayoutTests/webgpu/adapter-options.html	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/LayoutTests/webgpu/adapter-options.html	2019-04-30 16:33:35 UTC (rev 244777)
@@ -6,7 +6,7 @@
 <script src=""
 <script>
 promise_test(async () => {
-    const defaultAdapter = await gpu.requestAdapter();
+    const defaultAdapter = await navigator.gpu.requestAdapter();
     const device = await defaultAdapter.requestDevice();
 
     assert_true(device instanceof WebGPUDevice, "Default device successfully created.");
@@ -13,7 +13,7 @@
 }, "Create the default device.");
 
 promise_test(async () => {
-    const lowPowerAdapter = await gpu.requestAdapter({ powerPreference: "low-power" });
+    const lowPowerAdapter = await navigator.gpu.requestAdapter({ powerPreference: "low-power" });
     const device = await lowPowerAdapter.requestDevice();
 
     assert_true(device instanceof WebGPUDevice, "Device successfully created using low-power option.");
@@ -20,7 +20,7 @@
 }, "Create a device with a low-power option.");
 
 promise_test(async () => {
-    const highPerfAdapter = await gpu.requestAdapter({ powerPreference: "high-performance" });
+    const highPerfAdapter = await navigator.gpu.requestAdapter({ powerPreference: "high-performance" });
     const device = await highPerfAdapter.requestDevice();
 
     assert_true(device instanceof WebGPUDevice, "Device successfully created using high-performance option.");

Added: trunk/LayoutTests/webgpu/js/create-worker-device.js (0 => 244777)


--- trunk/LayoutTests/webgpu/js/create-worker-device.js	                        (rev 0)
+++ trunk/LayoutTests/webgpu/js/create-worker-device.js	2019-04-30 16:33:35 UTC (rev 244777)
@@ -0,0 +1,11 @@
+async function tryCreateDevice() {
+    if (!navigator.gpu)
+        postMessage(false);
+
+    const adapter = await navigator.gpu.requestAdapter();
+    await adapter.requestDevice();
+
+    postMessage(true);
+}
+
+tryCreateDevice();

Modified: trunk/LayoutTests/webgpu/js/webgpu-functions.js (244776 => 244777)


--- trunk/LayoutTests/webgpu/js/webgpu-functions.js	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/LayoutTests/webgpu/js/webgpu-functions.js	2019-04-30 16:33:35 UTC (rev 244777)
@@ -1,5 +1,5 @@
 async function getBasicDevice() {
-    const adapter = await gpu.requestAdapter({ powerPreference: "low-power" });
+    const adapter = await navigator.gpu.requestAdapter({ powerPreference: "low-power" });
     const device = await adapter.requestDevice();
     return device;
 }

Modified: trunk/LayoutTests/webgpu/queue-creation.html (244776 => 244777)


--- trunk/LayoutTests/webgpu/queue-creation.html	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/LayoutTests/webgpu/queue-creation.html	2019-04-30 16:33:35 UTC (rev 244777)
@@ -9,12 +9,12 @@
 'use strict';
 
 promise_test(async t => {
-    assert_not_equals(window.gpu, undefined, "window.gpu exists");
+    assert_not_equals(navigator.gpu, undefined, "navigator.gpu exists");
 
     const context = document.createElement("canvas").getContext("gpu");
     assert_true(context instanceof GPUCanvasContext, "getContext returned a GPUCanvasContext.");
 
-    const adapter = await window.gpu.requestAdapter({});
+    const adapter = await navigator.gpu.requestAdapter({});
     assert_true(adapter instanceof WebGPUAdapter, "requestAdapter returned a WebGPUAdapter.");
 
     const device = await adapter.requestDevice();

Added: trunk/LayoutTests/webgpu/webgpu-enabled-in-worker-expected.txt (0 => 244777)


--- trunk/LayoutTests/webgpu/webgpu-enabled-in-worker-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/webgpu-enabled-in-worker-expected.txt	2019-04-30 16:33:35 UTC (rev 244777)
@@ -0,0 +1,3 @@
+
+PASS Test if WebGPU is enabled for workers. 
+

Added: trunk/LayoutTests/webgpu/webgpu-enabled-in-worker.html (0 => 244777)


--- trunk/LayoutTests/webgpu/webgpu-enabled-in-worker.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/webgpu-enabled-in-worker.html	2019-04-30 16:33:35 UTC (rev 244777)
@@ -0,0 +1,20 @@
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<html>
+<meta charset=utf-8>
+<title>Test if WebGPU is enabled for workers.</title>
+<script src=""
+<script src=""
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+const worker = new Worker('js/create-worker-device.js');
+
+worker._onmessage_ = event => {
+    test(() => { assert_true(event.data, "Create GPUDevice with a worker."); });
+
+    if (window.testRunner)
+        testRunner.notifyDone();
+};
+</script>
+</html>
\ No newline at end of file

Modified: trunk/LayoutTests/webgpu/webgpu-enabled.html (244776 => 244777)


--- trunk/LayoutTests/webgpu/webgpu-enabled.html	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/LayoutTests/webgpu/webgpu-enabled.html	2019-04-30 16:33:35 UTC (rev 244777)
@@ -10,9 +10,10 @@
     const context = canvas.getContext("gpu");
     assert_true(context instanceof GPUCanvasContext, "Created GPUCanvasContext.");
 
-    assert_not_equals(window.gpu, undefined, "window.gpu is defined.");
+    assert_equals(window.gpu, undefined, "window.gpu should not be defined.")
+    assert_not_equals(navigator.gpu, undefined, "navigator.gpu is defined.");
 
-    const adapter = await window.gpu.requestAdapter();
+    const adapter = await navigator.gpu.requestAdapter();
     assert_true(adapter instanceof WebGPUAdapter, "Created default GPUAdapter.");
     
     const device = await adapter.requestDevice();

Modified: trunk/LayoutTests/webgpu/whlsl.html (244776 => 244777)


--- trunk/LayoutTests/webgpu/whlsl.html	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/LayoutTests/webgpu/whlsl.html	2019-04-30 16:33:35 UTC (rev 244777)
@@ -15,7 +15,7 @@
 }
 `;
 async function start() {
-    const adapter = await window.gpu.requestAdapter();
+    const adapter = await navigator.gpu.requestAdapter();
     const device = await adapter.requestDevice();
 
     const shaderModule = device.createShaderModule({code: shaderSource, isWHLSL: true});

Modified: trunk/Source/WebCore/CMakeLists.txt (244776 => 244777)


--- trunk/Source/WebCore/CMakeLists.txt	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/Source/WebCore/CMakeLists.txt	2019-04-30 16:33:35 UTC (rev 244777)
@@ -468,7 +468,6 @@
 
     Modules/webdriver/NavigatorWebDriver.idl
 
-    Modules/webgpu/DOMWindowWebGPU.idl
     Modules/webgpu/GPUBindGroupLayoutBinding.idl
     Modules/webgpu/GPUBindGroupLayoutDescriptor.idl
     Modules/webgpu/GPUBlendDescriptor.idl
@@ -493,6 +492,7 @@
     Modules/webgpu/GPUTextureUsage.idl
     Modules/webgpu/GPUVertexAttributeDescriptor.idl
     Modules/webgpu/GPUVertexInputDescriptor.idl
+    Modules/webgpu/NavigatorGPU.idl
     Modules/webgpu/WebGPU.idl
     Modules/webgpu/WebGPUAdapter.idl
     Modules/webgpu/WebGPUBindGroup.idl
@@ -523,6 +523,7 @@
     Modules/webgpu/WebGPUSwapChain.idl
     Modules/webgpu/WebGPUTexture.idl
     Modules/webgpu/WebGPUTextureView.idl
+    Modules/webgpu/WorkerNavigatorGPU.idl
 
     Modules/websockets/CloseEvent.idl
     Modules/websockets/WebSocket.idl

Modified: trunk/Source/WebCore/ChangeLog (244776 => 244777)


--- trunk/Source/WebCore/ChangeLog	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/Source/WebCore/ChangeLog	2019-04-30 16:33:35 UTC (rev 244777)
@@ -1,3 +1,33 @@
+2019-04-30  Justin Fan  <justin_...@apple.com>
+
+        [WebGPU] Move 'gpu' API entry point from DOMWindow to Navigator
+        https://bugs.webkit.org/show_bug.cgi?id=197348
+
+        Reviewed by Myles C. Maxfield.
+
+        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:
+
 2019-04-30  Zalan Bujtas  <za...@apple.com>
 
         Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)

Modified: trunk/Source/WebCore/DerivedSources.make (244776 => 244777)


--- trunk/Source/WebCore/DerivedSources.make	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/Source/WebCore/DerivedSources.make	2019-04-30 16:33:35 UTC (rev 244777)
@@ -374,7 +374,6 @@
     $(WebCore)/Modules/webdatabase/SQLTransactionCallback.idl \
     $(WebCore)/Modules/webdatabase/SQLTransactionErrorCallback.idl \
     $(WebCore)/Modules/webdriver/NavigatorWebDriver.idl \
-    $(WebCore)/Modules/webgpu/DOMWindowWebGPU.idl \
     $(WebCore)/Modules/webgpu/GPUCanvasContext.idl \
     $(WebCore)/Modules/webgpu/GPUColor.idl \
     $(WebCore)/Modules/webgpu/GPUColorStateDescriptor.idl \
@@ -399,6 +398,7 @@
     $(WebCore)/Modules/webgpu/GPUTextureUsage.idl \
     $(WebCore)/Modules/webgpu/GPUVertexAttributeDescriptor.idl \
 	$(WebCore)/Modules/webgpu/GPUVertexInputDescriptor.idl \
+    $(WebCore)/Modules/webgpu/NavigatorGPU.idl \
     $(WebCore)/Modules/webgpu/WebGPU.idl \
     $(WebCore)/Modules/webgpu/WebGPUAdapter.idl \
     $(WebCore)/Modules/webgpu/WebGPUBindGroup.idl \
@@ -429,6 +429,7 @@
     $(WebCore)/Modules/webgpu/WebGPUSwapChain.idl \
     $(WebCore)/Modules/webgpu/WebGPUTexture.idl \
     $(WebCore)/Modules/webgpu/WebGPUTextureView.idl \
+    $(WebCore)/Modules/webgpu/WorkerNavigatorGPU.idl \
     $(WebCore)/Modules/websockets/CloseEvent.idl \
     $(WebCore)/Modules/websockets/WebSocket.idl \
     $(WebCore)/Modules/webvr/DOMWindowWebVR.idl \

Deleted: trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.cpp (244776 => 244777)


--- trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.cpp	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.cpp	2019-04-30 16:33:35 UTC (rev 244777)
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DOMWindowWebGPU.h"
-
-#if ENABLE(WEBGPU)
-
-#include "DOMWindow.h"
-#include "RuntimeEnabledFeatures.h"
-#include "WebGPU.h"
-
-namespace WebCore {
-
-DOMWindowWebGPU::DOMWindowWebGPU(DOMWindow* window)
-    : DOMWindowProperty(window)
-{
-}
-
-const char* DOMWindowWebGPU::supplementName()
-{
-    return "DOMWindowWebGPU";
-}
-
-DOMWindowWebGPU* DOMWindowWebGPU::from(DOMWindow* window)
-{
-    DOMWindowWebGPU* supplement = static_cast<DOMWindowWebGPU*>(Supplement<DOMWindow>::from(window, supplementName()));
-    if (!supplement) {
-        auto newSupplement = std::make_unique<DOMWindowWebGPU>(window);
-        supplement = newSupplement.get();
-        provideTo(window, supplementName(), WTFMove(newSupplement));
-    }
-    return supplement;
-}
-
-WebGPU* DOMWindowWebGPU::gpu(DOMWindow& window)
-{
-    return DOMWindowWebGPU::from(&window)->gpu();
-}
-
-WebGPU* DOMWindowWebGPU::gpu() const
-{
-    ASSERT(RuntimeEnabledFeatures::sharedFeatures().webGPUEnabled());
-
-    if (!m_gpu && frame())
-        m_gpu = WebGPU::create();
-    return m_gpu.get();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEBGPU)

Deleted: trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.h (244776 => 244777)


--- trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.h	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.h	2019-04-30 16:33:35 UTC (rev 244777)
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(WEBGPU)
-
-#include "DOMWindowProperty.h"
-#include "Supplementable.h"
-
-namespace WebCore {
-
-class DOMWindow;
-class WebGPU;
-
-class DOMWindowWebGPU : public Supplement<DOMWindow>, public DOMWindowProperty {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    explicit DOMWindowWebGPU(DOMWindow*);
-    virtual ~DOMWindowWebGPU() = default;
-    static DOMWindowWebGPU* from(DOMWindow*);
-    static WebGPU* gpu(DOMWindow&);
-    WebGPU* gpu() const;
-
-private:
-    static const char* supplementName();
-
-    mutable RefPtr<WebGPU> m_gpu;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEBGPU)

Deleted: trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.idl (244776 => 244777)


--- trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.idl	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.idl	2019-04-30 16:33:35 UTC (rev 244777)
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-// https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
-
-[
-    Conditional=WEBGPU,
-    EnabledAtRuntime=WebGPU
-] partial interface DOMWindow {
-    [Replaceable, SameObject] readonly attribute WebGPU gpu;
-};

Copied: trunk/Source/WebCore/Modules/webgpu/NavigatorGPU.cpp (from rev 244776, trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.cpp) (0 => 244777)


--- trunk/Source/WebCore/Modules/webgpu/NavigatorGPU.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/NavigatorGPU.cpp	2019-04-30 16:33:35 UTC (rev 244777)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NavigatorGPU.h"
+
+#if ENABLE(WEBGPU)
+
+#include "Navigator.h"
+#include "RuntimeEnabledFeatures.h"
+#include "WebGPU.h"
+
+namespace WebCore {
+
+NavigatorGPU* NavigatorGPU::from(Navigator* navigator)
+{
+    NavigatorGPU* supplement = static_cast<NavigatorGPU*>(Supplement<Navigator>::from(navigator, supplementName()));
+    if (!supplement) {
+        auto newSupplement = std::make_unique<NavigatorGPU>();
+        supplement = newSupplement.get();
+        provideTo(navigator, supplementName(), WTFMove(newSupplement));
+    }
+    return supplement;
+}
+
+const char* NavigatorGPU::supplementName()
+{
+    return "NavigatorGPU";
+}
+
+const WebGPU* NavigatorGPU::gpu(Navigator& navigator)
+{
+    return NavigatorGPU::from(&navigator)->gpu();
+}
+
+const WebGPU* NavigatorGPU::gpu() const
+{
+    ASSERT(RuntimeEnabledFeatures::sharedFeatures().webGPUEnabled());
+
+    if (!m_gpu)
+        m_gpu = WebGPU::create();
+    return m_gpu.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/Modules/webgpu/NavigatorGPU.h (from rev 244776, trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.h) (0 => 244777)


--- trunk/Source/WebCore/Modules/webgpu/NavigatorGPU.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/NavigatorGPU.h	2019-04-30 16:33:35 UTC (rev 244777)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBGPU)
+
+#include "Supplementable.h"
+
+namespace WebCore {
+
+class Navigator;
+class WebGPU;
+
+class NavigatorGPU final : public Supplement<Navigator> {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static const WebGPU* gpu(Navigator&);
+
+private:
+    static NavigatorGPU* from(Navigator*);
+    static const char* supplementName();
+    
+    const WebGPU* gpu() const;
+
+    mutable RefPtr<WebGPU> m_gpu;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/Modules/webgpu/NavigatorGPU.idl (from rev 244776, trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.idl) (0 => 244777)


--- trunk/Source/WebCore/Modules/webgpu/NavigatorGPU.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/NavigatorGPU.idl	2019-04-30 16:33:35 UTC (rev 244777)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+// https://github.com/gpuweb/gpuweb/blob/master/spec/index.bs
+
+[
+    Conditional=WEBGPU,
+    EnabledAtRuntime=WebGPU,
+    Exposed=Window
+] partial interface Navigator {
+    [SameObject] readonly attribute WebGPU gpu;
+};

Copied: trunk/Source/WebCore/Modules/webgpu/WorkerNavigatorGPU.cpp (from rev 244776, trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.cpp) (0 => 244777)


--- trunk/Source/WebCore/Modules/webgpu/WorkerNavigatorGPU.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/WorkerNavigatorGPU.cpp	2019-04-30 16:33:35 UTC (rev 244777)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WorkerNavigatorGPU.h"
+
+#if ENABLE(WEBGPU)
+
+#include "RuntimeEnabledFeatures.h"
+#include "WebGPU.h"
+#include "WorkerNavigator.h"
+
+namespace WebCore {
+
+WorkerNavigatorGPU* WorkerNavigatorGPU::from(WorkerNavigator* navigator)
+{
+    WorkerNavigatorGPU* supplement = static_cast<WorkerNavigatorGPU*>(Supplement<WorkerNavigator>::from(navigator, supplementName()));
+    if (!supplement) {
+        auto newSupplement = std::make_unique<WorkerNavigatorGPU>();
+        supplement = newSupplement.get();
+        provideTo(navigator, supplementName(), WTFMove(newSupplement));
+    }
+    return supplement;
+}
+
+const char* WorkerNavigatorGPU::supplementName()
+{
+    return "WorkerNavigatorGPU";
+}
+
+const WebGPU* WorkerNavigatorGPU::gpu(WorkerNavigator& navigator)
+{
+    return WorkerNavigatorGPU::from(&navigator)->gpu();
+}
+
+const WebGPU* WorkerNavigatorGPU::gpu() const
+{
+    ASSERT(RuntimeEnabledFeatures::sharedFeatures().webGPUEnabled());
+
+    if (!m_gpu)
+        m_gpu = WebGPU::create();
+    return m_gpu.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/Modules/webgpu/WorkerNavigatorGPU.h (from rev 244776, trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.h) (0 => 244777)


--- trunk/Source/WebCore/Modules/webgpu/WorkerNavigatorGPU.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/WorkerNavigatorGPU.h	2019-04-30 16:33:35 UTC (rev 244777)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBGPU)
+
+#include "Supplementable.h"
+
+namespace WebCore {
+
+class WebGPU;
+class WorkerNavigator;
+
+class WorkerNavigatorGPU final : public Supplement<WorkerNavigator> {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static const WebGPU* gpu(WorkerNavigator&);
+
+private:
+    static WorkerNavigatorGPU* from(WorkerNavigator*);
+    static const char* supplementName();
+    
+    const WebGPU* gpu() const;
+
+    mutable RefPtr<WebGPU> m_gpu;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/Modules/webgpu/WorkerNavigatorGPU.idl (from rev 244776, trunk/Source/WebCore/Modules/webgpu/DOMWindowWebGPU.idl) (0 => 244777)


--- trunk/Source/WebCore/Modules/webgpu/WorkerNavigatorGPU.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/WorkerNavigatorGPU.idl	2019-04-30 16:33:35 UTC (rev 244777)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+// https://github.com/gpuweb/gpuweb/blob/master/spec/index.bs
+
+[
+    Conditional=WEBGPU,
+    EnabledAtRuntime=WebGPU
+] partial interface WorkerNavigator {
+    [SameObject] readonly attribute WebGPU gpu;
+};

Modified: trunk/Source/WebCore/Sources.txt (244776 => 244777)


--- trunk/Source/WebCore/Sources.txt	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/Source/WebCore/Sources.txt	2019-04-30 16:33:35 UTC (rev 244777)
@@ -304,8 +304,8 @@
 Modules/websockets/WebSocketHandshake.cpp
 Modules/websockets/WorkerThreadableWebSocketChannel.cpp
 
-Modules/webgpu/DOMWindowWebGPU.cpp
 Modules/webgpu/GPUCanvasContext.cpp
+Modules/webgpu/NavigatorGPU.cpp
 Modules/webgpu/WHLSL/WHLSLInferTypes.cpp
 Modules/webgpu/WHLSL/WHLSLLexer.cpp
 Modules/webgpu/WHLSL/WHLSLParser.cpp
@@ -375,6 +375,7 @@
 Modules/webgpu/WebGPUSwapChainDescriptor.cpp
 Modules/webgpu/WebGPUTexture.cpp
 Modules/webgpu/WebGPUTextureView.cpp
+Modules/webgpu/WorkerNavigatorGPU.cpp
 
 Modules/webvr/NavigatorWebVR.cpp
 Modules/webvr/VRDisplay.cpp
@@ -2655,7 +2656,6 @@
 JSDOMWindowIndexedDatabase.cpp
 JSDOMWindowSpeechSynthesis.cpp
 JSDOMWindowWebDatabase.cpp
-JSDOMWindowWebGPU.cpp
 JSDOMWindowWebVR.cpp
 JSDataTransfer.cpp
 JSDataTransferItem.cpp
@@ -2918,6 +2918,7 @@
 JSNavigatorBeacon.cpp
 JSNavigatorCredentials.cpp
 JSNavigatorGeolocation.cpp
+JSNavigatorGPU.cpp
 JSNavigatorID.cpp
 JSNavigatorLanguage.cpp
 JSNavigatorMediaCapabilities.cpp
@@ -3327,6 +3328,7 @@
 JSWorkerGlobalScopeIndexedDatabase.cpp
 JSWorkerLocation.cpp
 JSWorkerNavigator.cpp
+JSWorkerNavigatorGPU.cpp
 JSWorkerType.cpp
 JSWritableStream.cpp
 JSXMLDocument.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (244776 => 244777)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-04-30 16:23:20 UTC (rev 244776)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-04-30 16:33:35 UTC (rev 244777)
@@ -100,7 +100,6 @@
 		0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */; };
 		070E09191875EEFC003A1D3C /* PlatformMediaSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E09181875ED93003A1D3C /* PlatformMediaSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		070E81D11BF27656001FDA48 /* VideoTrackPrivateMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E81D01BF27656001FDA48 /* VideoTrackPrivateMediaStream.h */; };
-		CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDA79825170A279000D45C55 /* AudioSessionIOS.mm */; };
 		070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */; };
 		0719427F1D088F21002AA51D /* AVFoundationMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07C8AD111D073D630087C5CE /* AVFoundationMIMETypeCache.mm */; };
 		071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 071A9EC0168FB56C002629F9 /* TextTrackCueGeneric.cpp */; };
@@ -4080,6 +4079,7 @@
 		CDA29A321CC01A9500901CCF /* PlaybackSessionInterfaceAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA29A2E1CBF73FC00901CCF /* PlaybackSessionInterfaceAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CDA595932146DEC300A84185 /* HEVCUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA595912146DEC300A84185 /* HEVCUtilities.h */; };
 		CDA595982146DF7800A84185 /* HEVCUtilitiesCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA595962146DF7800A84185 /* HEVCUtilitiesCocoa.h */; };
+		CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDA79825170A279000D45C55 /* AudioSessionIOS.mm */; };
 		CDA7982A170A3D0000D45C55 /* AudioSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA79821170A22DC00D45C55 /* AudioSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CDA98E0B1603CD6000FEA3B1 /* LegacyCDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98E091603CD5900FEA3B1 /* LegacyCDM.cpp */; };
 		CDAB6D2917C7DE6C00C60B34 /* MediaControlsHost.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2717C7DE6C00C60B34 /* MediaControlsHost.h */; };
@@ -13822,12 +13822,14 @@
 		D003914122248D400098998C /* GPUProgrammablePassEncoder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUProgrammablePassEncoder.cpp; sourceTree = "<group>"; };
 		D00487D222457BEA00EED7D9 /* WebGPUPipelineLayoutDescriptor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUPipelineLayoutDescriptor.cpp; sourceTree = "<group>"; };
 		D00487E5226A634200EED7D9 /* WebGPUSwapChainDescriptor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUSwapChainDescriptor.cpp; sourceTree = "<group>"; };
+		D00487EB2274281200EED7D9 /* NavigatorGPU.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = NavigatorGPU.idl; sourceTree = "<group>"; };
+		D00487ED2274281300EED7D9 /* NavigatorGPU.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorGPU.cpp; sourceTree = "<group>"; };
+		D00487EE2274281400EED7D9 /* NavigatorGPU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NavigatorGPU.h; sourceTree = "<group>"; };
+		D00487FD2277AF8100EED7D9 /* WorkerNavigatorGPU.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WorkerNavigatorGPU.idl; sourceTree = "<group>"; };
+		D00487FE2277AF8200EED7D9 /* WorkerNavigatorGPU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WorkerNavigatorGPU.h; sourceTree = "<group>"; };
 		D00D77FD2242ED450043F12C /* WebGPUComputePassEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUComputePassEncoder.h; sourceTree = "<group>"; };
 		D00D77FE2242ED450043F12C /* WebGPUComputePassEncoder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUComputePassEncoder.cpp; sourceTree = "<group>"; };
 		D00D77FF2242ED450043F12C /* WebGPUComputePassEncoder.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUComputePassEncoder.idl; sourceTree = "<group>"; };
-		D00F5940216ECC7A000D71DB /* DOMWindowWebGPU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMWindowWebGPU.h; sourceTree = "<group>"; };
-		D00F5941216ECC7A000D71DB /* DOMWindowWebGPU.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowWebGPU.cpp; sourceTree = "<group>"; };
-		D00F5942216ECC7A000D71DB /* DOMWindowWebGPU.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMWindowWebGPU.idl; sourceTree = "<group>"; };
 		D00F5946216EFE54000D71DB /* WebGPU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPU.h; sourceTree = "<group>"; };
 		D00F5947216EFE54000D71DB /* WebGPU.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPU.cpp; sourceTree = "<group>"; };
 		D00F5948216EFE54000D71DB /* WebGPU.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPU.idl; sourceTree = "<group>"; };
@@ -13967,6 +13969,7 @@
 		D0C419F7218404DA009EC1DE /* WebGPURenderPipeline.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPURenderPipeline.h; sourceTree = "<group>"; };
 		D0C419F8218404DA009EC1DE /* WebGPURenderPipeline.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPURenderPipeline.cpp; sourceTree = "<group>"; };
 		D0C419F9218404DA009EC1DE /* WebGPURenderPipeline.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPURenderPipeline.idl; sourceTree = "<group>"; };
+		D0CAAD532277C2A600801CDF /* WorkerNavigatorGPU.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerNavigatorGPU.cpp; sourceTree = "<group>"; };
 		D0CCA94922299F97006979B6 /* GPUOrigin3D.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUOrigin3D.h; sourceTree = "<group>"; };
 		D0CCA94A22299F97006979B6 /* GPUOrigin3D.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUOrigin3D.idl; sourceTree = "<group>"; };
 		D0D69C9C222E00C20032927E /* GPUBindGroupLayoutDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUBindGroupLayoutDescriptor.h; sourceTree = "<group>"; };
@@ -25756,9 +25759,6 @@
 			isa = PBXGroup;
 			children = (
 				C210E90D21B4BCA400B7F83D /* WHLSL */,
-				D00F5941216ECC7A000D71DB /* DOMWindowWebGPU.cpp */,
-				D00F5940216ECC7A000D71DB /* DOMWindowWebGPU.h */,
-				D00F5942216ECC7A000D71DB /* DOMWindowWebGPU.idl */,
 				D0B8BB0121C46E78000C7681 /* GPUBindGroupLayoutBinding.h */,
 				D0D69C9F222E015E0032927E /* GPUBindGroupLayoutBinding.idl */,
 				D0D69C9C222E00C20032927E /* GPUBindGroupLayoutDescriptor.h */,
@@ -25789,6 +25789,9 @@
 				D026F483220A472F00AC5F49 /* GPUTextureUsage.idl */,
 				D0D8649621BA18F4003C983C /* GPUVertexAttributeDescriptor.idl */,
 				D0D8649821BA19A7003C983C /* GPUVertexInputDescriptor.idl */,
+				D00487ED2274281300EED7D9 /* NavigatorGPU.cpp */,
+				D00487EE2274281400EED7D9 /* NavigatorGPU.h */,
+				D00487EB2274281200EED7D9 /* NavigatorGPU.idl */,
 				D00F5947216EFE54000D71DB /* WebGPU.cpp */,
 				D00F5946216EFE54000D71DB /* WebGPU.h */,
 				D00F5948216EFE54000D71DB /* WebGPU.idl */,
@@ -25878,6 +25881,9 @@
 				D0EACF882193EE4E000FA75C /* WebGPUTextureView.cpp */,
 				D0EACF872193EE4E000FA75C /* WebGPUTextureView.h */,
 				D0EACF892193EE4E000FA75C /* WebGPUTextureView.idl */,
+				D0CAAD532277C2A600801CDF /* WorkerNavigatorGPU.cpp */,
+				D00487FE2277AF8200EED7D9 /* WorkerNavigatorGPU.h */,
+				D00487FD2277AF8100EED7D9 /* WorkerNavigatorGPU.idl */,
 			);
 			path = webgpu;
 			sourceTree = "<group>";
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to