Skip to content

Commit

Permalink
Remove EnumTraits specialization for IPC::MessageFlags
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zdobersek authored and cdumez committed Mar 12, 2024
1 parent e39892e commit dca14b1
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 17 deletions.
1 change: 1 addition & 0 deletions Source/WebKit/CMakeLists.txt
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/DerivedSources-input.xcfilelist
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/DerivedSources.make
Expand Up @@ -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 \
Expand Down
17 changes: 0 additions & 17 deletions Source/WebKit/Platform/IPC/MessageFlags.h
Expand Up @@ -44,20 +44,3 @@ enum class ShouldDispatchWhenWaitingForSyncReply : uint8_t {
};

} // namespace IPC

namespace WTF {

template<> struct EnumTraits<IPC::MessageFlags> {
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
33 changes: 33 additions & 0 deletions 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
};
2 changes: 2 additions & 0 deletions Source/WebKit/WebKit.xcodeproj/project.pbxproj
Expand Up @@ -4791,6 +4791,7 @@
2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SmartMagnificationController.mm; path = ios/SmartMagnificationController.mm; sourceTree = "<group>"; };
2DAF06D818BD23BA0081CEB1 /* SmartMagnificationController.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = SmartMagnificationController.messages.in; path = ios/SmartMagnificationController.messages.in; sourceTree = "<group>"; };
2DAF4FFA1B636181006013D6 /* ViewGestureController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewGestureController.cpp; sourceTree = "<group>"; };
2DAF90242B553FD20081E921 /* MessageFlags.serialization.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = MessageFlags.serialization.in; sourceTree = "<group>"; };
2DB96052239886B900102791 /* com.apple.WebKit.GPU.sb.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = com.apple.WebKit.GPU.sb.in; sourceTree = "<group>"; };
2DC18001D90DDD15FC6991A9 /* SharedBufferReference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedBufferReference.cpp; sourceTree = "<group>"; };
2DC18FB1218A6E9E0025A88D /* RemoteLayerTreeViews.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeViews.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -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 */,
Expand Down

0 comments on commit dca14b1

Please sign in to comment.