Bug 194260 - Update WebGPU class names based on sketch.idl
Summary: Update WebGPU class names based on sketch.idl
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Justin Fan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-02-04 17:14 PST by Justin Fan
Modified: 2019-05-01 16:22 PDT (History)
12 users (show)

See Also:


Attachments
Patch (27.16 KB, patch)
2019-03-23 19:58 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (35.82 KB, patch)
2019-05-01 13:59 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (35.82 KB, patch)
2019-05-01 14:35 PDT, Justin Fan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Fan 2019-02-04 17:14:42 PST
The Web GPU API (https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl) has diverged from the WebKit Web GPU implementation in the naming of interfaces and dictionaries (from WebGPU* -> GPU*) and enums (from camelCase to hyphen-case).
Comment 1 Radar WebKit Bug Importer 2019-02-04 17:15:25 PST
<rdar://problem/47806315>
Comment 2 Justin Fan 2019-02-07 13:08:03 PST
This is also a good opportunity to simplify the Web GPU file structure in WebKit:

A lot of the dictionary classes are only referenced by one interface (e.g. GPUDevice) and their IDL definitions can be moved into that interface's file. Their C++ implementations can be made sub-structs of their interface's class. 

If this is decided to be preferable to what we have now, I'll make the changes for this patch.
Comment 3 Justin Fan 2019-03-04 13:20:25 PST
In addition, a lot of Web GPU function parameters are being passed as rvalue references (e.g. descriptor objects) when a raw reference will suffice.
Comment 4 Justin Fan 2019-03-07 12:19:02 PST
This work will be split into two parts:

1) Naming updates that affect how the API is used (enum class names, enum strings, function names)
2) Class name updates visible only through e.g. inspection (WebGPUDevice -> GPUDevice)
Comment 5 Justin Fan 2019-03-08 13:49:37 PST
To solve our IDL prefix discrepancy with Web GPU (WebGPU vs GPU), all IDL interface and dictionary names will continue using WebGPU* in order to match the implementation and to prevent confusion when parsing the IDL files, but be exposed to the DOM as GPU* as per the API.
Comment 6 Jon Lee 2019-03-18 13:55:27 PDT
Updating name to reflect that this bug now will handle just the class name updates.
Comment 7 Justin Fan 2019-03-23 19:58:53 PDT
Created attachment 365823 [details]
Patch
Comment 8 WebKit Commit Bot 2019-03-25 08:29:23 PDT
Comment on attachment 365823 [details]
Patch

Clearing flags on attachment: 365823

Committed r243438: <https://trac.webkit.org/changeset/243438>
Comment 9 WebKit Commit Bot 2019-03-25 08:29:25 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Truitt Savell 2019-03-25 14:10:44 PDT
Reverted r243438 for reason:

243319 Caused Mac WK2 testers to crash and become unresponsive.

Committed r243456: <https://trac.webkit.org/changeset/243456>
Comment 11 Truitt Savell 2019-03-25 14:11:49 PDT
This patch https://trac.webkit.org/changeset/243438 was blocking the rollout of https://trac.webkit.org/changeset/243419/webkit that broke Mac WK2 testing.
Comment 12 Radar WebKit Bug Importer 2019-04-29 13:45:48 PDT
<rdar://problem/50309484>
Comment 13 Justin Fan 2019-05-01 13:59:15 PDT
Created attachment 368704 [details]
Patch
Comment 14 Justin Fan 2019-05-01 14:35:30 PDT
Created attachment 368713 [details]
Patch
Comment 15 WebKit Commit Bot 2019-05-01 16:22:04 PDT
Comment on attachment 368713 [details]
Patch

Clearing flags on attachment: 368713

Committed r244856: <https://trac.webkit.org/changeset/244856>
Comment 16 WebKit Commit Bot 2019-05-01 16:22:06 PDT
All reviewed patches have been landed.  Closing bug.