From dca14b10d8160a8fc0f36ed7957f998380aef9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDan=20Dober=C5=A1ek?= Date: Tue, 12 Mar 2024 07:43:10 -0700 Subject: [PATCH] Remove EnumTraits specialization for IPC::MessageFlags https://bugs.webkit.org/show_bug.cgi?id=267534 Reviewed by Chris Dumez. Remove the IPC::MessageFlags EnumTraits specialization, replacing it with the appropriate serialization specification in a separate input file. * Source/WebKit/CMakeLists.txt: * Source/WebKit/DerivedSources-input.xcfilelist: * Source/WebKit/DerivedSources.make: * Source/WebKit/Platform/IPC/MessageFlags.h: * Source/WebKit/Platform/IPC/MessageFlags.serialization.in: Added. * Source/WebKit/WebKit.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/275977@main --- Source/WebKit/CMakeLists.txt | 1 + Source/WebKit/DerivedSources-input.xcfilelist | 1 + Source/WebKit/DerivedSources.make | 1 + Source/WebKit/Platform/IPC/MessageFlags.h | 17 ---------- .../IPC/MessageFlags.serialization.in | 33 +++++++++++++++++++ .../WebKit/WebKit.xcodeproj/project.pbxproj | 2 ++ 6 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 Source/WebKit/Platform/IPC/MessageFlags.serialization.in diff --git a/Source/WebKit/CMakeLists.txt b/Source/WebKit/CMakeLists.txt index ea1cd6149d25..0ec81c474908 100644 --- a/Source/WebKit/CMakeLists.txt +++ b/Source/WebKit/CMakeLists.txt @@ -390,6 +390,7 @@ set(WebKit_SERIALIZATION_IN_FILES Platform/IPC/FormDataReference.serialization.in Platform/IPC/IPCEvent.serialization.in Platform/IPC/IPCSemaphore.serialization.in + Platform/IPC/MessageFlags.serialization.in Platform/IPC/ObjectIdentifierReference.serialization.in Platform/IPC/SharedBufferReference.serialization.in Platform/IPC/SharedFileHandle.serialization.in diff --git a/Source/WebKit/DerivedSources-input.xcfilelist b/Source/WebKit/DerivedSources-input.xcfilelist index 8b07c395008d..8a42936562d3 100644 --- a/Source/WebKit/DerivedSources-input.xcfilelist +++ b/Source/WebKit/DerivedSources-input.xcfilelist @@ -157,6 +157,7 @@ $(PROJECT_DIR)/Platform/IPC/ConnectionHandle.serialization.in $(PROJECT_DIR)/Platform/IPC/FormDataReference.serialization.in $(PROJECT_DIR)/Platform/IPC/IPCEvent.serialization.in $(PROJECT_DIR)/Platform/IPC/IPCSemaphore.serialization.in +$(PROJECT_DIR)/Platform/IPC/MessageFlags.serialization.in $(PROJECT_DIR)/Platform/IPC/ObjectIdentifierReference.serialization.in $(PROJECT_DIR)/Platform/IPC/SharedBufferReference.serialization.in $(PROJECT_DIR)/Platform/IPC/SharedFileHandle.serialization.in diff --git a/Source/WebKit/DerivedSources.make b/Source/WebKit/DerivedSources.make index 882f055b55dd..f0566fd7e704 100644 --- a/Source/WebKit/DerivedSources.make +++ b/Source/WebKit/DerivedSources.make @@ -515,6 +515,7 @@ SERIALIZATION_DESCRIPTION_FILES = \ Platform/IPC/FormDataReference.serialization.in \ Platform/IPC/IPCEvent.serialization.in \ Platform/IPC/IPCSemaphore.serialization.in \ + Platform/IPC/MessageFlags.serialization.in \ Platform/IPC/ObjectIdentifierReference.serialization.in \ Platform/IPC/SharedBufferReference.serialization.in \ Platform/IPC/SharedFileHandle.serialization.in \ diff --git a/Source/WebKit/Platform/IPC/MessageFlags.h b/Source/WebKit/Platform/IPC/MessageFlags.h index da5125c10592..c1b8a2099310 100644 --- a/Source/WebKit/Platform/IPC/MessageFlags.h +++ b/Source/WebKit/Platform/IPC/MessageFlags.h @@ -44,20 +44,3 @@ enum class ShouldDispatchWhenWaitingForSyncReply : uint8_t { }; } // namespace IPC - -namespace WTF { - -template<> struct EnumTraits { - using values = EnumValues< - IPC::MessageFlags - , IPC::MessageFlags::DispatchMessageWhenWaitingForSyncReply - , IPC::MessageFlags::DispatchMessageWhenWaitingForUnboundedSyncReply - , IPC::MessageFlags::UseFullySynchronousModeForTesting - , IPC::MessageFlags::MaintainOrderingWithAsyncMessages -#if ENABLE(IPC_TESTING_API) - , IPC::MessageFlags::SyncMessageDeserializationFailure -#endif - >; -}; - -} // namespace WTF diff --git a/Source/WebKit/Platform/IPC/MessageFlags.serialization.in b/Source/WebKit/Platform/IPC/MessageFlags.serialization.in new file mode 100644 index 000000000000..cc227f5c58ec --- /dev/null +++ b/Source/WebKit/Platform/IPC/MessageFlags.serialization.in @@ -0,0 +1,33 @@ +# Copyright (C) 2024 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +webkit_platform_header: "MessageFlags.h" + +[OptionSet, WebKitPlatform] enum class IPC::MessageFlags : uint8_t { + DispatchMessageWhenWaitingForSyncReply, + DispatchMessageWhenWaitingForUnboundedSyncReply, + UseFullySynchronousModeForTesting, + MaintainOrderingWithAsyncMessages, +#if ENABLE(IPC_TESTING_API) + SyncMessageDeserializationFailure, +#endif +}; diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj index d45ed7ef6762..c45f5f9070c5 100644 --- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj @@ -4791,6 +4791,7 @@ 2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SmartMagnificationController.mm; path = ios/SmartMagnificationController.mm; sourceTree = ""; }; 2DAF06D818BD23BA0081CEB1 /* SmartMagnificationController.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = SmartMagnificationController.messages.in; path = ios/SmartMagnificationController.messages.in; sourceTree = ""; }; 2DAF4FFA1B636181006013D6 /* ViewGestureController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewGestureController.cpp; sourceTree = ""; }; + 2DAF90242B553FD20081E921 /* MessageFlags.serialization.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = MessageFlags.serialization.in; sourceTree = ""; }; 2DB96052239886B900102791 /* com.apple.WebKit.GPU.sb.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = com.apple.WebKit.GPU.sb.in; sourceTree = ""; }; 2DC18001D90DDD15FC6991A9 /* SharedBufferReference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedBufferReference.cpp; sourceTree = ""; }; 2DC18FB1218A6E9E0025A88D /* RemoteLayerTreeViews.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeViews.h; sourceTree = ""; }; @@ -9539,6 +9540,7 @@ 9B47908E253151CC00EC11AB /* JSIPCBinding.h */, 9B47908C25314D8300EC11AB /* MessageArgumentDescriptions.h */, 1AC4C82816B876A90069DCCD /* MessageFlags.h */, + 2DAF90242B553FD20081E921 /* MessageFlags.serialization.in */, 7BDD9DDA28D205C6004CDF48 /* MessageObserver.h */, 7B483F1C25CDDA9B00120486 /* MessageReceiveQueue.h */, 7B483F1D25CDDA9B00120486 /* MessageReceiveQueueMap.cpp */,