[webkit-reviews] review granted: [Bug 237966] [iOS] WebAVMediaSelectionOption should implement -mediaType : [Attachment 454849] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 16 10:06:00 PDT 2022


Jer Noble <jer.noble at apple.com> has granted Eric Carlson
<eric.carlson at apple.com>'s request for review:
Bug 237966: [iOS] WebAVMediaSelectionOption should implement -mediaType
https://bugs.webkit.org/show_bug.cgi?id=237966

Attachment 454849: Patch

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




--- Comment #3 from Jer Noble <jer.noble at apple.com> ---
Comment on attachment 454849
  --> https://bugs.webkit.org/attachment.cgi?id=454849
Patch

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

> Source/WebCore/platform/MediaSelectionOption.h:87
> +template<class Decoder> std::optional<MediaSelectionOption>
MediaSelectionOption::decode(Decoder& decoder)
> +{
> +    MediaSelectionOption option;
> +
> +    if (!decoder.decode(option.mediaType))
> +	   return { };
> +
> +    if (!decoder.decode(option.displayName))
> +	   return { };
> +
> +    if (!decoder.decode(option.legibleType))
> +	   return { };
> +
> +    return option;
> +}

Nit: this could be:

template<class Decoder> bool MediaSelectionOption::decode(Decoder& decoder,
MediaSelectionOption& option)
{
    return decoder.decode(option.mediaType)
	&& decoder.decode(option.displayName)
	&& decoder.decode(option.legibleType);
}

Slightly more compact. No hard evidence if this is true or not, but my
intuition says it's slightly more efficient as well.


More information about the webkit-reviews mailing list