<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[243090] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/243090">243090</a></dd>
<dt>Author</dt> <dd>justin_fan@apple.com</dd>
<dt>Date</dt> <dd>2019-03-18 12:18:50 -0700 (Mon, 18 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Web GPU] GPUAdapter.createDevice -> GPUAdapter.requestDevice
https://bugs.webkit.org/show_bug.cgi?id=195781

Reviewed by Myles C. Maxfield.

Source/WebCore:

A Web GPU device is now acquired via a promise returned from GPUAdapter.requestDevice().

Existing tests updated for new behavior.

* Modules/webgpu/WebGPUAdapter.cpp:
(WebCore::WebGPUAdapter::requestDevice const):
(WebCore::WebGPUAdapter::createDevice): Deleted.
* Modules/webgpu/WebGPUAdapter.h:
* Modules/webgpu/WebGPUAdapter.idl:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::tryCreate):
(WebCore::WebGPUDevice::WebGPUDevice):
(WebCore::WebGPUDevice::create): Deleted.
* Modules/webgpu/WebGPUDevice.h:
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::tryCreate):
(WebCore::GPUDevice::create): Deleted.

LayoutTests:

Update affected Web GPU tests.

* webgpu/adapter-options.html:
* webgpu/js/webgpu-functions.js:
(async.getBasicDevice):
* webgpu/queue-creation.html:
* webgpu/webgpu-enabled.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestswebgpuadapteroptionshtml">trunk/LayoutTests/webgpu/adapter-options.html</a></li>
<li><a href="#trunkLayoutTestswebgpujswebgpufunctionsjs">trunk/LayoutTests/webgpu/js/webgpu-functions.js</a></li>
<li><a href="#trunkLayoutTestswebgpuqueuecreationhtml">trunk/LayoutTests/webgpu/queue-creation.html</a></li>
<li><a href="#trunkLayoutTestswebgpuwebgpuenabledhtml">trunk/LayoutTests/webgpu/webgpu-enabled.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWebGPUAdaptercpp">trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWebGPUAdapterh">trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWebGPUAdapteridl">trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWebGPUDevicecpp">trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWebGPUDeviceh">trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgpuGPUDeviceh">trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgpucocoaGPUDeviceMetalmm">trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/LayoutTests/ChangeLog 2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2019-03-18  Justin Fan  <justin_fan@apple.com>
</span><span class="cx"> 
</span><ins>+        [Web GPU] GPUAdapter.createDevice -> GPUAdapter.requestDevice
+        https://bugs.webkit.org/show_bug.cgi?id=195781
+
+        Reviewed by Myles C. Maxfield.
+
+        Update affected Web GPU tests.
+
+        * webgpu/adapter-options.html:
+        * webgpu/js/webgpu-functions.js:
+        (async.getBasicDevice):
+        * webgpu/queue-creation.html:
+        * webgpu/webgpu-enabled.html:
+
+2019-03-18  Justin Fan  <justin_fan@apple.com>
+
</ins><span class="cx">         [Web GPU] API updates: GPUTexture.createDefaultView and type-safe GPURenderPassEncoder.setPipeline
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195896
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestswebgpuadapteroptionshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webgpu/adapter-options.html (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webgpu/adapter-options.html    2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/LayoutTests/webgpu/adapter-options.html       2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> <script>
</span><span class="cx"> promise_test(async () => {
</span><span class="cx">     const defaultAdapter = await gpu.requestAdapter();
</span><del>-    const device = defaultAdapter.createDevice();
</del><ins>+    const device = await defaultAdapter.requestDevice();
</ins><span class="cx"> 
</span><span class="cx">     assert_true(device instanceof WebGPUDevice, "Default device successfully created.");
</span><span class="cx"> }, "Create the default device.");
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> 
</span><span class="cx"> promise_test(async () => {
</span><span class="cx">     const lowPowerAdapter = await gpu.requestAdapter({ powerPreference: "low-power" });
</span><del>-    const device = lowPowerAdapter.createDevice();
</del><ins>+    const device = await lowPowerAdapter.requestDevice();
</ins><span class="cx"> 
</span><span class="cx">     assert_true(device instanceof WebGPUDevice, "Device successfully created using low-power option.");
</span><span class="cx"> }, "Create a device with a low-power option.");
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx"> 
</span><span class="cx"> promise_test(async () => {
</span><span class="cx">     const highPerfAdapter = await gpu.requestAdapter({ powerPreference: "high-performance" });
</span><del>-    const device = highPerfAdapter.createDevice();
</del><ins>+    const device = await highPerfAdapter.requestDevice();
</ins><span class="cx"> 
</span><span class="cx">     assert_true(device instanceof WebGPUDevice, "Device successfully created using high-performance option.");
</span><span class="cx"> }, "Create a device with a high-performance option.");
</span></span></pre></div>
<a id="trunkLayoutTestswebgpujswebgpufunctionsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webgpu/js/webgpu-functions.js (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webgpu/js/webgpu-functions.js  2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/LayoutTests/webgpu/js/webgpu-functions.js     2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> async function getBasicDevice() {
</span><span class="cx">     const adapter = await gpu.requestAdapter({ powerPreference: "low-power" });
</span><del>-    const device = adapter.createDevice();
</del><ins>+    const device = await adapter.requestDevice();
</ins><span class="cx">     return device;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestswebgpuqueuecreationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webgpu/queue-creation.html (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webgpu/queue-creation.html     2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/LayoutTests/webgpu/queue-creation.html        2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -17,8 +17,8 @@
</span><span class="cx">     const adapter = await window.gpu.requestAdapter({});
</span><span class="cx">     assert_true(adapter instanceof WebGPUAdapter, "requestAdapter returned a WebGPUAdapter.");
</span><span class="cx"> 
</span><del>-    const device = adapter.createDevice();
-    assert_true(device instanceof WebGPUDevice, "createDevice returned a WebGPUDevice.");
</del><ins>+    const device = await adapter.requestDevice();
+    assert_true(device instanceof WebGPUDevice, "requestDevice returned a WebGPUDevice.");
</ins><span class="cx"> 
</span><span class="cx">     const queue = device.getQueue();
</span><span class="cx">     assert_true(queue instanceof WebGPUQueue, "getQueue returned a WebGPUQueue.");
</span></span></pre></div>
<a id="trunkLayoutTestswebgpuwebgpuenabledhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webgpu/webgpu-enabled.html (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webgpu/webgpu-enabled.html     2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/LayoutTests/webgpu/webgpu-enabled.html        2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx">     const adapter = await window.gpu.requestAdapter();
</span><span class="cx">     assert_true(adapter instanceof WebGPUAdapter, "Created default GPUAdapter.");
</span><span class="cx">     
</span><del>-    const device = adapter.createDevice();
</del><ins>+    const device = await adapter.requestDevice();
</ins><span class="cx">     assert_true(device instanceof WebGPUDevice, "Created GPUDevice.");
</span><span class="cx"> }, "Web GPU is enabled.");
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/Source/WebCore/ChangeLog      2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -1,5 +1,31 @@
</span><span class="cx"> 2019-03-18  Justin Fan  <justin_fan@apple.com>
</span><span class="cx"> 
</span><ins>+        [Web GPU] GPUAdapter.createDevice -> GPUAdapter.requestDevice
+        https://bugs.webkit.org/show_bug.cgi?id=195781
+
+        Reviewed by Myles C. Maxfield.
+
+        A Web GPU device is now acquired via a promise returned from GPUAdapter.requestDevice().
+
+        Existing tests updated for new behavior.
+
+        * Modules/webgpu/WebGPUAdapter.cpp:
+        (WebCore::WebGPUAdapter::requestDevice const):
+        (WebCore::WebGPUAdapter::createDevice): Deleted.
+        * Modules/webgpu/WebGPUAdapter.h:
+        * Modules/webgpu/WebGPUAdapter.idl:
+        * Modules/webgpu/WebGPUDevice.cpp:
+        (WebCore::WebGPUDevice::tryCreate):
+        (WebCore::WebGPUDevice::WebGPUDevice):
+        (WebCore::WebGPUDevice::create): Deleted.
+        * Modules/webgpu/WebGPUDevice.h:
+        * platform/graphics/gpu/GPUDevice.h:
+        * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
+        (WebCore::GPUDevice::tryCreate):
+        (WebCore::GPUDevice::create): Deleted.
+
+2019-03-18  Justin Fan  <justin_fan@apple.com>
+
</ins><span class="cx">         [Web GPU] API updates: GPUTexture.createDefaultView and type-safe GPURenderPassEncoder.setPipeline
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195896
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWebGPUAdaptercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp    2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp       2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -28,8 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGPU)
</span><span class="cx"> 
</span><ins>+#include "JSWebGPUDevice.h"
</ins><span class="cx"> #include "ScriptExecutionContext.h"
</span><del>-#include "WebGPUDevice.h"
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -43,9 +43,12 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<WebGPUDevice> WebGPUAdapter::createDevice()
</del><ins>+void WebGPUAdapter::requestDevice(DeviceRequestPromise&& promise) const
</ins><span class="cx"> {
</span><del>-    return WebGPUDevice::create(*this);
</del><ins>+    if (auto device = WebGPUDevice::tryCreate(*this))
+        promise.resolve(device.releaseNonNull());
+    else
+        promise.reject();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWebGPUAdapterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.h (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.h      2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.h 2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -28,9 +28,10 @@
</span><span class="cx"> #if ENABLE(WEBGPU)
</span><span class="cx"> 
</span><span class="cx"> #include "GPURequestAdapterOptions.h"
</span><ins>+#include "JSDOMPromiseDeferred.h"
</ins><span class="cx"> #include <wtf/Optional.h>
</span><ins>+#include <wtf/Ref.h>
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><del>-#include <wtf/RefPtr.h>
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -41,7 +42,8 @@
</span><span class="cx"> public:
</span><span class="cx">     static Ref<WebGPUAdapter> create(Optional<GPURequestAdapterOptions>&&);
</span><span class="cx"> 
</span><del>-    RefPtr<WebGPUDevice> createDevice();
</del><ins>+    using DeviceRequestPromise = DOMPromiseDeferred<IDLInterface<WebGPUDevice>>;
+    void requestDevice(DeviceRequestPromise&&) const;
</ins><span class="cx">     
</span><span class="cx">     Optional<GPURequestAdapterOptions> options() const { return m_options; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWebGPUAdapteridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.idl (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.idl    2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUAdapter.idl       2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -33,5 +33,6 @@
</span><span class="cx">     // readonly attribute WebGPUExtensions extensions;
</span><span class="cx">     // readonly attribute WebGPULimits limits; Don't expose higher limits for now.
</span><span class="cx"> 
</span><del>-    WebGPUDevice createDevice(/*WebGPUDeviceDescriptor descriptor*/);
</del><ins>+    // May reject with DOMException  // TODO: DOMException("OperationError")?
+    Promise<WebGPUDevice> requestDevice(/*GPUDeviceDescriptor descriptor*/);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWebGPUDevicecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp     2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp        2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -63,18 +63,17 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RefPtr<WebGPUDevice> WebGPUDevice::create(Ref<WebGPUAdapter>&& adapter)
</del><ins>+RefPtr<WebGPUDevice> WebGPUDevice::tryCreate(Ref<const WebGPUAdapter>&& adapter)
</ins><span class="cx"> {
</span><del>-    if (auto device = GPUDevice::create(adapter->options()))
</del><ins>+    if (auto device = GPUDevice::tryCreate(adapter->options()))
</ins><span class="cx">         return adoptRef(new WebGPUDevice(WTFMove(adapter), device.releaseNonNull()));
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGPUDevice::WebGPUDevice(Ref<WebGPUAdapter>&& adapter, Ref<GPUDevice>&& device)
</del><ins>+WebGPUDevice::WebGPUDevice(Ref<const WebGPUAdapter>&& adapter, Ref<GPUDevice>&& device)
</ins><span class="cx">     : m_adapter(WTFMove(adapter))
</span><span class="cx">     , m_device(WTFMove(device))
</span><span class="cx"> {
</span><del>-    UNUSED_PARAM(m_adapter);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref<WebGPUBuffer> WebGPUDevice::createBuffer(GPUBufferDescriptor&& descriptor) const
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWebGPUDeviceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h       2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h  2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGPUDevice : public RefCounted<WebGPUDevice> {
</span><span class="cx"> public:
</span><del>-    static RefPtr<WebGPUDevice> create(Ref<WebGPUAdapter>&&);
</del><ins>+    static RefPtr<WebGPUDevice> tryCreate(Ref<const WebGPUAdapter>&&);
</ins><span class="cx"> 
</span><span class="cx">     const WebGPUAdapter& adapter() const { return m_adapter.get(); }
</span><span class="cx">     const GPUDevice& device() const { return m_device.get(); }
</span><span class="lines">@@ -83,9 +83,9 @@
</span><span class="cx">     RefPtr<WebGPUQueue> getQueue() const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    WebGPUDevice(Ref<WebGPUAdapter>&&, Ref<GPUDevice>&&);
</del><ins>+    WebGPUDevice(Ref<const WebGPUAdapter>&&, Ref<GPUDevice>&&);
</ins><span class="cx"> 
</span><del>-    Ref<WebGPUAdapter> m_adapter;
</del><ins>+    Ref<const WebGPUAdapter> m_adapter;
</ins><span class="cx">     Ref<GPUDevice> m_device;
</span><span class="cx">     mutable RefPtr<WebGPUQueue> m_queue;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgpuGPUDeviceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h   2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h      2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> 
</span><span class="cx"> class GPUDevice : public RefCounted<GPUDevice>, public CanMakeWeakPtr<GPUDevice> {
</span><span class="cx"> public:
</span><del>-    static RefPtr<GPUDevice> create(Optional<GPURequestAdapterOptions>&&);
</del><ins>+    static RefPtr<GPUDevice> tryCreate(Optional<GPURequestAdapterOptions>&&);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr<GPUBuffer> tryCreateBuffer(GPUBufferDescriptor&&);
</span><span class="cx">     RefPtr<GPUTexture> tryCreateTexture(GPUTextureDescriptor&&) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgpucocoaGPUDeviceMetalmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm (243089 => 243090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm       2019-03-18 19:07:56 UTC (rev 243089)
+++ trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm  2019-03-18 19:18:50 UTC (rev 243090)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RefPtr<GPUDevice> GPUDevice::create(Optional<GPURequestAdapterOptions>&& options)
</del><ins>+RefPtr<GPUDevice> GPUDevice::tryCreate(Optional<GPURequestAdapterOptions>&& options)
</ins><span class="cx"> {
</span><span class="cx">     RetainPtr<MTLDevice> devicePtr;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>