Bug 224550 - Use OptionSet for MediaProducer::MutedStateFlags
Summary: Use OptionSet for MediaProducer::MutedStateFlags
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-14 08:26 PDT by youenn fablet
Modified: 2021-05-03 01:13 PDT (History)
13 users (show)

See Also:


Attachments
Patch (19.61 KB, patch)
2021-04-30 05:51 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (19.63 KB, patch)
2021-04-30 07:15 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (20.59 KB, patch)
2021-04-30 07:53 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (20.60 KB, patch)
2021-04-30 08:08 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (24.54 KB, patch)
2021-05-03 00:08 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].