[webkit-reviews] review granted: [Bug 220710] Validate ItemHandles when decoding them in GPUProcess : [Attachment 417865] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 21 08:39:25 PST 2021


Wenson Hsieh <wenson_hsieh at apple.com> has granted youenn fablet
<youennf at gmail.com>'s request for review:
Bug 220710: Validate ItemHandles when decoding them in GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=220710

Attachment 417865: Patch

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




--- Comment #5 from Wenson Hsieh <wenson_hsieh at apple.com> ---
Comment on attachment 417865
  --> https://bugs.webkit.org/attachment.cgi?id=417865
Patch

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

> Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp:543
> +template<typename, typename = void> inline constexpr bool HasIsValid =
false;
> +template<typename T> inline constexpr bool HasIsValid<T,
std::void_t<decltype(std::declval<T>().isValid())>> = true;

This is a really neat trick!

> Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp:559
> +bool ItemHandle::decodeInto(ItemHandle destination) const

Nit - I think the notion of "copying" is more accurate here than "decoding"
(the latter of which sounds like it would involve marshaling of data to and
from buffers, à la IPC encoding/decoding). Perhaps "createValidCopy" or
"copyWithValidation"?


More information about the webkit-reviews mailing list