Title: [291361] trunk/Source
Revision
291361
Author
[email protected]
Date
2022-03-16 13:29:20 -0700 (Wed, 16 Mar 2022)

Log Message

[iOS] WebAVMediaSelectionOption should implement -mediaType
https://bugs.webkit.org/show_bug.cgi?id=237966
rdar://89934589

Reviewed by Jer Noble.

Source/WebCore:

WebKit uses AVKit to implement "video fullscreen" on iOS. AVKit can only be used
in the UI process, but WebKit's AVFoundation objects are in the GPU process, so we
create "proxy" objects in the UI process and pass state from them between the two
processes. One such object is WebAVMediaSelectionOption, which proxies for an
AVMediaSelectionOption. This proxy originally only implemented -localizedDisplayName
but AVKit now sometimes uses -mediaType, which causes an assert when it messages the
non-existent selector. Add -mediaType to fix the assert, and add log-only stubs
for every other AVMediaSelectionOption selector to catch future changes.

* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::mediaSelectionOptionForTrack const):
* platform/MediaSelectionOption.h:
(WebCore::MediaSelectionOption::MediaSelectionOption):
(WebCore::MediaSelectionOption::isolatedCopy const):
(WebCore::MediaSelectionOption::isolatedCopy):
(WebCore::MediaSelectionOption::encode const):
(WebCore::MediaSelectionOption::decode):
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::toAVMediaType):
(WebCore::mediaSelectionOptions):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVMediaSelectionOption initWithMediaType:displayName:]):
(-[WebAVMediaSelectionOption mediaSubTypes]):
(-[WebAVMediaSelectionOption hasMediaCharacteristic:]):
(-[WebAVMediaSelectionOption isPlayable]):
(-[WebAVMediaSelectionOption extendedLanguageTag]):
(-[WebAVMediaSelectionOption locale]):
(-[WebAVMediaSelectionOption commonMetadata]):
(-[WebAVMediaSelectionOption availableMetadataFormats]):
(-[WebAVMediaSelectionOption metadataForFormat:]):
(-[WebAVMediaSelectionOption associatedMediaSelectionOptionInMediaSelectionGroup:]):
(-[WebAVMediaSelectionOption propertyList]):
(-[WebAVMediaSelectionOption displayNameWithLocale:]):
(-[WebAVMediaSelectionOption mediaCharacteristics]):
(-[WebAVMediaSelectionOption outOfBandSource]):
(-[WebAVMediaSelectionOption outOfBandIdentifier]):
(-[WebAVMediaSelectionOption _isDesignatedDefault]):
(-[WebAVMediaSelectionOption languageCode]):
(-[WebAVMediaSelectionOption track]):
* platform/mac/WebPlaybackControlsManager.mm:
(toAVTouchBarMediaSelectionOptionType):
(mediaSelectionOptions):

Source/WebKit:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MediaSelectionOption>::encode): Deleted.
(IPC::ArgumentCoder<MediaSelectionOption>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291360 => 291361)


