Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f10ee49ef636c10dd181239c2b624bf85a954ebc
      
https://github.com/WebKit/WebKit/commit/f10ee49ef636c10dd181239c2b624bf85a954ebc
  Author: Brady Eidson <beid...@apple.com>
  Date:   2023-11-11 (Sat, 11 Nov 2023)

  Changed paths:
    M Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h
    M Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm
    M Source/WebKit/DerivedSources-input.xcfilelist
    M Source/WebKit/DerivedSources.make
    M Source/WebKit/Platform/IPC/Decoder.h
    M Source/WebKit/Scripts/generate-serializers.py
    M Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.cpp
    M Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h
    M Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm
    A Source/WebKit/Shared/Cocoa/CoreIPCArray.h
    A Source/WebKit/Shared/Cocoa/CoreIPCArray.serialization.in
    A Source/WebKit/Shared/Cocoa/CoreIPCCFType.h
    A Source/WebKit/Shared/Cocoa/CoreIPCCFType.serialization.in
    A Source/WebKit/Shared/Cocoa/CoreIPCColor.h
    A Source/WebKit/Shared/Cocoa/CoreIPCColor.serialization.in
    M Source/WebKit/Shared/Cocoa/CoreIPCData.h
    M Source/WebKit/Shared/Cocoa/CoreIPCDate.h
    A Source/WebKit/Shared/Cocoa/CoreIPCDictionary.h
    A Source/WebKit/Shared/Cocoa/CoreIPCDictionary.serialization.in
    A Source/WebKit/Shared/Cocoa/CoreIPCFont.h
    A Source/WebKit/Shared/Cocoa/CoreIPCFont.serialization.in
    A Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.h
    A Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.mm
    A Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.serialization.in
    A Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.h
    A Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.mm
    A Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.serialization.in
    A Source/WebKit/Shared/Cocoa/CoreIPCString.h
    A Source/WebKit/Shared/Cocoa/CoreIPCString.serialization.in
    A Source/WebKit/Shared/Cocoa/CoreIPCURL.h
    A Source/WebKit/Shared/Cocoa/CoreIPCURL.serialization.in
    M Source/WebKit/Shared/Cocoa/WebIconUtilities.mm
    M Source/WebKit/Shared/cf/CoreIPCNumber.h
    M Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm
    M Source/WebKit/SourcesCocoa.txt
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/IPC/IPCSerialization.mm

  Log Message:
  -----------
  Rework ArgumentCodersCocoa to get us much closer to generated serializers
https://bugs.webkit.org/show_bug.cgi?id=264588
rdar://118236121

Reviewed by Alex Christensen.

This changes introduces ObjC object wrappers.
Encoding an ObjC object directly creates a typed wrapper around it.

For wrappers around a type that we still do directly via ObjC (e.g. NSArray), 
encoding the wrapper
then ends up going down the old "encode ObjC directly" path.

This change has the following benefits:
1 - We now broadly use serialization.in files for all ObjC types.
2 - For catch-all types like SecureCoding, we can now easily break out 
individual types into
    their own individual wrappers with individual serialization.
3 - So it follows, over time, the complicated logic in ArgumentCodersCocoa.mm 
can be whittled away.
4 - Having wrappers enables us to directly serialize collection types (like 
NSArray) without
    relying on the existing ObjC code path

* Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h:
* Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm:
(WebCore::SerializedPlatformDataCueMac::allowedClassesForNativeValues):
* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
* Source/WebKit/Platform/IPC/Decoder.h:
(IPC::Decoder::decodeWithAllowedClasses):
(IPC::Decoder::allowedClasses const):
* Source/WebKit/Scripts/generate-serializers.py:
(decode_type):
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h:
(IPC::CoreIPCRetainPtr::CoreIPCRetainPtr):
(IPC::isObjectClassAllowed):
(IPC::decodeRequiringAllowedClasses):
(IPC::ArgumentCoder<T::encode):
(IPC::ArgumentCoder<CoreIPCRetainPtr<T>>::encode):
(IPC::ArgumentCoder<CoreIPCRetainPtr<T>>::decode):
(IPC::decodeWithAllowedClasses): Deleted.
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::typeFromObject):
(IPC::encodeObjectDirectly<NSArray>):
(IPC::decodeObjectDirectlyRequiringAllowedClasses<NSArray>):
(IPC::encodeObjectDirectly<NSDictionary>):
(IPC::id>>):
(IPC::decodeObjectDirectlyRequiringAllowedClasses<NSDictionary>):
(IPC::encodeObjectDirectly<WebCore::CocoaFont>):
(IPC::decodeObjectDirectlyRequiringAllowedClasses<WebCore::CocoaFont>):
(IPC::encodeObjectDirectly<NSObject<NSSecureCoding>>):
(IPC::shouldEnableStrictMode):
(IPC::decodeObjectDirectlyRequiringAllowedClasses<NSObject<NSSecureCoding>>):
(IPC::encodeObjectDirectly<CFTypeRef>):
(IPC::decodeObjectDirectlyRequiringAllowedClasses<CFTypeRef>):
(IPC::encodeObjectWithWrapper):
(IPC::decodeObjectFromWrapper):
(IPC::encodeArrayInternal): Deleted.
(IPC::decodeArrayInternal): Deleted.
(IPC::encodeColorInternal): Deleted.
(IPC::decodeColorInternal): Deleted.
(IPC::encodeDataInternal): Deleted.
(IPC::decodeDataInternal): Deleted.
(IPC::encodeDateInternal): Deleted.
(IPC::decodeDateInternal): Deleted.
(IPC::encodeDictionaryInternal): Deleted.
(IPC::decodeDictionaryInternal): Deleted.
(IPC::encodeFontInternal): Deleted.
(IPC::decodeFontInternal): Deleted.
(IPC::encodeNumberInternal): Deleted.
(IPC::decodeNumberInternal): Deleted.
(IPC::encodeSecureCodingInternal): Deleted.
(IPC::decodeSecureCodingInternal): Deleted.
(IPC::encodeStringInternal): Deleted.
(IPC::decodeStringInternal): Deleted.
(IPC::encodeURLInternal): Deleted.
(IPC::decodeURLInternal): Deleted.
(IPC::encodeCFInternal): Deleted.
(IPC::decodeCFInternal): Deleted.
(IPC::encodeObject): Deleted.
(IPC::decodeObject): Deleted.
* Source/WebKit/Shared/Cocoa/CoreIPCArray.h: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCDate.h.
(WebKit::CoreIPCArray::CoreIPCArray):
(WebKit::CoreIPCArray::toID):
* Source/WebKit/Shared/Cocoa/CoreIPCArray.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCCFType.h: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCDate.h.
(WebKit::CoreIPCCFType::CoreIPCCFType):
(WebKit::CoreIPCCFType::toID):
* Source/WebKit/Shared/Cocoa/CoreIPCCFType.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCColor.h: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCDate.h.
(WebKit::CoreIPCColor::CoreIPCColor):
(WebKit::CoreIPCColor::toID):
* Source/WebKit/Shared/Cocoa/CoreIPCColor.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCData.h:
(WebKit::CoreIPCData::CoreIPCData):
(WebKit::CoreIPCData::toID const):
* Source/WebKit/Shared/Cocoa/CoreIPCDate.h:
(WebKit::CoreIPCDate::CoreIPCDate):
(WebKit::CoreIPCDate::toID const):
* Source/WebKit/Shared/Cocoa/CoreIPCDictionary.h: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCDate.h.
(WebKit::CoreIPCDictionary::CoreIPCDictionary):
(WebKit::CoreIPCDictionary::toID):
* Source/WebKit/Shared/Cocoa/CoreIPCDictionary.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCFont.h: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCDate.h.
(WebKit::CoreIPCFont::CoreIPCFont):
(WebKit::CoreIPCFont::toID):
* Source/WebKit/Shared/Cocoa/CoreIPCFont.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.h: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCData.h.
(WebKit::CoreIPCNSCFObject::CoreIPCNSCFObject):
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.mm: Added.
(WebKit::valueFromID):
(WebKit::CoreIPCNSCFObject::CoreIPCNSCFObject):
(WebKit::CoreIPCNSCFObject::toID):
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.h: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCDate.h.
(WebKit::CoreIPCSecureCoding::toID):
* Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.mm: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCDate.h.
(WebKit::CoreIPCSecureCoding::CoreIPCSecureCoding):
* Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCString.h: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCDate.h.
(WebKit::CoreIPCString::CoreIPCString):
(WebKit::CoreIPCString::toID):
* Source/WebKit/Shared/Cocoa/CoreIPCString.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCURL.h: Copied from 
Source/WebKit/Shared/Cocoa/CoreIPCDate.h.
(WebKit::CoreIPCURL::CoreIPCURL):
(WebKit::CoreIPCURL::toID):
* Source/WebKit/Shared/Cocoa/CoreIPCURL.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/WebIconUtilities.mm:
* Source/WebKit/Shared/cf/CoreIPCNumber.h:
(WebKit::CoreIPCNumber::CoreIPCNumber):
(WebKit::CoreIPCNumber::toID):
* Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decodePlatformData):
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/IPC/IPCSerialization.mm:
(TEST):

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to