Use OptionSet for MediaProducer::MediaStateFlags and MediaProducer::MutedStateFlags. This would prevent things like https://bugs.webkit.org/show_bug.cgi?id=224548.
<rdar://problem/76960294>
Created attachment 427410 [details] Patch
Created attachment 427415 [details] Patch
Created attachment 427418 [details] Patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Created attachment 427420 [details] Patch
Comment on attachment 427420 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=427420&action=review > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:1018 > - mutedState = WebCore::MediaProducer::AudioCaptureIsMuted; > + mutedState.add(WebCore::MediaProducer::MutedState::AudioCaptureIsMuted); It looks like this fixes a potential bug, nice! > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:1039 > - mutedState = WebCore::MediaProducer::VideoCaptureIsMuted; > + mutedState.add(WebCore::MediaProducer::MutedState::VideoCaptureIsMuted); Ditto
(In reply to Eric Carlson from comment #7) > Comment on attachment 427420 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=427420&action=review > > > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:1018 > > - mutedState = WebCore::MediaProducer::AudioCaptureIsMuted; > > + mutedState.add(WebCore::MediaProducer::MutedState::AudioCaptureIsMuted); > > It looks like this fixes a potential bug, nice! > > > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:1039 > > - mutedState = WebCore::MediaProducer::VideoCaptureIsMuted; > > + mutedState.add(WebCore::MediaProducer::MutedState::VideoCaptureIsMuted); > > Ditto Good point, I updated the API test accordingly.
Created attachment 427541 [details] Patch for landing
Committed r276892 (237238@main): <https://commits.webkit.org/237238@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427541 [details].