--- trunk/Source/WebCore/ChangeLog	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebCore/ChangeLog	2022-03-16 20:29:20 UTC (rev 291361)
@@ -1,3 +1,55 @@
+2022-03-16  Eric Carlson  <[email protected]>
+
+        [iOS] WebAVMediaSelectionOption should implement -mediaType
+        https://bugs.webkit.org/show_bug.cgi?id=237966
+        rdar://89934589
+
+        Reviewed by Jer Noble.
+
+        WebKit uses AVKit to implement "video fullscreen" on iOS. AVKit can only be used
+        in the UI process, but WebKit's AVFoundation objects are in the GPU process, so we
+        create "proxy" objects in the UI process and pass state from them between the two
+        processes. One such object is WebAVMediaSelectionOption, which proxies for an
+        AVMediaSelectionOption. This proxy originally only implemented -localizedDisplayName
+        but AVKit now sometimes uses -mediaType, which causes an assert when it messages the
+        non-existent selector. Add -mediaType to fix the assert, and add log-only stubs 
+        for every other AVMediaSelectionOption selector to catch future changes.
+
+        * page/CaptionUserPreferences.cpp:
+        (WebCore::CaptionUserPreferences::mediaSelectionOptionForTrack const):
+        * platform/MediaSelectionOption.h:
+        (WebCore::MediaSelectionOption::MediaSelectionOption):
+        (WebCore::MediaSelectionOption::isolatedCopy const):
+        (WebCore::MediaSelectionOption::isolatedCopy):
+        (WebCore::MediaSelectionOption::encode const):
+        (WebCore::MediaSelectionOption::decode):
+        * platform/ios/PlaybackSessionInterfaceAVKit.mm:
+        (WebCore::toAVMediaType):
+        (WebCore::mediaSelectionOptions):
+        * platform/ios/WebAVPlayerController.h:
+        * platform/ios/WebAVPlayerController.mm:
+        (-[WebAVMediaSelectionOption initWithMediaType:displayName:]):
+        (-[WebAVMediaSelectionOption mediaSubTypes]):
+        (-[WebAVMediaSelectionOption hasMediaCharacteristic:]):
+        (-[WebAVMediaSelectionOption isPlayable]):
+        (-[WebAVMediaSelectionOption extendedLanguageTag]):
+        (-[WebAVMediaSelectionOption locale]):
+        (-[WebAVMediaSelectionOption commonMetadata]):
+        (-[WebAVMediaSelectionOption availableMetadataFormats]):
+        (-[WebAVMediaSelectionOption metadataForFormat:]):
+        (-[WebAVMediaSelectionOption associatedMediaSelectionOptionInMediaSelectionGroup:]):
+        (-[WebAVMediaSelectionOption propertyList]):
+        (-[WebAVMediaSelectionOption displayNameWithLocale:]):
+        (-[WebAVMediaSelectionOption mediaCharacteristics]):
+        (-[WebAVMediaSelectionOption outOfBandSource]):
+        (-[WebAVMediaSelectionOption outOfBandIdentifier]):
+        (-[WebAVMediaSelectionOption _isDesignatedDefault]):
+        (-[WebAVMediaSelectionOption languageCode]):
+        (-[WebAVMediaSelectionOption track]):
+        * platform/mac/WebPlaybackControlsManager.mm:
+        (toAVTouchBarMediaSelectionOptionType):
+        (mediaSelectionOptions):
+
 2022-03-16  Philippe Normand  <[email protected]>
 
         Migrate use of MediaSampleGStreamer to VideoFrame in WebRTC pipelines

Modified: trunk/Source/WebCore/page/CaptionUserPreferences.cpp (291360 => 291361)


