| Summary: | [iOS] WebAVMediaSelectionOption should implement -mediaType | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Eric Carlson <eric.carlson> | ||||||
| Component: | Media | Assignee: | Eric Carlson <eric.carlson> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 239686 | ||||||||
| Attachments: |
|
||||||||
|
Description
Eric Carlson
2022-03-16 09:22:41 PDT
Created attachment 454849 [details]
Patch
Comment on attachment 454849 [details] 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. Created attachment 454852 [details]
Patch for landing
Committed r291361 (248493@main): <https://commits.webkit.org/248493@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 454852 [details]. |