[webkit-reviews] review granted: [Bug 225227] Use OptionSet for MediaProducer::MediaStateFlags : [Attachment 427543] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 3 09:15:27 PDT 2021


Eric Carlson <eric.carlson at apple.com> has granted youenn fablet
<youennf at gmail.com>'s request for review:
Bug 225227: Use OptionSet for MediaProducer::MediaStateFlags
https://bugs.webkit.org/show_bug.cgi?id=225227

Attachment 427543: Patch

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




--- Comment #3 from Eric Carlson <eric.carlson at apple.com> ---
Comment on attachment 427543
  --> https://bugs.webkit.org/attachment.cgi?id=427543
Patch

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

> Source/WebCore/Modules/airplay/WebMediaSessionManager.cpp:278
> +    MediaProducer::MediaStateFlags updateConfigurationFlags {
MediaProducer::MediaState::RequiresPlaybackTargetMonitoring,
MediaProducer::MediaState::HasPlaybackTargetAvailabilityListener,
MediaProducer::MediaState::HasAudioOrVideo };

Not new to this refactoring, but this could be `static constexpr`

> Source/WebCore/Modules/airplay/WebMediaSessionManager.cpp:282
> +    MediaProducer::MediaStateFlags playingToTargetFlags {
MediaProducer::MediaState::IsPlayingToExternalDevice,
MediaProducer::MediaState::IsPlayingVideo };

Ditto

> Source/WebCore/html/HTMLMediaElement.cpp:7696
> +	   if (hasMediaStreamSrcObject() &&
mediaState().containsAny(MediaProducer::MediaState::IsPlayingAudio) &&
document().mediaState().containsAny(MediaProducer::MediaState::HasActiveAudioCa
ptureDevice)) {

Nit: although `OptionSet::contains()` and `OptionSet::constainsAny()` are the
same, it is slightly odd all throughout this patch you sometimes use
`constainsAny` and other times use 'contains` to test for just one value.


More information about the webkit-reviews mailing list