--- trunk/Source/WebCore/page/CaptionUserPreferences.cpp	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebCore/page/CaptionUserPreferences.cpp	2022-03-16 20:29:20 UTC (rev 291361)
@@ -223,12 +223,31 @@
 
 MediaSelectionOption CaptionUserPreferences::mediaSelectionOptionForTrack(TextTrack* track) const
 {
-    auto type = MediaSelectionOption::Type::Regular;
+    auto legibleType = MediaSelectionOption::LegibleType::Regular;
     if (track == &TextTrack::captionMenuOffItem())
-        type = MediaSelectionOption::Type::LegibleOff;
+        legibleType = MediaSelectionOption::LegibleType::LegibleOff;
     else if (track == &TextTrack::captionMenuAutomaticItem())
-        type = MediaSelectionOption::Type::LegibleAuto;
-    return { displayNameForTrack(track), type };
+        legibleType = MediaSelectionOption::LegibleType::LegibleAuto;
+
+    auto mediaType = MediaSelectionOption::MediaType::Unknown;
+    switch (track->kind()) {
+    case TextTrack::Kind::Forced:
+    case TextTrack::Kind::Descriptions:
+    case TextTrack::Kind::Subtitles:
+        mediaType = MediaSelectionOption::MediaType::Subtitles;
+        break;
+    case TextTrack::Kind::Captions:
+        mediaType = MediaSelectionOption::MediaType::Captions;
+        break;
+    case TextTrack::Kind::Metadata:
+        mediaType = MediaSelectionOption::MediaType::Metadata;
+        break;
+    case TextTrack::Kind::Chapters:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    return { mediaType, displayNameForTrack(track), legibleType };
 }
     
 Vector<RefPtr<TextTrack>> CaptionUserPreferences::sortedTrackListForMenu(TextTrackList* trackList, HashSet<TextTrack::Kind> kinds)
@@ -273,7 +292,7 @@
 
 MediaSelectionOption CaptionUserPreferences::mediaSelectionOptionForTrack(AudioTrack* track) const
 {
-    return { displayNameForTrack(track), MediaSelectionOption::Type::Regular };
+    return { MediaSelectionOption::MediaType::Audio, displayNameForTrack(track), MediaSelectionOption::LegibleType::Regular };
 }
 
 Vector<RefPtr<AudioTrack>> CaptionUserPreferences::sortedTrackListForMenu(AudioTrackList* trackList)

Modified: trunk/Source/WebCore/platform/MediaSelectionOption.h (291360 => 291361)


--- trunk/Source/WebCore/platform/MediaSelectionOption.h	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebCore/platform/MediaSelectionOption.h	2022-03-16 20:29:20 UTC (rev 291361)
@@ -30,7 +30,15 @@
 namespace WebCore {
 
 struct MediaSelectionOption {
-    enum class Type {
+    enum class MediaType {
+        Unknown,
+        Audio,
+        Subtitles,
+        Captions,
+        Metadata,
+    };
+
+    enum class LegibleType {
         Regular,
         LegibleOff,
         LegibleAuto,
@@ -37,17 +45,60 @@
     };
 
     MediaSelectionOption() = default;
-    MediaSelectionOption(const String& displayName, Type type)
-        : displayName { displayName }
-        , type { type }
+    MediaSelectionOption(MediaType mediaType, const String& displayName, LegibleType legibleType)
+        : mediaType { mediaType }
+        , displayName { displayName }
+        , legibleType { legibleType }
     {
     }
 
-    MediaSelectionOption isolatedCopy() const & { return { displayName.isolatedCopy(), type }; }
-    MediaSelectionOption isolatedCopy() && { return { WTFMove(displayName).isolatedCopy(), type }; }
+    MediaSelectionOption isolatedCopy() const & { return { mediaType, displayName.isolatedCopy(), legibleType }; }
+    MediaSelectionOption isolatedCopy() && { return { mediaType, WTFMove(displayName).isolatedCopy(), legibleType }; }
 
+    template<class Encoder> void encode(Encoder&) const;
+    template<class Decoder> static bool WARN_UNUSED_RETURN decode(Decoder&, MediaSelectionOption&);
+
+    MediaType mediaType { MediaType::Unknown };
     String displayName;
-    Type type { Type::Regular };
+    LegibleType legibleType { LegibleType::Regular };
 };
 
+template<class Encoder> void MediaSelectionOption::encode(Encoder& encoder) const
+{
+    encoder << mediaType;
+    encoder << displayName;
+    encoder << legibleType;
+}
+
+template<class Decoder> bool MediaSelectionOption::decode(Decoder& decoder, MediaSelectionOption& option)
+{
+    return decoder.decode(option.mediaType)
+        && decoder.decode(option.displayName)
+        && decoder.decode(option.legibleType);
+}
+
 } // namespace WebCore
+
+namespace WTF {
+
+template<> struct EnumTraits<WebCore::MediaSelectionOption::MediaType> {
+    using values = EnumValues<
+        WebCore::MediaSelectionOption::MediaType,
+        WebCore::MediaSelectionOption::MediaType::Unknown,
+        WebCore::MediaSelectionOption::MediaType::Audio,
+        WebCore::MediaSelectionOption::MediaType::Subtitles,
+        WebCore::MediaSelectionOption::MediaType::Captions,
+        WebCore::MediaSelectionOption::MediaType::Metadata
+    >;
+};
+
+template<> struct EnumTraits<WebCore::MediaSelectionOption::LegibleType> {
+    using values = EnumValues<
+        WebCore::MediaSelectionOption::LegibleType,
+        WebCore::MediaSelectionOption::LegibleType::Regular,
+        WebCore::MediaSelectionOption::LegibleType::LegibleOff,
+        WebCore::MediaSelectionOption::LegibleType::LegibleAuto
+    >;
+};
+
+} // namespace WTF

Modified: trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm (291360 => 291361)


--- trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm	2022-03-16 20:29:20 UTC (rev 291361)
@@ -42,6 +42,7 @@
 #import <wtf/text/WTFString.h>
 
 #import <pal/cf/CoreMediaSoftLink.h>
+#import <pal/cocoa/AVFoundationSoftLink.h>
 
 SOFTLINK_AVKIT_FRAMEWORK()
 SOFT_LINK_CLASS_OPTIONAL(AVKit, AVValueTiming)
@@ -161,12 +162,33 @@
     [m_playerController setCanScanBackward:canPlayFastReverse];
 }
 
+static AVMediaType toAVMediaType(MediaSelectionOption::MediaType type)
+{
+    switch (type) {
+    case MediaSelectionOption::MediaType::Audio:
+        return AVMediaTypeAudio;
+        break;
+    case MediaSelectionOption::MediaType::Subtitles:
+        return AVMediaTypeSubtitle;
+        break;
+    case MediaSelectionOption::MediaType::Captions:
+        return AVMediaTypeClosedCaption;
+        break;
+    case MediaSelectionOption::MediaType::Metadata:
+        return AVMediaTypeMetadata;
+        break;
+    case MediaSelectionOption::MediaType::Unknown:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    return AVMediaTypeMetadata;
+}
+
 static RetainPtr<NSArray> mediaSelectionOptions(const Vector<MediaSelectionOption>& options)
 {
     return createNSArray(options, [] (auto& option) {
-        auto webOption = adoptNS([[WebAVMediaSelectionOption alloc] init]);
-        [webOption setLocalizedDisplayName:option.displayName];
-        return webOption;
+        return [[WebAVMediaSelectionOption alloc] initWithMediaType:toAVMediaType(option.mediaType) displayName:option.displayName];
     });
 }
 

Modified: trunk/Source/WebCore/platform/ios/WebAVPlayerController.h (291360 => 291361)


--- trunk/Source/WebCore/platform/ios/WebAVPlayerController.h	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebCore/platform/ios/WebAVPlayerController.h	2022-03-16 20:29:20 UTC (rev 291361)
@@ -33,7 +33,11 @@
 }
 
 @interface WebAVMediaSelectionOption : NSObject
+- (instancetype)initWithMediaType:(AVMediaType)type displayName:(NSString *)displayName;
+
 @property (retain) NSString *localizedDisplayName;
+@property (nonatomic, readonly) AVMediaType mediaType;
+
 @end
 
 WEBCORE_EXPORT @interface WebAVPlayerController : NSObject {

Modified: trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm (291360 => 291361)


--- trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2022-03-16 20:29:20 UTC (rev 291361)
@@ -762,6 +762,18 @@
 
 @implementation WebAVMediaSelectionOption
 
+- (instancetype)initWithMediaType:(AVMediaType)mediaType displayName:(NSString *)displayName
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    _mediaType = mediaType;
+    _localizedDisplayName = displayName;
+
+    return self;
+}
+
 - (void)dealloc
 {
     [_localizedDisplayName release];
@@ -768,6 +780,125 @@
     [super dealloc];
 }
 
+- (NSArray<NSNumber *> *)mediaSubTypes
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption mediaSubTypes] unimplemented");
+    return @[];
+}
+
+- (BOOL)hasMediaCharacteristic:(AVMediaCharacteristic)mediaCharacteristic
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption hasMediaCharacteristic:] unimplemented");
+    return NO;
+}
+
+- (BOOL) isPlayable
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption isPlayable:] unimplemented");
+    return YES;
+}
+
+- (NSString *)extendedLanguageTag
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption extendedLanguageTag] unimplemented");
+    return nil;
+}
+
+- (NSLocale *)locale
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption locale] unimplemented");
+    return nil;
+}
+
+- (NSArray<AVMetadataItem *> *)commonMetadata
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption commonMetadata] unimplemented");
+    return @[];
+}
+
+- (NSArray<NSString *> *)availableMetadataFormats
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption availableMetadataFormats] unimplemented");
+    return @[];
+}
+
+- (NSArray<AVMetadataItem *> *)metadataForFormat:(NSString *)format
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption metadataForFormat:] unimplemented");
+    return @[];
+}
+
+- (AVMediaSelectionOption *)associatedMediaSelectionOptionInMediaSelectionGroup:(AVMediaSelectionGroup *)mediaSelectionGroup
+{
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption associatedMediaSelectionOptionInMediaSelectionGroup] unimplemented");
+    ASSERT_NOT_REACHED();
+    return nil;
+}
+
+- (id)propertyList
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption propertyList] unimplemented");
+    return @[];
+}
+
+- (NSString *)displayNameWithLocale:(NSLocale *)locale
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption displayNameWithLocale:] unimplemented");
+    return nil;
+}
+
+- (NSArray<NSString *> *)mediaCharacteristics
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption mediaCharacteristics] unimplemented");
+    return @[];
+}
+
+- (NSString *)outOfBandSource
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption outOfBandSource] unimplemented");
+    return nil;
+}
+
+- (NSString *)outOfBandIdentifier
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption outOfBandIdentifier] unimplemented");
+    return nil;
+}
+
+- (BOOL)_isDesignatedDefault
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption _isDesignatedDefault] unimplemented");
+    return NO;
+}
+
+- (NSString *)languageCode
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption languageCode] unimplemented");
+    return nil;
+}
+
+- (AVAssetTrack *)track
+{
+    ASSERT_NOT_REACHED();
+    WTFLogAlways("ERROR: -[WebAVMediaSelectionOption track:] unimplemented");
+    return nil;
+}
+
 @end
 
 #endif // PLATFORM(COCOA) && HAVE(AVKIT)

