-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use generated structures instead of NSDictionary to serialize members…
… of ObjC classes https://bugs.webkit.org/show_bug.cgi?id=269438 rdar://122994790 Reviewed by Brady Eidson. This makes it so that we don't need to expand what an NSDictionary can contain in order to increase the number of ObjC classes that are serialized using generated serialization. This also makes it so we don't need "webkit_secure_coding" in SerializedTypeInfo.cpp, so all the metadata has the same form. We can also simplify CoreIPCDictionary to just a vector of key/value pairs. If a type is not declared as optional with a question mark in the serialization.in file, then we debug assert on the encoding side if it is missing and we fail to decode on the decoding side if it is missing. * Source/WebKit/Scripts/generate-serializers.py: (SerializedType.__init__): (SerializedType.name_declaration_for_serialized_type_info): (SerializedType.members_for_serialized_type_info): (MemberVariable.value_without_question_mark): (MemberVariable): (MemberVariable.ns_type_enum_value): (MemberVariable.array_contents): (MemberVariable.dictionary_contents): (MemberVariable.has_container_contents): (MemberVariable.ns_type): (MemberVariable.dictionary_type): (MemberVariable.value_is_optional): (check_type_members): (check_type_members.is): (encode_type): (decode_type): (construct_type): (generate_impl): (generate_one_serialized_type_info): (generate_serialized_type_info): (parse_serialized_types): (generate_webkit_secure_coding_impl): (generate_webkit_secure_coding_impl.is): (generate_webkit_secure_coding_header): (generate_one_dictionary_member_validation): Deleted. * Source/WebKit/Scripts/webkit/tests/GeneratedWebKitSecureCoding.cpp: (WebKit::dictionaryFromVector): (WebKit::dictionaryFromOptionalVector): (WebKit::vectorFromDictionary): (WebKit::optionalVectorFromDictionary): (WebKit::arrayFromVector): (WebKit::arrayFromOptionalVector): (WebKit::vectorFromArray): (WebKit::optionalVectorFromArray): (WebKit::CoreIPCAVOutputContext::CoreIPCAVOutputContext): (WebKit::CoreIPCAVOutputContext::toID const): (WebKit::CoreIPCNSSomeFoundationType::CoreIPCNSSomeFoundationType): (WebKit::CoreIPCNSSomeFoundationType::toID const): (WebKit::CoreIPCDDScannerResult::CoreIPCDDScannerResult): (WebKit::CoreIPCDDScannerResult::toID const): (WebKit::CoreIPCAVOutputContext::isValidDictionary): Deleted. (WebKit::CoreIPCNSSomeFoundationType::isValidDictionary): Deleted. (WebKit::CoreIPCDDScannerResult::isValidDictionary): Deleted. * Source/WebKit/Scripts/webkit/tests/GeneratedWebKitSecureCoding.h: (WebKit::CoreIPCAVOutputContext::CoreIPCAVOutputContext): (WebKit::CoreIPCNSSomeFoundationType::CoreIPCNSSomeFoundationType): (WebKit::CoreIPCDDScannerResult::CoreIPCDDScannerResult): * Source/WebKit/Scripts/webkit/tests/SerializedTypeInfo.cpp: (WebKit::allSerializedTypes): * Source/WebKit/Scripts/webkit/tests/WebKitPlatformGeneratedSerializers.cpp: (IPC::ArgumentCoder<WebKit::CoreIPCAVOutputContext>::encode): (IPC::ArgumentCoder<WebKit::CoreIPCAVOutputContext>::decode): (IPC::ArgumentCoder<WebKit::CoreIPCNSSomeFoundationType>::encode): (IPC::ArgumentCoder<WebKit::CoreIPCNSSomeFoundationType>::decode): (IPC::ArgumentCoder<WebKit::CoreIPCDDScannerResult>::encode): (IPC::ArgumentCoder<WebKit::CoreIPCDDScannerResult>::decode): * Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h: * Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm: (IPC::getClass<PKSecureElementPass>): * Source/WebKit/Shared/Cocoa/CoreIPCDictionary.h: * Source/WebKit/Shared/Cocoa/CoreIPCDictionary.mm: (WebKit::CoreIPCDictionary::CoreIPCDictionary): (WebKit::CoreIPCDictionary::toID const): (WebKit::CoreIPCDictionary::keyHasValueOfType const): Deleted. (WebKit::CoreIPCDictionary::keyIsMissingOrHasValueOfType const): Deleted. (WebKit::CoreIPCDictionary::collectionValuesAreOfType const): Deleted. (WebKit::CoreIPCDictionary::createNSDictionaryIfNeeded const): Deleted. * Source/WebKit/Shared/Cocoa/CoreIPCDictionary.serialization.in: * Source/WebKit/Shared/Cocoa/CoreIPCPassKit.serialization.in: Canonical link: https://commits.webkit.org/274799@main
- Loading branch information
1 parent
4e839b3
commit dc84002
Showing
15 changed files
with
708 additions
and
366 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.