Bug 224550

Summary: Use OptionSet for MediaProducer::MutedStateFlags
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, cgarcia, eric.carlson, ews-watchlist, glenn, gustavo, hta, jer.noble, philipj, sergio, tommyw, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch for landing none

Description youenn fablet 2021-04-14 08:26:19 PDT
Use OptionSet for MediaProducer::MediaStateFlags and MediaProducer::MutedStateFlags.
This would prevent things like https://bugs.webkit.org/show_bug.cgi?id=224548.
Comment 1 Radar WebKit Bug Importer 2021-04-21 08:27:17 PDT
<rdar://problem/76960294>
Comment 2 youenn fablet 2021-04-30 05:51:59 PDT
Created attachment 427410 [details]
Patch
Comment 3 youenn fablet 2021-04-30 07:15:27 PDT
Created attachment 427415 [details]
Patch
Comment 4 youenn fablet 2021-04-30 07:53:50 PDT
Created attachment 427418 [details]
Patch
Comment 5 EWS Watchlist 2021-04-30 07:54:41 PDT
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
Comment 6 youenn fablet 2021-04-30 08:08:02 PDT
Created attachment 427420 [details]
Patch
Comment 7 Eric Carlson 2021-04-30 10:23:07 PDT
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
Comment 8 youenn fablet 2021-05-03 00:07:56 PDT
(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.
Comment 9 youenn fablet 2021-05-03 00:08:22 PDT
Created attachment 427541 [details]
Patch for landing
Comment 10 EWS 2021-05-03 01:12:59 PDT
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].