Modified: trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm (291360 => 291361)


--- trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm	2022-03-16 20:29:20 UTC (rev 291361)
@@ -244,14 +244,14 @@
         model->selectLegibleMediaOption(index != NSNotFound ? index : UINT64_MAX);
 }
 
-static AVTouchBarMediaSelectionOptionType toAVTouchBarMediaSelectionOptionType(MediaSelectionOption::Type type)
+static AVTouchBarMediaSelectionOptionType toAVTouchBarMediaSelectionOptionType(MediaSelectionOption::LegibleType type)
 {
     switch (type) {
-    case MediaSelectionOption::Type::Regular:
+    case MediaSelectionOption::LegibleType::Regular:
         return AVTouchBarMediaSelectionOptionTypeRegular;
-    case MediaSelectionOption::Type::LegibleOff:
+    case MediaSelectionOption::LegibleType::LegibleOff:
         return AVTouchBarMediaSelectionOptionTypeLegibleOff;
-    case MediaSelectionOption::Type::LegibleAuto:
+    case MediaSelectionOption::LegibleType::LegibleAuto:
         return AVTouchBarMediaSelectionOptionTypeLegibleAuto;
     }
 
@@ -262,7 +262,7 @@
 static RetainPtr<NSArray> mediaSelectionOptions(const Vector<MediaSelectionOption>& options)
 {
     return createNSArray(options, [] (auto& option) {
-        return adoptNS([allocAVTouchBarMediaSelectionOptionInstance() initWithTitle:option.displayName type:toAVTouchBarMediaSelectionOptionType(option.type)]);
+        return adoptNS([allocAVTouchBarMediaSelectionOptionInstance() initWithTitle:option.displayName type:toAVTouchBarMediaSelectionOptionType(option.legibleType)]);
     });
 }
 

Modified: trunk/Source/WebKit/ChangeLog (291360 => 291361)


--- trunk/Source/WebKit/ChangeLog	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebKit/ChangeLog	2022-03-16 20:29:20 UTC (rev 291361)
@@ -1,3 +1,16 @@
+2022-03-16  Eric Carlson  <[email protected]>
+
+        [iOS] WebAVMediaSelectionOption should implement -mediaType
+        https://bugs.webkit.org/show_bug.cgi?id=237966
+        rdar://89934589
+
+        Reviewed by Jer Noble.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<MediaSelectionOption>::encode): Deleted.
+        (IPC::ArgumentCoder<MediaSelectionOption>::decode): Deleted.
+        * Shared/WebCoreArgumentCoders.h:
+
 2022-03-16  Per Arne Vollan  <[email protected]>
 
         Incorrect header name used in __has_include

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (291360 => 291361)


