Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify non-serialized members of serialized types are not accidentall…
…y forgotten https://bugs.webkit.org/show_bug.cgi?id=255551 rdar://108161764 Reviewed by Chris Dumez. I introduce the NotSerialized attribute for members that are ... not serialized. Until we have https://wg21.link/P1240 in the language, we can't iterate the members at compile time and make sure we got them all. We already use MembersInCorrectOrder to make sure we got them in the correct order, but we didn't have a check that we got them all until now. This makes a struct that has the same members in the same order and static_asserts that it has the same size as the actual struct. To reduce memory use and make this new sizeof trick work, I made ReportBody::type() a virtual function call instead of using another byte to store the type. * Source/WebCore/Modules/reporting/DeprecationReportBody.cpp: (WebCore::DeprecationReportBody::DeprecationReportBody): * Source/WebCore/Modules/reporting/DeprecationReportBody.h: * Source/WebCore/Modules/reporting/ReportBody.cpp: (WebCore::ReportBody::ReportBody): Deleted. (WebCore::ReportBody::reportBodyType const): Deleted. * Source/WebCore/Modules/reporting/ReportBody.h: * Source/WebCore/Modules/reporting/TestReportBody.cpp: (WebCore::TestReportBody::TestReportBody): * Source/WebCore/Modules/reporting/TestReportBody.h: * Source/WebCore/loader/COEPInheritenceViolationReportBody.cpp: (WebCore::COEPInheritenceViolationReportBody::COEPInheritenceViolationReportBody): * Source/WebCore/loader/COEPInheritenceViolationReportBody.h: * Source/WebCore/loader/CORPViolationReportBody.cpp: (WebCore::CORPViolationReportBody::CORPViolationReportBody): * Source/WebCore/loader/CORPViolationReportBody.h: * Source/WebCore/page/csp/CSPViolationReportBody.cpp: (WebCore::CSPViolationReportBody::CSPViolationReportBody): * Source/WebCore/page/csp/CSPViolationReportBody.h: * Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.serialization.in: * Source/WebKit/Scripts/generate-serializers.py: (SerializedType.__init__): (SerializedType.has_bit_field): (SerializedType): (SerializedType.serialized_members): (check_type_members): (check_type_members.is): (check_type_members.is.is): (encode_type): (decode_type): (construct_type): (generate_impl): (generate_serialized_type_info): * Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.cpp: (IPC::ArgumentCoder<Namespace::Subnamespace::StructName>::encode): (IPC::ArgumentCoder<Namespace::EmptyConstructorNullable>::encode): (IPC::ArgumentCoder<WithoutNamespace>::encode): (IPC::ArgumentCoder<WithoutNamespaceWithAttributes>::encode): (IPC::ArgumentCoder<WTF::CreateUsingClass>::encode): (IPC::ArgumentCoder<NullableSoftLinkedMember>::encode): (IPC::ArgumentCoder<Namespace::ConditionalCommonClass>::encode): (IPC::ArgumentCoder<Namesapce::CommonClass>::encode): (IPC::ArgumentCoder<Namesapce::AnotherCommonClass>::encode): (IPC::ArgumentCoder<Namesapce::AnotherCommonClass>::decode): * Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.h: * Source/WebKit/Scripts/webkit/tests/SerializedTypeInfo.cpp: * Source/WebKit/Scripts/webkit/tests/TestSerializedType.serialization.in: * Source/WebKit/Shared/SessionState.serialization.in: * Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in: Canonical link: https://commits.webkit.org/263133@main
- Loading branch information
1 parent
aa24abe
commit be8e1cb
Showing
20 changed files
with
225 additions
and
72 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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.