[webkit-reviews] review granted: [Bug 199655] [WebGPU] Implement GPUError and error scopes : [Attachment 373897] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 11 09:31:37 PDT 2019


Myles C. Maxfield <mmaxfield at apple.com> has granted Justin Fan
<justin_fan at apple.com>'s request for review:
Bug 199655: [WebGPU] Implement GPUError and error scopes
https://bugs.webkit.org/show_bug.cgi?id=199655

Attachment 373897: Patch

https://bugs.webkit.org/attachment.cgi?id=373897&action=review




--- Comment #9 from Myles C. Maxfield <mmaxfield at apple.com> ---
Comment on attachment 373897
  --> https://bugs.webkit.org/attachment.cgi?id=373897
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=373897&action=review

> Source/WebCore/Modules/webgpu/WebGPUDevice.h:74
> +using ErrorPromise =
DOMPromiseDeferred<IDLNullable<IDLUnion<IDLInterface<GPUOutOfMemoryError>,
IDLInterface<GPUValidationError>>>>;

😱

Can we break this up into multiple lines of typedefs?

> Source/WebCore/platform/graphics/gpu/GPUError.cpp:39
> +	   return
GPUError(RefPtr<GPUOutOfMemoryError>(GPUOutOfMemoryError::create()));

I know I told you to do this, but you might want to consider making all errors
the same type and using a member enum to differentiate them. Whatever you think
is best.

> Source/WebCore/platform/graphics/gpu/GPUError.h:41
> +using GPUError = Variant<RefPtr<GPUOutOfMemoryError>,
RefPtr<GPUValidationError>>;

Why not RefPtr<JustinsNewClass> which is ref counted and either hasa or isa
variant? Or a single type with a member enum? It’s pretty awkward to put
multiple RefPtrs in a variant.


More information about the webkit-reviews mailing list