[webkit-changes] [WebKit/WebKit] b0bcfd: Generate serialization of SerializedPlatformDataCu...

Alex Christensen noreply at github.com
Tue Feb 6 08:38:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b0bcfd764ea406c4eea381e0a0191977fc06ad81
      https://github.com/WebKit/WebKit/commit/b0bcfd764ea406c4eea381e0a0191977fc06ad81
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/SerializedPlatformDataCueValue.h
    A Source/WebCore/platform/cocoa/SerializedPlatformDataCueValue.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
    M Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h
    M Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm
    M Source/WebKit/Shared/WebCoreArgumentCoders.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp
    M Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm
    M Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp

  Log Message:
  -----------
  Generate serialization of SerializedPlatformDataCueValue
https://bugs.webkit.org/show_bug.cgi?id=268805

Reviewed by Eric Carlson.

Before this change, SerializedPlatformDataCueValue was a strange abstraction that contained
a RetainPtr<id> that was either a AVMetadataItem or an NSDictionary extracted from it, and
there wasn't a good way to tell if that extraction had happened from the abstraction itself.
Also, the NSDictionary had a generous allowance for the types of contents it would allow to
be serialized across IPC.

This changes SerializedPlatformDataCueValue to be a container for strictly typed data that
is extracted from an AVMetadataItem.  I made a few assumptions to make this possible:

1. AVMetadataItem.extraAttributes contains only keys and values we care about that have a
   type of NSString.  Others will now be ignored.  Non-String keys were already ignored.
   AVMetadataItem.h pointed to AVMetadataFormat.h which seems to indicate this is a reasonable
   assumption.
2. AVMetadataItem.key contains only an NSString if we care about it.  The API indicates it
   is a id<NSObject, NSCopying> but I don't think we support anything useful that isn't an
   NSString.
3. AVMetadataItem.value is either nil, a number, a string, an NSDate, or an NSData.
   The existence of stringValue, numberValue, dateValue, and dataValue selectors on
   AVMetadataItem objects seems to indicate that these are the valid values.

* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/SerializedPlatformDataCueValue.h:
(WebCore::SerializedPlatformDataCueValue::SerializedPlatformDataCueValue):
(WebCore::SerializedPlatformDataCueValue::data const):
(WebCore::SerializedPlatformDataCueValue::platformType const): Deleted.
(WebCore::SerializedPlatformDataCueValue::nativeValue const): Deleted.
(WebCore::SerializedPlatformDataCueValue::encodingRequiresPlatformData const): Deleted.
(): Deleted.
* Source/WebCore/platform/cocoa/SerializedPlatformDataCueValue.mm: Added.
(WebCore::SerializedPlatformDataCueValue::SerializedPlatformDataCueValue):
(WebCore::SerializedPlatformDataCueValue::toNSDictionary const):
(WebCore::SerializedPlatformDataCueValue::operator== const):
(WebCore::SerializedPlatformDataCueValue::Data::operator== const):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
* Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h:
* Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm:
(WebCore::SerializedPlatformDataCueMac::SerializedPlatformDataCueMac):
(WebCore::SerializedPlatformDataCueMac::deserialize const):
(WebCore::SerializedPlatformDataCueMac::isEqual const):
(WebCore::toSerializedPlatformDataCueMac):
(WebCore::SerializedPlatformDataCueMac::encodableValue const):
(WebCore::jsValueWithAVMetadataItemInContext):
(WebCore::NSDictionaryWithAVMetadataItem): Deleted.
* Source/WebKit/Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode): Deleted.
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode): Deleted.
* Source/WebKit/Shared/WebCoreArgumentCoders.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encodePlatformData): Deleted.
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decodePlatformData): Deleted.

Canonical link: https://commits.webkit.org/274146@main




More information about the webkit-changes mailing list