Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[IPC] Add WTF::EnumTraits<> for every enum type used in IPC
<https://webkit.org/b/213093> Reviewed by Darin Adler. Summary: - Change underlying type of enum class to `bool` when there are only two values. In some cases, reorder the two values so the mapping to 0 and 1 makes more sense. Converting every enum to an enum class is not a goal of this patch, so some two-value enums stil have WTF::EnumTraits<> defined as noted below. - Add WTF::EnumTraits<> for the remaining enum types that are used by IPC::Encoder::encodeEnum() and IPC::Decoder::decodeEnum() so that WTF::isValidEnum<>() checks may be added next. - Add #include <WebCore/LibWebRTCEnumTraits.h> as needed. Source/WebCore: * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: - Add LibWebRTCEnumTraits.h to project. Keep these definitions separate from the libwebrtc project cut down on changes to re-merge after updating. * platform/mediastream/libwebrtc/LibWebRTCEnumTraits.h: Add. * Modules/applepay/ApplePaySessionPaymentRequest.h: * Modules/indexeddb/IDBTransactionMode.h: * Modules/indexeddb/IndexedDB.h: (WTF::EnumTraits<WebCore::IndexedDB::IndexRecordType>): - Remove after changing enum class to bool. * Modules/indexeddb/shared/IDBGetRecordData.h: * Modules/indexeddb/shared/IDBResultData.h: * WebCore.xcodeproj/project.pbxproj: * dom/ExceptionCode.h: * editing/CompositionUnderline.h: * html/Autofill.h: * html/DataListSuggestionInformation.h: * html/EnterKeyHint.h: * html/LinkIconType.h: * loader/FrameLoaderTypes.h: - Alphabetize WTF::EnumTraits<> definitions. * loader/ResourceLoaderOptions.h: * page/SecurityOrigin.h: * page/UserStyleSheetTypes.h: (WTF::EnumTraits<WebCore::UserStyleLevel>): - Define this since UserStyleLevel is not an enum class. * page/scrolling/ScrollingCoordinatorTypes.h: * platform/ContextMenuItem.h: * platform/Cursor.h: * platform/DragData.h: * platform/FileChooser.h: * platform/PopupMenuStyle.h: * platform/ScreenProperties.h: * platform/ScrollTypes.h: * platform/SerializedPlatformDataCueValue.h: (WebCore::SerializedPlatformDataCueValue::PlatformType): - Convert from enum to enum class. * platform/UserInterfaceLayoutDirection.h: * platform/animation/TimingFunction.h: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsLayer.h: * platform/graphics/GraphicsTypes.h: - Alphabetize WTF::EnumTraits<> definitions. * platform/graphics/Image.h: * platform/graphics/Path.h: * platform/graphics/ca/PlatformCAAnimation.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/filters/FilterOperation.h: * platform/mediastream/MediaConstraints.h: * platform/mediastream/MediaStreamRequest.h: (WTF::EnumTraits<WebCore::MediaStreamRequest::Type>): - Fix EnumTraits definition (missing "::Type"). * platform/mediastream/RealtimeMediaSourceCapabilities.h: * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h: * platform/network/CredentialBase.h: * platform/network/ProtectionSpaceBase.h: * platform/network/ResourceErrorBase.h: * platform/network/soup/SoupNetworkProxySettings.h: * platform/text/TextChecking.h: (WTF::EnumTraits<WebCore::TextCheckingProcessType): - Define this since TextCheckingProcessType is not an enum class. * platform/text/WritingMode.h: * rendering/Pagination.h: * workers/service/ServiceWorkerJobType.h: Source/WebKit: * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUProcess.h: * NetworkProcess/NetworkLoadParameters.h: * Shared/API/APIObject.h: * Shared/ContextMenuContextData.h: * Shared/DrawingAreaInfo.h: * Shared/FocusedElementInformation.h: * Shared/PrintInfo.h: (WTF::EnumTraits<WebKit::PrintInfo::PrintMode>): - Define this since PrintMode is not an enum class. * Shared/RTCPacketOptions.cpp: * Shared/SessionState.h: * Shared/TouchBarMenuItemData.h: * Shared/WebEvent.h: * Shared/WebPopupItem.cpp: (WebKit::WebPopupItem::WebPopupItem): - Fix reference to WebPopupItem::Type enum. * Shared/WebPopupItem.h: (WebKit::WebPopupItem::Type): - Convert from enum to enum class. * Shared/WebsiteData/WebsiteDataType.h: * Shared/glib/InputMethodState.h: * Shared/glib/UserMessage.h: * Shared/mac/ColorSpaceData.mm: * Shared/mac/SecItemRequestData.h: * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::populate): - Fix reference to WebPopupItem::Type enum. * WebProcess/Plugins/Plugin.cpp: * WebProcess/WebCoreSupport/WebPopupMenu.cpp: (WebKit::WebPopupMenu::populateItems): - Fix reference to WebPopupItem::Type enum. * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: Canonical link: https://commits.webkit.org/225887@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
84 changed files
with
1,775 additions
and
144 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.