--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2022-03-16 20:29:20 UTC (rev 291361)
@@ -2880,27 +2880,6 @@
 
 #endif
 
-void ArgumentCoder<MediaSelectionOption>::encode(Encoder& encoder, const MediaSelectionOption& option)
-{
-    encoder << option.displayName;
-    encoder << option.type;
-}
-
-std::optional<MediaSelectionOption> ArgumentCoder<MediaSelectionOption>::decode(Decoder& decoder)
-{
-    std::optional<String> displayName;
-    decoder >> displayName;
-    if (!displayName)
-        return std::nullopt;
-    
-    std::optional<MediaSelectionOption::Type> type;
-    decoder >> type;
-    if (!type)
-        return std::nullopt;
-    
-    return {{ WTFMove(*displayName), WTFMove(*type) }};
-}
-
 void ArgumentCoder<PromisedAttachmentInfo>::encode(Encoder& encoder, const PromisedAttachmentInfo& info)
 {
 #if ENABLE(ATTACHMENT_ELEMENT)

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h (291360 => 291361)


--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h	2022-03-16 19:35:53 UTC (rev 291360)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h	2022-03-16 20:29:20 UTC (rev 291361)
@@ -710,11 +710,6 @@
 
 #endif
 
-template<> struct ArgumentCoder<WebCore::MediaSelectionOption> {
-    static void encode(Encoder&, const WebCore::MediaSelectionOption&);
-    static std::optional<WebCore::MediaSelectionOption> decode(Decoder&);
-};
-
 template<> struct ArgumentCoder<WebCore::PromisedAttachmentInfo> {
     static void encode(Encoder&, const WebCore::PromisedAttachmentInfo&);
     static WARN_UNUSED_RETURN bool decode(Decoder&, WebCore::PromisedAttachmentInfo&);
@@ -905,15 +900,6 @@
 };
 #endif
 
-template<> struct EnumTraits<WebCore::MediaSelectionOption::Type> {
-    using values = EnumValues<
-        WebCore::MediaSelectionOption::Type,
-        WebCore::MediaSelectionOption::Type::Regular,
-        WebCore::MediaSelectionOption::Type::LegibleOff,
-        WebCore::MediaSelectionOption::Type::LegibleAuto
-    >;
-};
-
 template <> struct EnumTraits<WebCore::WorkerType> {
     using values = EnumValues<
         WebCore::WorkerType,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to