[IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder:...
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Jun 2020 02:55:27 +0000 (02:55 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Jun 2020 02:55:27 +0000 (02:55 +0000)
<https://webkit.org/b/211988>
<rdar://problem/63137695>

Reviewed by Darin Adler.

Replace decodeEnum() with decode() and encodeEnum() with
operator<<().

Source/ThirdParty/libwebrtc:

* Source/webrtc/sdk/WebKit/WebKitEncoder.h:
(webrtc::WebKitEncodedFrameInfo::decode):
(webrtc::WebKitEncodedFrameInfo::encode const):

Source/WebCore:

* Modules/applicationmanifest/ApplicationManifest.h:
(WebCore::ApplicationManifest::decode):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::encode const):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/shared/IDBCursorInfo.h:
(WebCore::IDBCursorInfo::encode const):
(WebCore::IDBCursorInfo::decode):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::encode const):
(WebCore::IDBError::decode):
* Modules/indexeddb/shared/IDBGetAllRecordsData.h:
(WebCore::IDBGetAllRecordsData::encode const):
(WebCore::IDBGetAllRecordsData::decode):
* Modules/indexeddb/shared/IDBGetRecordData.h:
(WebCore::IDBGetRecordData::encode const):
(WebCore::IDBGetRecordData::decode):
* Modules/indexeddb/shared/IDBIterateCursorData.h:
(WebCore::IDBIterateCursorData::encode const):
(WebCore::IDBIterateCursorData::decode):
* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::encode const):
(WebCore::IDBRequestData::decode):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::encode const):
(WebCore::IDBResultData::decode):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::encode const):
(WebCore::IDBTransactionInfo::decode):
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
(WebCore::PublicKeyCredentialDescriptor::decode):
* dom/ExceptionData.h:
(WebCore::ExceptionData::encode const):
(WebCore::ExceptionData::decode):
* html/DataListSuggestionInformation.h:
(WebCore::DataListSuggestionInformation::encode const):
(WebCore::DataListSuggestionInformation::decode):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::encode const):
(WebCore::SecurityOrigin::decode):
* platform/ContextMenuItem.h:
(WTF::EnumTraits<WebCore::ContextMenuAction>):
- Add missing ContextMenuItemTagPasteAsPlainText that was added
  in r261800.
* platform/LinkIcon.h:
(WebCore::LinkIcon::encode const):
(WebCore::LinkIcon::decode):
* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
* platform/ScreenProperties.h:
(WebCore::ScreenData::encode const):
(WebCore::ScreenData::decode):
* platform/graphics/InbandGenericCue.h:
(WebCore::GenericCueData::encode const):
* platform/graphics/Path.h:
(WebCore::Path::encode const):
(WebCore::Path::decode):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::SetState::encode const):
(WebCore::DisplayList::SetState::decode):
(WebCore::DisplayList::DrawTiledScaledImage::encode const):
(WebCore::DisplayList::DrawTiledScaledImage::decode):
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::encode const):
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::encode const):
(WebCore::MediaConstraint::decode):
* platform/mediastream/MediaStreamRequest.h:
(WebCore::MediaStreamRequest::encode const):
(WebCore::MediaStreamRequest::decode):
* platform/mediastream/RealtimeMediaSourceCapabilities.h:
(WebCore::CapabilityValueOrRange::encode const):
(WebCore::CapabilityValueOrRange::decode):
(WebCore::RealtimeMediaSourceCapabilities::encode const):
(WebCore::RealtimeMediaSourceCapabilities::decode):
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::encode const):
(WebCore::RealtimeMediaSourceSettings::decode):
* platform/mock/MockMediaDevice.h:
(WebCore::MockDisplayProperties::encode const):
* platform/network/HTTPHeaderMap.h:
(WebCore::HTTPHeaderMap::CommonHeader::encode const):
(WebCore::HTTPHeaderMap::CommonHeader::decode):
* testing/MockWebAuthenticationConfiguration.h:
(WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode):
(WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::decode):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::encode const):
(WebCore::ServiceWorkerJobData::decode):

Source/WebKit:

* GPUProcess/media/TextTrackPrivateRemoteConfiguration.h:
(WebKit::TextTrackPrivateRemoteConfiguration::encode const):
* GPUProcess/media/TrackPrivateRemoteConfiguration.h:
(WebKit::TrackPrivateRemoteConfiguration::encode const):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* Platform/IPC/Decoder.h:
(IPC::Decoder::decode):
(IPC::Decoder::operator>>):
- Make use of std::underlying_type_t<>.
(IPC::Decoder::decodeEnum): Delete.
- Replace with calls to decode().
* Platform/IPC/Encoder.h:
(IPC::Encoder::operator<<):
(IPC::Encoder::encode):
- Make use of WTF::enumToUnderlyingType<>.
(IPC::Encoder::encodeEnum): Delete.
- Replace with calls to operator<<().
* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::decodeObject):
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::encode const):
(WebKit::ContextMenuContextData::decode):
* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/PlatformPopupMenuData.cpp:
(WebKit::PlatformPopupMenuData::encode const):
(WebKit::PlatformPopupMenuData::decode):
* Shared/Plugins/PluginProcessCreationParameters.cpp:
(WebKit::PluginProcessCreationParameters::encode const):
(WebKit::PluginProcessCreationParameters::decode):
* Shared/PrintInfo.cpp:
(WebKit::PrintInfo::encode const):
(WebKit::PrintInfo::decode):
* Shared/RTCPacketOptions.cpp:
(WebKit::RTCPacketOptions::encode const):
(WebKit::RTCPacketOptions::decode):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateNode>::encode):
(ArgumentCoder<RequestedScrollData>::encode):
(ArgumentCoder<RequestedScrollData>::decode):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
* Shared/SessionState.cpp:
(WebKit::HTTPBody::Element::encode const):
(WebKit::HTTPBody::Element::decode):
(WebKit::PageState::encode const):
(WebKit::PageState::decode):
* Shared/TouchBarMenuItemData.cpp:
(WebKit::TouchBarMenuItemData::encode const):
(WebKit::TouchBarMenuItemData::decode):
* Shared/UserData.cpp:
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* Shared/WebContextMenuItemData.cpp:
(WebKit::WebContextMenuItemData::encode const):
(WebKit::WebContextMenuItemData::decode):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<LinearTimingFunction>::encode):
(IPC::ArgumentCoder<CubicBezierTimingFunction>::encode):
(IPC::ArgumentCoder<CubicBezierTimingFunction>::decode):
(IPC::ArgumentCoder<StepsTimingFunction>::encode):
(IPC::ArgumentCoder<SpringTimingFunction>::encode):
(IPC::ArgumentCoder<PluginInfo>::encode):
(IPC::ArgumentCoder<PluginInfo>::decode):
(IPC::ArgumentCoder<ProtectionSpace>::encode):
(IPC::ArgumentCoder<ProtectionSpace>::decode):
(IPC::ArgumentCoder<Credential>::encode):
(IPC::ArgumentCoder<Credential>::decode):
(IPC::ArgumentCoder<Cursor>::encode):
(IPC::ArgumentCoder<Cursor>::decode):
(IPC::ArgumentCoder<ResourceError>::encode):
(IPC::ArgumentCoder<ResourceError>::decode):
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
(IPC::ArgumentCoder<CompositionUnderline>::encode):
(IPC::ArgumentCoder<CompositionUnderline>::decode):
(IPC::ArgumentCoder<FileChooserSettings>::encode):
(IPC::ArgumentCoder<FileChooserSettings>::decode):
(IPC::ArgumentCoder<TextCheckingRequestData>::encode):
(IPC::ArgumentCoder<TextCheckingRequestData>::decode):
(IPC::ArgumentCoder<TextCheckingResult>::encode):
(IPC::ArgumentCoder<TextCheckingResult>::decode):
(IPC::ArgumentCoder<UserStyleSheet>::encode):
(IPC::ArgumentCoder<UserStyleSheet>::decode):
(IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
(IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
(IPC::ArgumentCoder<FilterOperation>::encode):
(IPC::decodeFilterOperation):
(IPC::ArgumentCoder<FontAttributes>::encode):
(IPC::ArgumentCoder<FontAttributes>::decode):
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode):
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode):
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPopupItem.cpp:
(WebKit::WebPopupItem::encode const):
(WebKit::WebPopupItem::decode):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::Entry::encode const):
(WebKit::WebsiteData::Entry::decode):
* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):
(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
* Shared/glib/InputMethodState.cpp:
(WebKit::InputMethodState::encode const):
(WebKit::InputMethodState::decode):
* Shared/glib/UserMessage.cpp:
(WebKit::UserMessage::encode const):
(WebKit::UserMessage::decode):
* Shared/mac/ColorSpaceData.mm:
(WebKit::ColorSpaceData::encode const):
(WebKit::ColorSpaceData::decode):
* Shared/mac/SecItemRequestData.cpp:
(WebKit::SecItemRequestData::encode const):
(WebKit::SecItemRequestData::decode):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData):
(IPC::ArgumentCoder<WebCore::CertificateInfo>::encode):
(IPC::ArgumentCoder<WebCore::CertificateInfo>::decode):
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<SoupNetworkProxySettings>::encode):
(IPC::ArgumentCoder<SoupNetworkProxySettings>::decode):
* WebProcess/GPU/media/RemoteMediaPlayerState.h:
(WebKit::RemoteMediaPlayerState::encode const):
(WebKit::RemoteMediaPlayerState::decode):
* WebProcess/Network/NetworkProcessConnectionInfo.h:
(WebKit::NetworkProcessConnectionInfo::decode):
* WebProcess/Plugins/Plugin.cpp:
(WebKit::Plugin::Parameters::encode const):
(WebKit::Plugin::Parameters::decode):
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::PlatformCAAnimationRemote::KeyframeValue::encode const):
(WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
(WebKit::PlatformCAAnimationRemote::Properties::encode const):
(WebKit::PlatformCAAnimationRemote::Properties::decode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262994 268f45cc-cd09-0410-ab3c-d52691b4dbfc

74 files changed:
Source/ThirdParty/libwebrtc/ChangeLog
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitEncoder.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h
Source/WebCore/Modules/indexeddb/IDBKeyData.h
Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.h
Source/WebCore/Modules/indexeddb/shared/IDBError.h
Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h
Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.h
Source/WebCore/Modules/indexeddb/shared/IDBIterateCursorData.h
Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h
Source/WebCore/Modules/indexeddb/shared/IDBResultData.h
Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h
Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h
Source/WebCore/Modules/webauthn/PublicKeyCredentialDescriptor.h
Source/WebCore/dom/ExceptionData.h
Source/WebCore/html/DataListSuggestionInformation.h
Source/WebCore/page/SecurityOrigin.h
Source/WebCore/platform/ContextMenuItem.h
Source/WebCore/platform/LinkIcon.h
Source/WebCore/platform/PasteboardItemInfo.h
Source/WebCore/platform/ScreenProperties.h
Source/WebCore/platform/graphics/InbandGenericCue.h
Source/WebCore/platform/graphics/Path.h
Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
Source/WebCore/platform/mediastream/CaptureDevice.h
Source/WebCore/platform/mediastream/MediaConstraints.h
Source/WebCore/platform/mediastream/MediaStreamRequest.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceCapabilities.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceSettings.h
Source/WebCore/platform/mock/MockMediaDevice.h
Source/WebCore/platform/network/HTTPHeaderMap.h
Source/WebCore/testing/MockWebAuthenticationConfiguration.h
Source/WebCore/workers/service/ServiceWorkerContextData.h
Source/WebCore/workers/service/ServiceWorkerJobData.h
Source/WebKit/ChangeLog
Source/WebKit/GPUProcess/media/TextTrackPrivateRemoteConfiguration.h
Source/WebKit/GPUProcess/media/TrackPrivateRemoteConfiguration.h
Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp
Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.cpp
Source/WebKit/Platform/IPC/Decoder.h
Source/WebKit/Platform/IPC/Encoder.h
Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm
Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
Source/WebKit/Shared/ContextMenuContextData.cpp
Source/WebKit/Shared/FocusedElementInformation.cpp
Source/WebKit/Shared/LoadParameters.cpp
Source/WebKit/Shared/NavigationActionData.cpp
Source/WebKit/Shared/PlatformPopupMenuData.cpp
Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.cpp
Source/WebKit/Shared/PrintInfo.cpp
Source/WebKit/Shared/RTCPacketOptions.cpp
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp
Source/WebKit/Shared/SessionState.cpp
Source/WebKit/Shared/TouchBarMenuItemData.cpp
Source/WebKit/Shared/UserData.cpp
Source/WebKit/Shared/WebContextMenuItemData.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/WebPageCreationParameters.cpp
Source/WebKit/Shared/WebPopupItem.cpp
Source/WebKit/Shared/WebProcessCreationParameters.cpp
Source/WebKit/Shared/WebsiteData/WebsiteData.cpp
Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp
Source/WebKit/Shared/glib/InputMethodState.cpp
Source/WebKit/Shared/glib/UserMessage.cpp
Source/WebKit/Shared/mac/ColorSpaceData.mm
Source/WebKit/Shared/mac/SecItemRequestData.cpp
Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm
Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp
Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerState.h
Source/WebKit/WebProcess/Network/NetworkProcessConnectionInfo.h
Source/WebKit/WebProcess/Plugins/Plugin.cpp
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm

index a375d9c..62094af 100644 (file)
@@ -1,3 +1,18 @@
+2020-06-12  David Kilzer  <ddkilzer@apple.com>
+
+        [IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder::encodeEnum()
+        <https://webkit.org/b/211988>
+        <rdar://problem/63137695>
+
+        Reviewed by Darin Adler.
+
+        Replace decodeEnum() with decode() and encodeEnum() with
+        operator<<().
+
+        * Source/webrtc/sdk/WebKit/WebKitEncoder.h:
+        (webrtc::WebKitEncodedFrameInfo::decode):
+        (webrtc::WebKitEncodedFrameInfo::encode const):
+
 2020-06-08  Youenn Fablet  <youenn@apple.com>
 
         Add missed WebRTC media-source and remote-inbound-rtp stats
index a20a254..db6e6e6 100644 (file)
@@ -138,11 +138,11 @@ bool WebKitEncodedFrameInfo::decode(Decoder& decoder, WebKitEncodedFrameInfo& in
         return false;
     if (!decoder.decode(info.captureTimeMS))
         return false;
-    if (!decoder.decodeEnum(info.frameType))
+    if (!decoder.decode(info.frameType))
         return false;
-    if (!decoder.decodeEnum(info.rotation))
+    if (!decoder.decode(info.rotation))
         return false;
-    if (!decoder.decodeEnum(info.contentType))
+    if (!decoder.decode(info.contentType))
         return false;
     if (!decoder.decode(info.completeFrame))
         return false;
@@ -184,9 +184,9 @@ void WebKitEncodedFrameInfo::encode(Encoder& encoder) const
     encoder << timeStamp;
     encoder << ntpTimeMS;
     encoder << captureTimeMS;
-    encoder.encodeEnum(frameType);
-    encoder.encodeEnum(rotation);
-    encoder.encodeEnum(contentType);
+    encoder << frameType;
+    encoder << rotation;
+    encoder << contentType;
     encoder << completeFrame;
     encoder << qp;
 
index 4d0b719..fc34711 100644 (file)
@@ -1,3 +1,110 @@
+2020-06-12  David Kilzer  <ddkilzer@apple.com>
+
+        [IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder::encodeEnum()
+        <https://webkit.org/b/211988>
+        <rdar://problem/63137695>
+
+        Reviewed by Darin Adler.
+
+        Replace decodeEnum() with decode() and encodeEnum() with
+        operator<<().
+
+        * Modules/applicationmanifest/ApplicationManifest.h:
+        (WebCore::ApplicationManifest::decode):
+        * Modules/indexeddb/IDBKeyData.h:
+        (WebCore::IDBKeyData::encode const):
+        (WebCore::IDBKeyData::decode):
+        * Modules/indexeddb/shared/IDBCursorInfo.h:
+        (WebCore::IDBCursorInfo::encode const):
+        (WebCore::IDBCursorInfo::decode):
+        * Modules/indexeddb/shared/IDBError.h:
+        (WebCore::IDBError::encode const):
+        (WebCore::IDBError::decode):
+        * Modules/indexeddb/shared/IDBGetAllRecordsData.h:
+        (WebCore::IDBGetAllRecordsData::encode const):
+        (WebCore::IDBGetAllRecordsData::decode):
+        * Modules/indexeddb/shared/IDBGetRecordData.h:
+        (WebCore::IDBGetRecordData::encode const):
+        (WebCore::IDBGetRecordData::decode):
+        * Modules/indexeddb/shared/IDBIterateCursorData.h:
+        (WebCore::IDBIterateCursorData::encode const):
+        (WebCore::IDBIterateCursorData::decode):
+        * Modules/indexeddb/shared/IDBRequestData.h:
+        (WebCore::IDBRequestData::encode const):
+        (WebCore::IDBRequestData::decode):
+        * Modules/indexeddb/shared/IDBResultData.h:
+        (WebCore::IDBResultData::encode const):
+        (WebCore::IDBResultData::decode):
+        * Modules/indexeddb/shared/IDBTransactionInfo.h:
+        (WebCore::IDBTransactionInfo::encode const):
+        (WebCore::IDBTransactionInfo::decode):
+        * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
+        (WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
+        (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
+        * Modules/webauthn/PublicKeyCredentialDescriptor.h:
+        (WebCore::PublicKeyCredentialDescriptor::decode):
+        * dom/ExceptionData.h:
+        (WebCore::ExceptionData::encode const):
+        (WebCore::ExceptionData::decode):
+        * html/DataListSuggestionInformation.h:
+        (WebCore::DataListSuggestionInformation::encode const):
+        (WebCore::DataListSuggestionInformation::decode):
+        * page/SecurityOrigin.h:
+        (WebCore::SecurityOrigin::encode const):
+        (WebCore::SecurityOrigin::decode):
+        * platform/ContextMenuItem.h:
+        (WTF::EnumTraits<WebCore::ContextMenuAction>):
+        - Add missing ContextMenuItemTagPasteAsPlainText that was added
+          in r261800.
+        * platform/LinkIcon.h:
+        (WebCore::LinkIcon::encode const):
+        (WebCore::LinkIcon::decode):
+        * platform/PasteboardItemInfo.h:
+        (WebCore::PasteboardItemInfo::encode const):
+        (WebCore::PasteboardItemInfo::decode):
+        * platform/ScreenProperties.h:
+        (WebCore::ScreenData::encode const):
+        (WebCore::ScreenData::decode):
+        * platform/graphics/InbandGenericCue.h:
+        (WebCore::GenericCueData::encode const):
+        * platform/graphics/Path.h:
+        (WebCore::Path::encode const):
+        (WebCore::Path::decode):
+        * platform/graphics/displaylists/DisplayListItems.h:
+        (WebCore::DisplayList::SetState::encode const):
+        (WebCore::DisplayList::SetState::decode):
+        (WebCore::DisplayList::DrawTiledScaledImage::encode const):
+        (WebCore::DisplayList::DrawTiledScaledImage::decode):
+        * platform/mediastream/CaptureDevice.h:
+        (WebCore::CaptureDevice::encode const):
+        * platform/mediastream/MediaConstraints.h:
+        (WebCore::MediaConstraint::encode const):
+        (WebCore::MediaConstraint::decode):
+        * platform/mediastream/MediaStreamRequest.h:
+        (WebCore::MediaStreamRequest::encode const):
+        (WebCore::MediaStreamRequest::decode):
+        * platform/mediastream/RealtimeMediaSourceCapabilities.h:
+        (WebCore::CapabilityValueOrRange::encode const):
+        (WebCore::CapabilityValueOrRange::decode):
+        (WebCore::RealtimeMediaSourceCapabilities::encode const):
+        (WebCore::RealtimeMediaSourceCapabilities::decode):
+        * platform/mediastream/RealtimeMediaSourceSettings.h:
+        (WebCore::RealtimeMediaSourceSettings::encode const):
+        (WebCore::RealtimeMediaSourceSettings::decode):
+        * platform/mock/MockMediaDevice.h:
+        (WebCore::MockDisplayProperties::encode const):
+        * platform/network/HTTPHeaderMap.h:
+        (WebCore::HTTPHeaderMap::CommonHeader::encode const):
+        (WebCore::HTTPHeaderMap::CommonHeader::decode):
+        * testing/MockWebAuthenticationConfiguration.h:
+        (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode):
+        (WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::decode):
+        * workers/service/ServiceWorkerContextData.h:
+        (WebCore::ServiceWorkerContextData::decode):
+        * workers/service/ServiceWorkerJobData.h:
+        (WebCore::ServiceWorkerJobData::encode const):
+        (WebCore::ServiceWorkerJobData::decode):
+
 2020-06-12  Chris Dumez  <cdumez@apple.com>
 
         Stop allowing pages served over HTTPS with "Cache-Control: no-store" into the back/forward cache
index 41417a4..441a2d8 100644 (file)
@@ -71,7 +71,7 @@ Optional<ApplicationManifest> ApplicationManifest::decode(Decoder& decoder)
         return WTF::nullopt;
     if (!decoder.decode(result.scope))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(result.display))
+    if (!decoder.decode(result.display))
         return WTF::nullopt;
     if (!decoder.decode(result.startURL))
         return WTF::nullopt;
index c2deee8..085dd5a 100644 (file)
@@ -238,7 +238,7 @@ void IDBKeyData::encode(Encoder& encoder) const
     if (m_isNull)
         return;
 
-    encoder.encodeEnum(m_type);
+    encoder << m_type;
 
     switch (m_type) {
     case IndexedDB::KeyType::Invalid:
@@ -271,7 +271,7 @@ Optional<IDBKeyData> IDBKeyData::decode(Decoder& decoder)
     if (keyData.m_isNull)
         return keyData;
 
-    if (!decoder.decodeEnum(keyData.m_type))
+    if (!decoder.decode(keyData.m_type))
         return WTF::nullopt;
 
     switch (keyData.m_type) {
index e68c875..5dfc9dc 100644 (file)
@@ -97,9 +97,9 @@ void IDBCursorInfo::encode(Encoder& encoder) const
 {
     encoder << m_cursorIdentifier << m_transactionIdentifier << m_objectStoreIdentifier << m_sourceIdentifier << m_range;
 
-    encoder.encodeEnum(m_source);
-    encoder.encodeEnum(m_direction);
-    encoder.encodeEnum(m_type);
+    encoder << m_source;
+    encoder << m_direction;
+    encoder << m_type;
 }
 
 template<class Decoder>
@@ -120,13 +120,13 @@ bool IDBCursorInfo::decode(Decoder& decoder, IDBCursorInfo& info)
     if (!decoder.decode(info.m_range))
         return false;
 
-    if (!decoder.decodeEnum(info.m_source))
+    if (!decoder.decode(info.m_source))
         return false;
 
-    if (!decoder.decodeEnum(info.m_direction))
+    if (!decoder.decode(info.m_direction))
         return false;
 
-    if (!decoder.decodeEnum(info.m_type))
+    if (!decoder.decode(info.m_type))
         return false;
 
     return true;
index b808a86..42fe573 100644 (file)
@@ -70,7 +70,7 @@ void IDBError::encode(Encoder& encoder) const
 {
     if (m_code) {
         encoder << true;
-        encoder.encodeEnum(m_code.value());
+        encoder << m_code.value();
     } else
         encoder << false;
     encoder << m_message;
@@ -85,7 +85,7 @@ bool IDBError::decode(Decoder& decoder, IDBError& error)
 
     if (hasCode) {
         ExceptionCode ec;
-        if (!decoder.decodeEnum(ec))
+        if (!decoder.decode(ec))
             return false;
         error.m_code = ec;
     } else
index c13d425..e32f0cc 100644 (file)
@@ -58,7 +58,7 @@ template<class Encoder>
 void IDBGetAllRecordsData::encode(Encoder& encoder) const
 {
     encoder << keyRangeData;
-    encoder.encodeEnum(getAllType);
+    encoder << getAllType;
     encoder << count << objectStoreIdentifier << indexIdentifier;
 }
 
@@ -68,7 +68,7 @@ bool IDBGetAllRecordsData::decode(Decoder& decoder, IDBGetAllRecordsData& getAll
     if (!decoder.decode(getAllRecordsData.keyRangeData))
         return false;
 
-    if (!decoder.decodeEnum(getAllRecordsData.getAllType))
+    if (!decoder.decode(getAllRecordsData.getAllType))
         return false;
 
     if (!decoder.decode(getAllRecordsData.count))
index 60ecbb5..5429b87 100644 (file)
@@ -55,7 +55,7 @@ template<class Encoder>
 void IDBGetRecordData::encode(Encoder& encoder) const
 {
     encoder << keyRangeData;
-    encoder.encodeEnum(type);
+    encoder << type;
 }
 
 template<class Decoder>
@@ -64,7 +64,7 @@ bool IDBGetRecordData::decode(Decoder& decoder, IDBGetRecordData& getRecordData)
     if (!decoder.decode(getRecordData.keyRangeData))
         return false;
 
-    if (!decoder.decodeEnum(getRecordData.type))
+    if (!decoder.decode(getRecordData.type))
         return false;
 
     return true;
index f6018b5..0a93b14 100644 (file)
@@ -51,7 +51,7 @@ template<class Encoder>
 void IDBIterateCursorData::encode(Encoder& encoder) const
 {
     encoder << keyData << primaryKeyData << static_cast<uint64_t>(count);
-    encoder.encodeEnum(option);
+    encoder << option;
 }
 
 template<class Decoder>
@@ -77,7 +77,7 @@ bool IDBIterateCursorData::decode(Decoder& decoder, IDBIterateCursorData& iterat
         return false;
     iteratorCursorData.count = static_cast<unsigned>(count);
 
-    if (!decoder.decodeEnum(iteratorCursorData.option))
+    if (!decoder.decode(iteratorCursorData.option))
         return false;
 
     return true;
index ee63d7d..44d398d 100644 (file)
@@ -109,7 +109,7 @@ void IDBRequestData::encode(Encoder& encoder) const
     encoder << m_serverConnectionIdentifier << m_objectStoreIdentifier << m_indexIdentifier << m_databaseIdentifier << m_requestedVersion;
 
     encoder << m_indexRecordType;
-    encoder.encodeEnum(m_requestType);
+    encoder << m_requestType;
 
     encoder << !!m_requestIdentifier;
     if (m_requestIdentifier)
@@ -148,7 +148,7 @@ bool IDBRequestData::decode(Decoder& decoder, IDBRequestData& request)
     if (!decoder.decode(request.m_indexRecordType))
         return false;
 
-    if (!decoder.decodeEnum(request.m_requestType))
+    if (!decoder.decode(request.m_requestType))
         return false;
 
     bool hasObject;
index 14d183d..b77ed5a 100644 (file)
@@ -140,7 +140,7 @@ void IDBResultData::encode(Encoder& encoder) const
 {
     encoder << m_requestIdentifier << m_error << m_databaseConnectionIdentifier << m_resultInteger;
 
-    encoder.encodeEnum(m_type);
+    encoder << m_type;
 
     encoder << !!m_databaseInfo;
     if (m_databaseInfo)
@@ -178,7 +178,7 @@ template<class Decoder> Optional<IDBResultData> IDBResultData::decode(Decoder& d
     if (!decoder.decode(result.m_resultInteger))
         return WTF::nullopt;
 
-    if (!decoder.decodeEnum(result.m_type))
+    if (!decoder.decode(result.m_type))
         return WTF::nullopt;
 
     bool hasObject;
index d9942c3..fa687cc 100644 (file)
@@ -92,7 +92,7 @@ template<class Encoder>
 void IDBTransactionInfo::encode(Encoder& encoder) const
 {
     encoder << m_identifier << m_newVersion << m_objectStores;
-    encoder.encodeEnum(m_mode);
+    encoder << m_mode;
 
     encoder << !!m_originalDatabaseInfo;
     if (m_originalDatabaseInfo)
@@ -111,7 +111,7 @@ bool IDBTransactionInfo::decode(Decoder& decoder, IDBTransactionInfo& info)
     if (!decoder.decode(info.m_objectStores))
         return false;
 
-    if (!decoder.decodeEnum(info.m_mode))
+    if (!decoder.decode(info.m_mode))
         return false;
 
     bool hasObject;
index d8c7bbb..8f93561 100644 (file)
@@ -101,7 +101,7 @@ template<class Decoder>
 Optional<PublicKeyCredentialCreationOptions::Parameters> PublicKeyCredentialCreationOptions::Parameters::decode(Decoder& decoder)
 {
     PublicKeyCredentialCreationOptions::Parameters result;
-    if (!decoder.decodeEnum(result.type))
+    if (!decoder.decode(result.type))
         return WTF::nullopt;
     if (!decoder.decode(result.alg))
         return WTF::nullopt;
@@ -131,7 +131,7 @@ Optional<PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria> Pub
         return WTF::nullopt;
     result.requireResidentKey = *requireResidentKey;
 
-    if (!decoder.decodeEnum(result.userVerification))
+    if (!decoder.decode(result.userVerification))
         return WTF::nullopt;
     return result;
 }
index 226468a..9c5b51c 100644 (file)
@@ -56,7 +56,7 @@ template<class Decoder>
 Optional<PublicKeyCredentialDescriptor> PublicKeyCredentialDescriptor::decode(Decoder& decoder)
 {
     PublicKeyCredentialDescriptor result;
-    if (!decoder.decodeEnum(result.type))
+    if (!decoder.decode(result.type))
         return WTF::nullopt;
     if (!decoder.decode(result.idVector))
         return WTF::nullopt;
index ce10dc3..f34667f 100644 (file)
@@ -48,14 +48,14 @@ struct ExceptionData {
 template<class Encoder>
 void ExceptionData::encode(Encoder& encoder) const
 {
-    encoder.encodeEnum(code);
+    encoder << code;
     encoder << message;
 }
 
 template<class Decoder>
 bool ExceptionData::decode(Decoder& decoder, ExceptionData& data)
 {
-    if (!decoder.decodeEnum(data.code))
+    if (!decoder.decode(data.code))
         return false;
 
     if (!decoder.decode(data.message))
index b009fac..ec86f70 100644 (file)
@@ -82,7 +82,7 @@ struct DataListSuggestionInformation {
 template<class Encoder>
 void DataListSuggestionInformation::encode(Encoder& encoder) const
 {
-    encoder.encodeEnum(activationType);
+    encoder << activationType;
     encoder << suggestions;
     encoder << elementRect;
 }
@@ -91,7 +91,7 @@ template<class Decoder>
 Optional<DataListSuggestionInformation> DataListSuggestionInformation::decode(Decoder& decoder)
 {
     DataListSuggestionActivationType activationType;
-    if (!decoder.decodeEnum(activationType))
+    if (!decoder.decode(activationType))
         return WTF::nullopt;
 
     Optional<Vector<DataListSuggestion>> suggestions;
index dc6d975..7867bcc 100644 (file)
@@ -265,7 +265,7 @@ template<class Encoder> inline void SecurityOrigin::encode(Encoder& encoder) con
     encoder << m_universalAccess;
     encoder << m_domainWasSetInDOM;
     encoder << m_canLoadLocalResources;
-    encoder.encodeEnum(m_storageBlockingPolicy);
+    encoder << m_storageBlockingPolicy;
     encoder << m_enforcesFilePathSeparation;
     encoder << m_needsStorageAccessFromFileURLsQuirk;
     encoder << m_isPotentiallyTrustworthy;
@@ -293,7 +293,7 @@ template<class Decoder> inline RefPtr<SecurityOrigin> SecurityOrigin::decode(Dec
         return nullptr;
     if (!decoder.decode(origin->m_canLoadLocalResources))
         return nullptr;
-    if (!decoder.decodeEnum(origin->m_storageBlockingPolicy))
+    if (!decoder.decode(origin->m_storageBlockingPolicy))
         return nullptr;
     if (!decoder.decode(origin->m_enforcesFilePathSeparation))
         return nullptr;
index 27e7737..424fe6b 100644 (file)
@@ -223,6 +223,7 @@ template<> struct EnumTraits<WebCore::ContextMenuAction> {
         WebCore::ContextMenuAction::ContextMenuItemTagCut,
         WebCore::ContextMenuAction::ContextMenuItemTagPaste,
 #if PLATFORM(GTK)
+        WebCore::ContextMenuAction::ContextMenuItemTagPasteAsPlainText,
         WebCore::ContextMenuAction::ContextMenuItemTagDelete,
         WebCore::ContextMenuAction::ContextMenuItemTagSelectAll,
         WebCore::ContextMenuAction::ContextMenuItemTagInputMethods,
index 5a5d90c..4ba0524 100644 (file)
@@ -48,7 +48,7 @@ template<class Encoder>
 void LinkIcon::encode(Encoder& encoder) const
 {
     encoder << url << mimeType << size << attributes;
-    encoder.encodeEnum(type);
+    encoder << type;
 }
 
 template<class Decoder>
@@ -66,7 +66,7 @@ bool LinkIcon::decode(Decoder& decoder, LinkIcon& result)
     if (!decoder.decode(result.attributes))
         return false;
 
-    if (!decoder.decodeEnum(result.type))
+    if (!decoder.decode(result.type))
         return false;
 
     return true;
index adcb7b1..f0d5ea4 100644 (file)
@@ -127,7 +127,7 @@ template<class Encoder>
 void PasteboardItemInfo::encode(Encoder& encoder) const
 {
     encoder << pathsForFileUpload << platformTypesForFileUpload << platformTypesByFidelity << suggestedFileName << preferredPresentationSize << isNonTextType << containsFileURLAndFileUploadContent << webSafeTypesByFidelity;
-    encoder.encodeEnum(preferredPresentationStyle);
+    encoder << preferredPresentationStyle;
 }
 
 template<class Decoder>
@@ -158,7 +158,7 @@ Optional<PasteboardItemInfo> PasteboardItemInfo::decode(Decoder& decoder)
     if (!decoder.decode(result.webSafeTypesByFidelity))
         return WTF::nullopt;
 
-    if (!decoder.decodeEnum(result.preferredPresentationStyle))
+    if (!decoder.decode(result.preferredPresentationStyle))
         return WTF::nullopt;
 
     return result;
index 2bc0bc6..d51fd32 100644 (file)
@@ -101,7 +101,7 @@ void ScreenData::encode(Encoder& encoder) const
     if (colorSpace) {
         // Try to encode the name.
         if (auto name = adoptCF(CGColorSpaceCopyName(colorSpace.get()))) {
-            encoder.encodeEnum(ColorSpaceType::Name);
+            encoder << ColorSpaceType::Name;
             encoder << String(name.get());
             return;
         }
@@ -111,14 +111,14 @@ void ScreenData::encode(Encoder& encoder) const
             Vector<uint8_t> iccData;
             iccData.append(CFDataGetBytePtr(profileData.get()), CFDataGetLength(profileData.get()));
 
-            encoder.encodeEnum(ColorSpaceType::Data);
+            encoder << ColorSpaceType::Data;
             encoder << iccData;
             return;
         }
     }
 
     // The color space was null or failed to be encoded.
-    encoder.encodeEnum(ColorSpaceType::None);
+    encoder << ColorSpaceType::None;
 }
 
 template<class Decoder>
@@ -177,7 +177,7 @@ Optional<ScreenData> ScreenData::decode(Decoder& decoder)
 #endif
 
     ColorSpaceType dataType;
-    if (!decoder.decodeEnum(dataType))
+    if (!decoder.decode(dataType))
         return WTF::nullopt;
 
     RetainPtr<CGColorSpaceRef> cgColorSpace;
index dc6ba5d..ced681b 100644 (file)
@@ -216,8 +216,8 @@ void GenericCueData::encode(Encoder& encoder) const
     encoder << m_foregroundColor;
     encoder << m_backgroundColor;
     encoder << m_highlightColor;
-    encoder.encodeEnum(m_align);
-    encoder.encodeEnum(m_status);
+    encoder << m_align;
+    encoder << m_status;
 }
 
 class InbandGenericCue : public RefCounted<InbandGenericCue> {
index d510ab6..5fd6273 100644 (file)
@@ -302,7 +302,7 @@ template<class Encoder> void Path::encode(Encoder& encoder) const
     encoder << static_cast<uint64_t>(elementCount());
 
     apply([&](auto& element) {
-        encoder.encodeEnum(element.type);
+        encoder << element.type;
 
         switch (element.type) {
         case PathElement::Type::MoveToPoint:
@@ -351,7 +351,7 @@ template<class Decoder> Optional<Path> Path::decode(Decoder& decoder)
 
     for (uint64_t i = 0; i < numPoints; ++i) {
         PathElement::Type elementType;
-        if (!decoder.decodeEnum(elementType))
+        if (!decoder.decode(elementType))
             return WTF::nullopt;
 
         switch (elementType) {
index 8d4ff49..25bf2b9 100644 (file)
@@ -425,7 +425,7 @@ void SetState::encode(Encoder& encoder) const
         encoder << state.fillColor;
 
     if (changeFlags.contains(GraphicsContextState::StrokeStyleChange))
-        encoder.encodeEnum(state.strokeStyle);
+        encoder << state.strokeStyle;
 
     if (changeFlags.contains(GraphicsContextState::FillRuleChange))
         encoder << state.fillRule;
@@ -596,7 +596,7 @@ Optional<Ref<SetState>> SetState::decode(Decoder& decoder)
 
     if (stateChange.m_changeFlags.contains(GraphicsContextState::StrokeStyleChange)) {
         StrokeStyle strokeStyle;
-        if (!decoder.decodeEnum(strokeStyle))
+        if (!decoder.decode(strokeStyle))
             return WTF::nullopt;
 
         stateChange.m_state.strokeStyle = strokeStyle;
@@ -1334,8 +1334,8 @@ void DrawTiledScaledImage::encode(Encoder& encoder) const
     encoder << m_destination;
     encoder << m_source;
     encoder << m_tileScaleFactor;
-    encoder.encodeEnum(m_hRule);
-    encoder.encodeEnum(m_vRule);
+    encoder << m_hRule;
+    encoder << m_vRule;
     encoder << m_imagePaintingOptions;
 }
 
@@ -1363,11 +1363,11 @@ Optional<Ref<DrawTiledScaledImage>> DrawTiledScaledImage::decode(Decoder& decode
         return WTF::nullopt;
 
     Image::TileRule hRule;
-    if (!decoder.decodeEnum(hRule))
+    if (!decoder.decode(hRule))
         return WTF::nullopt;
 
     Image::TileRule vRule;
-    if (!decoder.decodeEnum(vRule))
+    if (!decoder.decode(vRule))
         return WTF::nullopt;
 
     Optional<ImagePaintingOptions> imagePaintingOptions;
index fad10d6..7a17cbc 100644 (file)
@@ -72,7 +72,7 @@ public:
         encoder << m_label;
         encoder << m_groupId;
         encoder << m_enabled;
-        encoder.encodeEnum(m_type);
+        encoder << m_type;
     }
 
     template <class Decoder>
index 0c635a8..32bf35d 100644 (file)
@@ -56,20 +56,20 @@ public:
 
     template <class Encoder> void encode(Encoder& encoder) const
     {
-        encoder.encodeEnum(m_constraintType);
+        encoder << m_constraintType;
         encoder << m_name;
-        encoder.encodeEnum(m_dataType);
+        encoder << m_dataType;
     }
 
     template <class Decoder> static WARN_UNUSED_RETURN bool decode(Decoder& decoder, MediaConstraint& constraint)
     {
-        if (!decoder.decodeEnum(constraint.m_constraintType))
+        if (!decoder.decode(constraint.m_constraintType))
             return false;
 
         if (!decoder.decode(constraint.m_name))
             return false;
 
-        if (!decoder.decodeEnum(constraint.m_dataType))
+        if (!decoder.decode(constraint.m_dataType))
             return false;
 
         return true;
index 0e2b9d3..50c83b0 100644 (file)
@@ -43,7 +43,7 @@ struct MediaStreamRequest {
     template<class Encoder>
     void encode(Encoder& encoder) const
     {
-        encoder.encodeEnum(type);
+        encoder << type;
         encoder << audioConstraints;
         encoder << videoConstraints;
         encoder << isUserGesturePriviledged;
@@ -52,7 +52,7 @@ struct MediaStreamRequest {
     template <class Decoder> static Optional<MediaStreamRequest> decode(Decoder& decoder)
     {
         MediaStreamRequest request;
-        if (decoder.decodeEnum(request.type) && decoder.decode(request.audioConstraints) && decoder.decode(request.videoConstraints) && decoder.decode(request.isUserGesturePriviledged))
+        if (decoder.decode(request.type) && decoder.decode(request.audioConstraints) && decoder.decode(request.videoConstraints) && decoder.decode(request.isUserGesturePriviledged))
             return request;
 
         return WTF::nullopt;
index 94f22b5..a564b40 100644 (file)
@@ -116,7 +116,7 @@ void CapabilityValueOrRange::encode(Encoder& encoder) const
 {
     encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(&m_minOrValue), sizeof(ValueUnion), alignof(ValueUnion));
     encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(&m_max), sizeof(ValueUnion), alignof(ValueUnion));
-    encoder.encodeEnum(m_type);
+    encoder << m_type;
 }
 
 template<class Decoder>
@@ -124,7 +124,7 @@ bool CapabilityValueOrRange::decode(Decoder& decoder, CapabilityValueOrRange& va
 {
     return decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(&valueOrRange.m_minOrValue), sizeof(ValueUnion), alignof(ValueUnion))
         && decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(&valueOrRange.m_max), sizeof(ValueUnion), alignof(ValueUnion))
-        && decoder.decodeEnum(valueOrRange.m_type);
+        && decoder.decode(valueOrRange.m_type);
 }
 
 class RealtimeMediaSourceCapabilities {
@@ -227,7 +227,7 @@ void RealtimeMediaSourceCapabilities::encode(Encoder& encoder) const
         << m_deviceId
         << m_groupId
         << m_supportedConstraints;
-    encoder.encodeEnum(m_echoCancellation);
+    encoder << m_echoCancellation;
 }
 
 template<class Decoder>
@@ -244,7 +244,7 @@ bool RealtimeMediaSourceCapabilities::decode(Decoder& decoder, RealtimeMediaSour
         && decoder.decode(capabilities.m_deviceId)
         && decoder.decode(capabilities.m_groupId)
         && decoder.decode(capabilities.m_supportedConstraints)
-        && decoder.decodeEnum(capabilities.m_echoCancellation);
+        && decoder.decode(capabilities.m_echoCancellation);
 }
 
 } // namespace WebCore
index 59c341c..d95348d 100644 (file)
@@ -172,7 +172,7 @@ void RealtimeMediaSourceSettings::encode(Encoder& encoder) const
         << m_groupId
         << m_label
         << m_supportedConstraints;
-    encoder.encodeEnum(m_facingMode);
+    encoder << m_facingMode;
 }
 
 template<class Decoder>
@@ -190,7 +190,7 @@ bool RealtimeMediaSourceSettings::decode(Decoder& decoder, RealtimeMediaSourceSe
         && decoder.decode(settings.m_groupId)
         && decoder.decode(settings.m_label)
         && decoder.decode(settings.m_supportedConstraints)
-        && decoder.decodeEnum(settings.m_facingMode);
+        && decoder.decode(settings.m_facingMode);
 }
 
 String convertEnumerationToString(RealtimeMediaSourceSettings::VideoFacingMode);
index b44b41b..50e6f40 100644 (file)
@@ -102,7 +102,7 @@ struct MockDisplayProperties {
     template<class Encoder>
     void encode(Encoder& encoder) const
     {
-        encoder.encodeEnum(type);
+        encoder << type;
         encoder << fillColor;
         encoder << defaultSize;
     }
index 059afb7..cb68397 100644 (file)
@@ -222,7 +222,7 @@ private:
 template <class Encoder>
 void HTTPHeaderMap::CommonHeader::encode(Encoder& encoder) const
 {
-    encoder.encodeEnum(key);
+    encoder << key;
     encoder << value;
 }
 
@@ -230,7 +230,7 @@ template <class Decoder>
 auto HTTPHeaderMap::CommonHeader::decode(Decoder& decoder) -> Optional<CommonHeader>
 {
     HTTPHeaderName name;
-    if (!decoder.decodeEnum(name))
+    if (!decoder.decode(name))
         return WTF::nullopt;
     String value;
     if (!decoder.decode(value))
index 12ac08e..5a305e8 100644 (file)
@@ -177,11 +177,11 @@ Optional<MockWebAuthenticationConfiguration::HidConfiguration> MockWebAuthentica
     MockWebAuthenticationConfiguration::HidConfiguration result;
     if (!decoder.decode(result.payloadBase64))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(result.stage))
+    if (!decoder.decode(result.stage))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(result.subStage))
+    if (!decoder.decode(result.subStage))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(result.error))
+    if (!decoder.decode(result.error))
         return WTF::nullopt;
     if (!decoder.decode(result.isU2f))
         return WTF::nullopt;
@@ -210,7 +210,7 @@ template<class Decoder>
 Optional<MockWebAuthenticationConfiguration::NfcConfiguration> MockWebAuthenticationConfiguration::NfcConfiguration::decode(Decoder& decoder)
 {
     MockWebAuthenticationConfiguration::NfcConfiguration result;
-    if (!decoder.decodeEnum(result.error))
+    if (!decoder.decode(result.error))
         return WTF::nullopt;
     if (!decoder.decode(result.payloadBase64))
         return WTF::nullopt;
index 7faf131..c4b141f 100644 (file)
@@ -134,7 +134,7 @@ Optional<ServiceWorkerContextData> ServiceWorkerContextData::decode(Decoder& dec
         return WTF::nullopt;
     
     WorkerType workerType;
-    if (!decoder.decodeEnum(workerType))
+    if (!decoder.decode(workerType))
         return WTF::nullopt;
 
     bool loadedFromDisk;
index 16ec29f..638dd60 100644 (file)
@@ -73,7 +73,7 @@ template<class Encoder>
 void ServiceWorkerJobData::encode(Encoder& encoder) const
 {
     encoder << identifier() << scriptURL << clientCreationURL << topOrigin << scopeURL << sourceContext;
-    encoder.encodeEnum(type);
+    encoder << type;
     switch (type) {
     case ServiceWorkerJobType::Register:
         encoder << registrationOptions;
@@ -110,7 +110,7 @@ Optional<ServiceWorkerJobData> ServiceWorkerJobData::decode(Decoder& decoder)
         return WTF::nullopt;
     if (!decoder.decode(jobData.sourceContext))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(jobData.type))
+    if (!decoder.decode(jobData.type))
         return WTF::nullopt;
 
     switch (jobData.type) {
index 5030afb..e5809ee 100644 (file)
@@ -1,3 +1,178 @@
+2020-06-12  David Kilzer  <ddkilzer@apple.com>
+
+        [IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder::encodeEnum()
+        <https://webkit.org/b/211988>
+        <rdar://problem/63137695>
+
+        Reviewed by Darin Adler.
+
+        Replace decodeEnum() with decode() and encodeEnum() with
+        operator<<().
+
+        * GPUProcess/media/TextTrackPrivateRemoteConfiguration.h:
+        (WebKit::TextTrackPrivateRemoteConfiguration::encode const):
+        * GPUProcess/media/TrackPrivateRemoteConfiguration.h:
+        (WebKit::TrackPrivateRemoteConfiguration::encode const):
+        * NetworkProcess/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode const):
+        (WebKit::NetworkProcessCreationParameters::decode):
+        * NetworkProcess/NetworkResourceLoadParameters.cpp:
+        (WebKit::NetworkResourceLoadParameters::encode const):
+        (WebKit::NetworkResourceLoadParameters::decode):
+        * Platform/IPC/Decoder.h:
+        (IPC::Decoder::decode):
+        (IPC::Decoder::operator>>):
+        - Make use of std::underlying_type_t<>.
+        (IPC::Decoder::decodeEnum): Delete.
+        - Replace with calls to decode().
+        * Platform/IPC/Encoder.h:
+        (IPC::Encoder::operator<<):
+        (IPC::Encoder::encode):
+        - Make use of WTF::enumToUnderlyingType<>.
+        (IPC::Encoder::encodeEnum): Delete.
+        - Replace with calls to operator<<().
+        * Shared/Cocoa/ArgumentCodersCocoa.mm:
+        (IPC::decodeObject):
+        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
+        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
+        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
+        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode):
+        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
+        * Shared/ContextMenuContextData.cpp:
+        (WebKit::ContextMenuContextData::encode const):
+        (WebKit::ContextMenuContextData::decode):
+        * Shared/FocusedElementInformation.cpp:
+        (WebKit::FocusedElementInformation::encode const):
+        (WebKit::FocusedElementInformation::decode):
+        * Shared/LoadParameters.cpp:
+        (WebKit::LoadParameters::encode const):
+        (WebKit::LoadParameters::decode):
+        * Shared/NavigationActionData.cpp:
+        (WebKit::NavigationActionData::encode const):
+        (WebKit::NavigationActionData::decode):
+        * Shared/PlatformPopupMenuData.cpp:
+        (WebKit::PlatformPopupMenuData::encode const):
+        (WebKit::PlatformPopupMenuData::decode):
+        * Shared/Plugins/PluginProcessCreationParameters.cpp:
+        (WebKit::PluginProcessCreationParameters::encode const):
+        (WebKit::PluginProcessCreationParameters::decode):
+        * Shared/PrintInfo.cpp:
+        (WebKit::PrintInfo::encode const):
+        (WebKit::PrintInfo::decode):
+        * Shared/RTCPacketOptions.cpp:
+        (WebKit::RTCPacketOptions::encode const):
+        (WebKit::RTCPacketOptions::decode):
+        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
+        (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
+        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+        (ArgumentCoder<ScrollingStateNode>::encode):
+        (ArgumentCoder<RequestedScrollData>::encode):
+        (ArgumentCoder<RequestedScrollData>::decode):
+        (WebKit::RemoteScrollingCoordinatorTransaction::decode):
+        * Shared/SessionState.cpp:
+        (WebKit::HTTPBody::Element::encode const):
+        (WebKit::HTTPBody::Element::decode):
+        (WebKit::PageState::encode const):
+        (WebKit::PageState::decode):
+        * Shared/TouchBarMenuItemData.cpp:
+        (WebKit::TouchBarMenuItemData::encode const):
+        (WebKit::TouchBarMenuItemData::decode):
+        * Shared/UserData.cpp:
+        (WebKit::UserData::encode):
+        (WebKit::UserData::decode):
+        * Shared/WebContextMenuItemData.cpp:
+        (WebKit::WebContextMenuItemData::encode const):
+        (WebKit::WebContextMenuItemData::decode):
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<LinearTimingFunction>::encode):
+        (IPC::ArgumentCoder<CubicBezierTimingFunction>::encode):
+        (IPC::ArgumentCoder<CubicBezierTimingFunction>::decode):
+        (IPC::ArgumentCoder<StepsTimingFunction>::encode):
+        (IPC::ArgumentCoder<SpringTimingFunction>::encode):
+        (IPC::ArgumentCoder<PluginInfo>::encode):
+        (IPC::ArgumentCoder<PluginInfo>::decode):
+        (IPC::ArgumentCoder<ProtectionSpace>::encode):
+        (IPC::ArgumentCoder<ProtectionSpace>::decode):
+        (IPC::ArgumentCoder<Credential>::encode):
+        (IPC::ArgumentCoder<Credential>::decode):
+        (IPC::ArgumentCoder<Cursor>::encode):
+        (IPC::ArgumentCoder<Cursor>::decode):
+        (IPC::ArgumentCoder<ResourceError>::encode):
+        (IPC::ArgumentCoder<ResourceError>::decode):
+        (IPC::ArgumentCoder<DragData>::encode):
+        (IPC::ArgumentCoder<DragData>::decode):
+        (IPC::ArgumentCoder<CompositionUnderline>::encode):
+        (IPC::ArgumentCoder<CompositionUnderline>::decode):
+        (IPC::ArgumentCoder<FileChooserSettings>::encode):
+        (IPC::ArgumentCoder<FileChooserSettings>::decode):
+        (IPC::ArgumentCoder<TextCheckingRequestData>::encode):
+        (IPC::ArgumentCoder<TextCheckingRequestData>::decode):
+        (IPC::ArgumentCoder<TextCheckingResult>::encode):
+        (IPC::ArgumentCoder<TextCheckingResult>::decode):
+        (IPC::ArgumentCoder<UserStyleSheet>::encode):
+        (IPC::ArgumentCoder<UserStyleSheet>::decode):
+        (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
+        (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
+        (IPC::ArgumentCoder<FilterOperation>::encode):
+        (IPC::decodeFilterOperation):
+        (IPC::ArgumentCoder<FontAttributes>::encode):
+        (IPC::ArgumentCoder<FontAttributes>::decode):
+        (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode):
+        (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode):
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode const):
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPopupItem.cpp:
+        (WebKit::WebPopupItem::encode const):
+        (WebKit::WebPopupItem::decode):
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode const):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebsiteData/WebsiteData.cpp:
+        (WebKit::WebsiteData::Entry::encode const):
+        (WebKit::WebsiteData::Entry::decode):
+        * Shared/curl/WebCoreArgumentCodersCurl.cpp:
+        (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
+        (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
+        (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
+        (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
+        * Shared/glib/InputMethodState.cpp:
+        (WebKit::InputMethodState::encode const):
+        (WebKit::InputMethodState::decode):
+        * Shared/glib/UserMessage.cpp:
+        (WebKit::UserMessage::encode const):
+        (WebKit::UserMessage::decode):
+        * Shared/mac/ColorSpaceData.mm:
+        (WebKit::ColorSpaceData::encode const):
+        (WebKit::ColorSpaceData::decode):
+        * Shared/mac/SecItemRequestData.cpp:
+        (WebKit::SecItemRequestData::encode const):
+        (WebKit::SecItemRequestData::decode):
+        * Shared/mac/WebCoreArgumentCodersMac.mm:
+        (IPC::ArgumentCoder<WebCore::ResourceRequest>::encodePlatformData):
+        (IPC::ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData):
+        (IPC::ArgumentCoder<WebCore::CertificateInfo>::encode):
+        (IPC::ArgumentCoder<WebCore::CertificateInfo>::decode):
+        * Shared/soup/WebCoreArgumentCodersSoup.cpp:
+        (IPC::ArgumentCoder<SoupNetworkProxySettings>::encode):
+        (IPC::ArgumentCoder<SoupNetworkProxySettings>::decode):
+        * WebProcess/GPU/media/RemoteMediaPlayerState.h:
+        (WebKit::RemoteMediaPlayerState::encode const):
+        (WebKit::RemoteMediaPlayerState::decode):
+        * WebProcess/Network/NetworkProcessConnectionInfo.h:
+        (WebKit::NetworkProcessConnectionInfo::decode):
+        * WebProcess/Plugins/Plugin.cpp:
+        (WebKit::Plugin::Parameters::encode const):
+        (WebKit::Plugin::Parameters::decode):
+        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
+        (WebKit::PlatformCAAnimationRemote::KeyframeValue::encode const):
+        (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
+        (WebKit::PlatformCAAnimationRemote::Properties::encode const):
+        (WebKit::PlatformCAAnimationRemote::Properties::decode):
+
 2020-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [iPadOS] Focusing selects and color inputs should not bring up the software keyboard
index aa45b37..449639a 100644 (file)
@@ -61,9 +61,9 @@ struct TextTrackPrivateRemoteConfiguration {
         encoder << inBandMetadataTrackDispatchType;
         encoder << startTimeVariance;
         encoder << trackIndex;
-        encoder.encodeEnum(cueFormat);
-        encoder.encodeEnum(mode);
-        encoder.encodeEnum(kind);
+        encoder << cueFormat;
+        encoder << mode;
+        encoder << kind;
         encoder << isClosedCaptions;
         encoder << isSDH;
         encoder << containsOnlyForcedSubtitles;
index c5d4f95..63ddb5b 100644 (file)
@@ -55,9 +55,9 @@ struct TrackPrivateRemoteConfiguration {
         encoder << startTimeVariance;
         encoder << trackIndex;
         encoder << enabled;
-        encoder.encodeEnum(audioKind);
+        encoder << audioKind;
         encoder << selected;
-        encoder.encodeEnum(videoKind);
+        encoder << videoKind;
     }
 
     template <class Decoder>
index fe59cce..aa8ce75 100644 (file)
@@ -39,7 +39,7 @@ NetworkProcessCreationParameters::NetworkProcessCreationParameters() = default;
 
 void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(cacheModel);
+    encoder << cacheModel;
 #if PLATFORM(MAC) || PLATFORM(MACCATALYST)
     encoder << uiProcessCookieStorageIdentifier;
 #endif
@@ -58,7 +58,7 @@ void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const
 #endif
     encoder << defaultDataStoreParameters;
 #if USE(SOUP)
-    encoder.encodeEnum(cookieAcceptPolicy);
+    encoder << cookieAcceptPolicy;
     encoder << ignoreTLSErrors;
     encoder << languages;
     encoder << proxySettings;
@@ -80,7 +80,7 @@ void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const
 
 bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProcessCreationParameters& result)
 {
-    if (!decoder.decodeEnum(result.cacheModel))
+    if (!decoder.decode(result.cacheModel))
         return false;
 
 #if PLATFORM(MAC) || PLATFORM(MACCATALYST)
@@ -128,7 +128,7 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc
     result.defaultDataStoreParameters = WTFMove(*defaultDataStoreParameters);
 
 #if USE(SOUP)
-    if (!decoder.decodeEnum(result.cookieAcceptPolicy))
+    if (!decoder.decode(result.cookieAcceptPolicy))
         return false;
     if (!decoder.decode(result.ignoreTLSErrors))
         return false;
index 59aff37..fee98b6 100644 (file)
@@ -77,11 +77,11 @@ void NetworkResourceLoadParameters::encode(IPC::Encoder& encoder) const
         encoder << requestSandboxExtension;
     }
 
-    encoder.encodeEnum(contentSniffingPolicy);
-    encoder.encodeEnum(contentEncodingSniffingPolicy);
-    encoder.encodeEnum(storedCredentialsPolicy);
-    encoder.encodeEnum(clientCredentialPolicy);
-    encoder.encodeEnum(shouldPreconnectOnly);
+    encoder << contentSniffingPolicy;
+    encoder << contentEncodingSniffingPolicy;
+    encoder << storedCredentialsPolicy;
+    encoder << clientCredentialPolicy;
+    encoder << shouldPreconnectOnly;
     encoder << shouldClearReferrerOnHTTPSToHTTPRedirect;
     encoder << needsCertificateInfo;
     encoder << isMainFrameNavigation;
@@ -101,7 +101,7 @@ void NetworkResourceLoadParameters::encode(IPC::Encoder& encoder) const
 
     encoder << shouldRestrictHTTPResponseAccess;
 
-    encoder.encodeEnum(preflightPolicy);
+    encoder << preflightPolicy;
 
     encoder << shouldEnableCrossOriginResourcePolicy;
 
@@ -181,15 +181,15 @@ Optional<NetworkResourceLoadParameters> NetworkResourceLoadParameters::decode(IP
         result.resourceSandboxExtension = SandboxExtension::create(WTFMove(*resourceSandboxExtensionHandle));
     }
 
-    if (!decoder.decodeEnum(result.contentSniffingPolicy))
+    if (!decoder.decode(result.contentSniffingPolicy))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(result.contentEncodingSniffingPolicy))
+    if (!decoder.decode(result.contentEncodingSniffingPolicy))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(result.storedCredentialsPolicy))
+    if (!decoder.decode(result.storedCredentialsPolicy))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(result.clientCredentialPolicy))
+    if (!decoder.decode(result.clientCredentialPolicy))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(result.shouldPreconnectOnly))
+    if (!decoder.decode(result.shouldPreconnectOnly))
         return WTF::nullopt;
     if (!decoder.decode(result.shouldClearReferrerOnHTTPSToHTTPRedirect))
         return WTF::nullopt;
@@ -239,7 +239,7 @@ Optional<NetworkResourceLoadParameters> NetworkResourceLoadParameters::decode(IP
         return WTF::nullopt;
     result.shouldRestrictHTTPResponseAccess = *shouldRestrictHTTPResponseAccess;
 
-    if (!decoder.decodeEnum(result.preflightPolicy))
+    if (!decoder.decode(result.preflightPolicy))
         return WTF::nullopt;
 
     Optional<bool> shouldEnableCrossOriginResourcePolicy;
index 3793b5a..7db3d8c 100644 (file)
@@ -100,7 +100,7 @@ public:
     template<typename E, std::enable_if_t<std::is_enum<E>::value>* = nullptr>
     WARN_UNUSED_RETURN bool decode(E& enumValue)
     {
-        typename std::underlying_type<E>::type value;
+        std::underlying_type_t<E> value;
         if (!decode(value))
             return false;
         if (!WTF::isValidEnum<E>(value))
@@ -113,24 +113,13 @@ public:
     template<typename E, std::enable_if_t<std::is_enum<E>::value>* = nullptr>
     Decoder& operator>>(Optional<E>& optional)
     {
-        Optional<typename std::underlying_type<E>::type> value;
+        Optional<std::underlying_type_t<E>> value;
         *this >> value;
         if (value && WTF::isValidEnum<E>(*value))
             optional = static_cast<E>(*value);
         return *this;
     }
 
-    template<typename E>
-    WARN_UNUSED_RETURN bool decodeEnum(E& result)
-    {
-        // FIXME: Remove this after migrating all uses of this function to decode() or operator>>() with WTF::isValidEnum check.
-        typename std::underlying_type<E>::type value;
-        if (!decode(value))
-            return false;
-        result = static_cast<E>(value);
-        return true;
-    }
-
     template<typename T>
     bool bufferIsLargeEnoughToContain(size_t numElements) const
     {
index a83e0e2..ab7499f 100644 (file)
@@ -62,13 +62,6 @@ public:
     void encodeFixedLengthData(const uint8_t* data, size_t, size_t alignment);
     void encodeVariableLengthByteArray(const DataReference&);
 
-    template<typename E>
-    void encodeEnum(E enumValue)
-    {
-        // FIXME: Remove this after migrating all uses of this function to encode() or operator<<() with WTF::isValidEnum check.
-        encode(static_cast<typename std::underlying_type<E>::type>(enumValue));
-    }
-
     template<typename T, std::enable_if_t<!std::is_enum<typename std::remove_const_t<std::remove_reference_t<T>>>::value && !std::is_arithmetic<typename std::remove_const_t<std::remove_reference_t<T>>>::value>* = nullptr>
     void encode(T&& t)
     {
@@ -78,8 +71,8 @@ public:
     template<typename E, std::enable_if_t<std::is_enum<E>::value>* = nullptr>
     Encoder& operator<<(E&& enumValue)
     {
-        ASSERT(WTF::isValidEnum<E>(static_cast<typename std::underlying_type<E>::type>(enumValue)));
-        encode(static_cast<typename std::underlying_type<E>::type>(enumValue));
+        ASSERT(WTF::isValidEnum<E>(WTF::enumToUnderlyingType<E>(enumValue)));
+        encode(WTF::enumToUnderlyingType<E>(enumValue));
         return *this;
     }
 
@@ -112,8 +105,8 @@ private:
     template<typename E, std::enable_if_t<std::is_enum<E>::value>* = nullptr>
     void encode(E enumValue)
     {
-        ASSERT(WTF::isValidEnum<E>(static_cast<typename std::underlying_type<E>::type>(enumValue)));
-        encode(static_cast<typename std::underlying_type<E>::type>(enumValue));
+        ASSERT(WTF::isValidEnum<E>(WTF::enumToUnderlyingType<E>(enumValue)));
+        encode(WTF::enumToUnderlyingType<E>(enumValue));
     }
 
     void encodeHeader();
index 0dcb97e..28934cb 100644 (file)
@@ -473,7 +473,7 @@ Optional<RetainPtr<id>> decodeObject(Decoder& decoder, NSArray<Class> *allowedCl
         return { nullptr };
 
     NSType type;
-    if (!decoder.decodeEnum(type))
+    if (!decoder.decode(type))
         return WTF::nullopt;
 
     switch (type) {
index 1ae81a1..dee0321 100644 (file)
@@ -210,13 +210,13 @@ void ArgumentCoder<ApplePaySessionPaymentRequest>::encode(Encoder& encoder, cons
     encoder << request.shippingContact();
     encoder << request.merchantCapabilities();
     encoder << request.supportedNetworks();
-    encoder.encodeEnum(request.shippingType());
+    encoder << request.shippingType();
     encoder << request.shippingMethods();
     encoder << request.lineItems();
     encoder << request.total();
     encoder << request.applicationData();
     encoder << request.supportedCountries();
-    encoder.encodeEnum(request.requester());
+    encoder << request.requester();
 #if ENABLE(APPLE_PAY_INSTALLMENTS)
     encoder << request.installmentConfiguration();
 #endif
@@ -267,7 +267,7 @@ bool ArgumentCoder<ApplePaySessionPaymentRequest>::decode(Decoder& decoder, Appl
     request.setSupportedNetworks(supportedNetworks);
 
     ApplePaySessionPaymentRequest::ShippingType shippingType;
-    if (!decoder.decodeEnum(shippingType))
+    if (!decoder.decode(shippingType))
         return false;
     request.setShippingType(shippingType);
 
@@ -298,7 +298,7 @@ bool ArgumentCoder<ApplePaySessionPaymentRequest>::decode(Decoder& decoder, Appl
     request.setSupportedCountries(WTFMove(supportedCountries));
 
     ApplePaySessionPaymentRequest::Requester requester;
-    if (!decoder.decodeEnum(requester))
+    if (!decoder.decode(requester))
         return false;
     request.setRequester(requester);
     
@@ -341,7 +341,7 @@ bool ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::decode(Decoder
 
 void ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode(Encoder& encoder, const ApplePaySessionPaymentRequest::LineItem& lineItem)
 {
-    encoder.encodeEnum(lineItem.type);
+    encoder << lineItem.type;
     encoder << lineItem.label;
     encoder << lineItem.amount;
 }
@@ -349,7 +349,7 @@ void ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode(Encoder& enc
 Optional<ApplePaySessionPaymentRequest::LineItem> ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode(Decoder& decoder)
 {
     WebCore::ApplePaySessionPaymentRequest::LineItem lineItem;
-    if (!decoder.decodeEnum(lineItem.type))
+    if (!decoder.decode(lineItem.type))
         return WTF::nullopt;
     if (!decoder.decode(lineItem.label))
         return WTF::nullopt;
index ecb53c7..8cc5635 100644 (file)
@@ -74,7 +74,7 @@ ContextMenuContextData::ContextMenuContextData(const WebCore::IntPoint& menuLoca
 
 void ContextMenuContextData::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(m_type);
+    encoder << m_type;
     encoder << m_menuLocation;
     encoder << m_menuItems;
     encoder << m_webHitTestResultData;
@@ -93,7 +93,7 @@ void ContextMenuContextData::encode(IPC::Encoder& encoder) const
 
 bool ContextMenuContextData::decode(IPC::Decoder& decoder, ContextMenuContextData& result)
 {
-    if (!decoder.decodeEnum(result.m_type))
+    if (!decoder.decode(result.m_type))
         return false;
 
     if (!decoder.decode(result.m_menuLocation))
index b27ab4b..247eaab 100644 (file)
@@ -77,9 +77,9 @@ void FocusedElementInformation::encode(IPC::Encoder& encoder) const
     encoder << isAutocorrect;
     encoder << isRTL;
     encoder << autocapitalizeType;
-    encoder.encodeEnum(elementType);
-    encoder.encodeEnum(inputMode);
-    encoder.encodeEnum(enterKeyHint);
+    encoder << elementType;
+    encoder << inputMode;
+    encoder << enterKeyHint;
     encoder << formAction;
     encoder << selectOptions;
     encoder << selectedIndex;
@@ -94,7 +94,7 @@ void FocusedElementInformation::encode(IPC::Encoder& encoder) const
     encoder << acceptsAutofilledLoginCredentials;
     encoder << isAutofillableUsernameField;
     encoder << representingPageURL;
-    encoder.encodeEnum(autofillFieldName);
+    encoder << autofillFieldName;
     encoder << placeholder;
     encoder << label;
     encoder << ariaLabel;
@@ -157,13 +157,13 @@ bool FocusedElementInformation::decode(IPC::Decoder& decoder, FocusedElementInfo
     if (!decoder.decode(result.autocapitalizeType))
         return false;
 
-    if (!decoder.decodeEnum(result.elementType))
+    if (!decoder.decode(result.elementType))
         return false;
 
-    if (!decoder.decodeEnum(result.inputMode))
+    if (!decoder.decode(result.inputMode))
         return false;
 
-    if (!decoder.decodeEnum(result.enterKeyHint))
+    if (!decoder.decode(result.enterKeyHint))
         return false;
 
     if (!decoder.decode(result.formAction))
@@ -208,7 +208,7 @@ bool FocusedElementInformation::decode(IPC::Decoder& decoder, FocusedElementInfo
     if (!decoder.decode(result.representingPageURL))
         return false;
 
-    if (!decoder.decodeEnum(result.autofillFieldName))
+    if (!decoder.decode(result.autofillFieldName))
         return false;
 
     if (!decoder.decode(result.placeholder))
index 28968ed..9f0f733 100644 (file)
@@ -53,8 +53,8 @@ void LoadParameters::encode(IPC::Encoder& encoder) const
     encoder << shouldOpenExternalURLsPolicy;
     encoder << shouldTreatAsContinuingLoad;
     encoder << userData;
-    encoder.encodeEnum(lockHistory);
-    encoder.encodeEnum(lockBackForwardList);
+    encoder << lockHistory;
+    encoder << lockBackForwardList;
     encoder << clientRedirectSourceForHistory;
     encoder << isNavigatingToAppBoundDomain;
 
@@ -122,10 +122,10 @@ bool LoadParameters::decode(IPC::Decoder& decoder, LoadParameters& data)
     if (!decoder.decode(data.userData))
         return false;
 
-    if (!decoder.decodeEnum(data.lockHistory))
+    if (!decoder.decode(data.lockHistory))
         return false;
 
-    if (!decoder.decodeEnum(data.lockBackForwardList))
+    if (!decoder.decode(data.lockBackForwardList))
         return false;
 
     Optional<String> clientRedirectSourceForHistory;
index 12afec0..02f7388 100644 (file)
@@ -35,13 +35,13 @@ namespace WebKit {
 
 void NavigationActionData::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(navigationType);
+    encoder << navigationType;
     encoder << modifiers;
-    encoder.encodeEnum(mouseButton);
-    encoder.encodeEnum(syntheticClickType);
+    encoder << mouseButton;
+    encoder << syntheticClickType;
     encoder << userGestureTokenIdentifier;
     encoder << canHandleRequest;
-    encoder.encodeEnum(shouldOpenExternalURLsPolicy);
+    encoder << shouldOpenExternalURLsPolicy;
     encoder << downloadAttribute;
     encoder << clickLocationInRootViewCoordinates;
     encoder << isRedirect;
@@ -51,8 +51,8 @@ void NavigationActionData::encode(IPC::Encoder& encoder) const
     encoder << requesterOrigin;
     encoder << targetBackForwardItemIdentifier;
     encoder << sourceBackForwardItemIdentifier;
-    encoder.encodeEnum(lockHistory);
-    encoder.encodeEnum(lockBackForwardList);
+    encoder << lockHistory;
+    encoder << lockBackForwardList;
     encoder << clientRedirectSourceForHistory;
     encoder << adClickAttribution;
 }
@@ -60,7 +60,7 @@ void NavigationActionData::encode(IPC::Encoder& encoder) const
 Optional<NavigationActionData> NavigationActionData::decode(IPC::Decoder& decoder)
 {
     WebCore::NavigationType navigationType;
-    if (!decoder.decodeEnum(navigationType))
+    if (!decoder.decode(navigationType))
         return WTF::nullopt;
     
     OptionSet<WebEvent::Modifier> modifiers;
@@ -68,11 +68,11 @@ Optional<NavigationActionData> NavigationActionData::decode(IPC::Decoder& decode
         return WTF::nullopt;
 
     WebMouseEvent::Button mouseButton;
-    if (!decoder.decodeEnum(mouseButton))
+    if (!decoder.decode(mouseButton))
         return WTF::nullopt;
     
     WebMouseEvent::SyntheticClickType syntheticClickType;
-    if (!decoder.decodeEnum(syntheticClickType))
+    if (!decoder.decode(syntheticClickType))
         return WTF::nullopt;
     
     Optional<uint64_t> userGestureTokenIdentifier;
@@ -86,7 +86,7 @@ Optional<NavigationActionData> NavigationActionData::decode(IPC::Decoder& decode
         return WTF::nullopt;
     
     WebCore::ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy;
-    if (!decoder.decodeEnum(shouldOpenExternalURLsPolicy))
+    if (!decoder.decode(shouldOpenExternalURLsPolicy))
         return WTF::nullopt;
     
     Optional<String> downloadAttribute;
@@ -134,11 +134,11 @@ Optional<NavigationActionData> NavigationActionData::decode(IPC::Decoder& decode
         return WTF::nullopt;
 
     WebCore::LockHistory lockHistory;
-    if (!decoder.decodeEnum(lockHistory))
+    if (!decoder.decode(lockHistory))
         return WTF::nullopt;
 
     WebCore::LockBackForwardList lockBackForwardList;
-    if (!decoder.decodeEnum(lockBackForwardList))
+    if (!decoder.decode(lockBackForwardList))
         return WTF::nullopt;
 
     Optional<String> clientRedirectSourceForHistory;
index 49e1131..d915672 100644 (file)
@@ -36,7 +36,7 @@ void PlatformPopupMenuData::encode(IPC::Encoder& encoder) const
     encoder << fontInfo;
     encoder << shouldPopOver;
     encoder << hideArrows;
-    encoder.encodeEnum(menuSize);
+    encoder << menuSize;
 #elif PLATFORM(WIN)
     encoder << m_clientPaddingLeft;
     encoder << m_clientPaddingRight;
@@ -66,7 +66,7 @@ bool PlatformPopupMenuData::decode(IPC::Decoder& decoder, PlatformPopupMenuData&
         return false;
     if (!decoder.decode(data.hideArrows))
         return false;
-    if (!decoder.decodeEnum(data.menuSize))
+    if (!decoder.decode(data.menuSize))
         return false;
 #elif PLATFORM(WIN)
     if (!decoder.decode(data.m_clientPaddingLeft))
index 5e44035..38165de 100644 (file)
@@ -41,7 +41,7 @@ PluginProcessCreationParameters::PluginProcessCreationParameters()
 
 void PluginProcessCreationParameters::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(processType);
+    encoder << processType;
     encoder << supportsAsynchronousPluginInitialization;
     encoder << minimumLifetime;
     encoder << terminationTimeout;
@@ -53,7 +53,7 @@ void PluginProcessCreationParameters::encode(IPC::Encoder& encoder) const
 
 bool PluginProcessCreationParameters::decode(IPC::Decoder& decoder, PluginProcessCreationParameters& result)
 {
-    if (!decoder.decodeEnum(result.processType))
+    if (!decoder.decode(result.processType))
         return false;
     if (!decoder.decode(result.supportsAsynchronousPluginInitialization))
         return false;
index d38ce73..4eacd4e 100644 (file)
@@ -44,7 +44,7 @@ void PrintInfo::encode(IPC::Encoder& encoder) const
 #if PLATFORM(GTK)
     IPC::encode(encoder, printSettings.get());
     IPC::encode(encoder, pageSetup.get());
-    encoder.encodeEnum(printMode);
+    encoder << printMode;
 #endif
 
 #if PLATFORM(IOS_FAMILY)
@@ -68,7 +68,7 @@ bool PrintInfo::decode(IPC::Decoder& decoder, PrintInfo& info)
         return false;
     if (!IPC::decode(decoder, info.pageSetup))
         return false;
-    if (!decoder.decodeEnum(info.printMode))
+    if (!decoder.decode(info.printMode))
         return false;
 #endif
 
index e1c9c00..a1316b6 100644 (file)
@@ -37,7 +37,7 @@ namespace WebKit {
 
 void RTCPacketOptions::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(options.dscp);
+    encoder << options.dscp;
     encoder << safeCast<int32_t>(options.packet_id);
     encoder << options.packet_time_params.rtp_sendtime_extension_id;
 
@@ -54,7 +54,7 @@ Optional<RTCPacketOptions> RTCPacketOptions::decode(IPC::Decoder& decoder)
     rtc::PacketOptions options;
 
     rtc::DiffServCodePoint dscp;
-    if (!decoder.decodeEnum(dscp))
+    if (!decoder.decode(dscp))
         return WTF::nullopt;
     options.dscp = dscp;
 
index 6fc1144..86acc69 100644 (file)
@@ -54,7 +54,7 @@ RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties()
 void RemoteLayerTreeTransaction::LayerCreationProperties::encode(IPC::Encoder& encoder) const
 {
     encoder << layerID;
-    encoder.encodeEnum(type);
+    encoder << type;
     encoder << embeddedViewID;
     encoder << hostingContextID;
     encoder << hostingDeviceScaleFactor;
@@ -66,7 +66,7 @@ auto RemoteLayerTreeTransaction::LayerCreationProperties::decode(IPC::Decoder& d
     if (!decoder.decode(result.layerID))
         return WTF::nullopt;
 
-    if (!decoder.decodeEnum(result.type))
+    if (!decoder.decode(result.type))
         return WTF::nullopt;
 
     if (!decoder.decode(result.embeddedViewID))
@@ -243,16 +243,16 @@ void RemoteLayerTreeTransaction::LayerProperties::encode(IPC::Encoder& encoder)
         encoder << shapePath;
 
     if (changedProperties & MinificationFilterChanged)
-        encoder.encodeEnum(minificationFilter);
+        encoder << minificationFilter;
 
     if (changedProperties & MagnificationFilterChanged)
-        encoder.encodeEnum(magnificationFilter);
+        encoder << magnificationFilter;
 
     if (changedProperties & BlendModeChanged)
-        encoder.encodeEnum(blendMode);
+        encoder << blendMode;
 
     if (changedProperties & WindRuleChanged)
-        encoder.encodeEnum(windRule);
+        encoder << windRule;
 
     if (changedProperties & SpeedChanged)
         encoder << speed;
@@ -277,7 +277,7 @@ void RemoteLayerTreeTransaction::LayerProperties::encode(IPC::Encoder& encoder)
         encoder << edgeAntialiasingMask;
 
     if (changedProperties & CustomAppearanceChanged)
-        encoder.encodeEnum(customAppearance);
+        encoder << customAppearance;
 
     if (changedProperties & UserInteractionEnabledChanged)
         encoder << userInteractionEnabled;
@@ -437,22 +437,22 @@ bool RemoteLayerTreeTransaction::LayerProperties::decode(IPC::Decoder& decoder,
     }
 
     if (result.changedProperties & MinificationFilterChanged) {
-        if (!decoder.decodeEnum(result.minificationFilter))
+        if (!decoder.decode(result.minificationFilter))
             return false;
     }
 
     if (result.changedProperties & MagnificationFilterChanged) {
-        if (!decoder.decodeEnum(result.magnificationFilter))
+        if (!decoder.decode(result.magnificationFilter))
             return false;
     }
 
     if (result.changedProperties & BlendModeChanged) {
-        if (!decoder.decodeEnum(result.blendMode))
+        if (!decoder.decode(result.blendMode))
             return false;
     }
 
     if (result.changedProperties & WindRuleChanged) {
-        if (!decoder.decodeEnum(result.windRule))
+        if (!decoder.decode(result.windRule))
             return false;
     }
 
@@ -498,7 +498,7 @@ bool RemoteLayerTreeTransaction::LayerProperties::decode(IPC::Decoder& decoder,
     }
 
     if (result.changedProperties & CustomAppearanceChanged) {
-        if (!decoder.decodeEnum(result.customAppearance))
+        if (!decoder.decode(result.customAppearance))
             return false;
     }
 
index b69e375..398d9e8 100644 (file)
@@ -104,7 +104,7 @@ using namespace IPC;
 
 void ArgumentCoder<ScrollingStateNode>::encode(Encoder& encoder, const ScrollingStateNode& node)
 {
-    encoder.encodeEnum(node.nodeType());
+    encoder << node.nodeType();
     encoder << node.scrollingNodeID();
     encoder << node.parentNodeID();
     encoder << node.changedProperties();
@@ -137,7 +137,7 @@ bool ArgumentCoder<ScrollingStateNode>::decode(Decoder& decoder, ScrollingStateN
 
 #define SCROLLING_NODE_ENCODE_ENUM(property, getter) \
     if (node.hasChangedProperty(property)) \
-        encoder.encodeEnum(node.getter());
+        encoder << node.getter();
 
 void ArgumentCoder<ScrollingStateScrollingNode>::encode(Encoder& encoder, const ScrollingStateScrollingNode& node)
 {
@@ -231,7 +231,7 @@ void ArgumentCoder<ScrollingStateOverflowScrollProxyNode>::encode(Encoder& encod
 #define SCROLLING_NODE_DECODE_ENUM(property, type, setter) \
     if (node.hasChangedProperty(property)) { \
         type decodedValue; \
-        if (!decoder.decodeEnum(decodedValue)) \
+        if (!decoder.decode(decodedValue)) \
             return false; \
         node.setter(decodedValue); \
     }
@@ -446,8 +446,8 @@ bool ArgumentCoder<ScrollingStatePositionedNode>::decode(Decoder& decoder, Scrol
 void ArgumentCoder<RequestedScrollData>::encode(Encoder& encoder, const RequestedScrollData& scrollData)
 {
     encoder << scrollData.scrollPosition;
-    encoder.encodeEnum(scrollData.scrollType);
-    encoder.encodeEnum(scrollData.clamping);
+    encoder << scrollData.scrollType;
+    encoder << scrollData.clamping;
 }
 
 bool ArgumentCoder<RequestedScrollData>::decode(Decoder& decoder, RequestedScrollData& scrollData)
@@ -455,10 +455,10 @@ bool ArgumentCoder<RequestedScrollData>::decode(Decoder& decoder, RequestedScrol
     if (!decoder.decode(scrollData.scrollPosition))
         return false;
 
-    if (!decoder.decodeEnum(scrollData.scrollType))
+    if (!decoder.decode(scrollData.scrollType))
         return false;
 
-    if (!decoder.decodeEnum(scrollData.clamping))
+    if (!decoder.decode(scrollData.clamping))
         return false;
 
     return true;
@@ -547,7 +547,7 @@ bool RemoteScrollingCoordinatorTransaction::decode(IPC::Decoder& decoder)
 
     for (int i = 0; i < numNodes; ++i) {
         ScrollingNodeType nodeType;
-        if (!decoder.decodeEnum(nodeType))
+        if (!decoder.decode(nodeType))
             return false;
 
         ScrollingNodeID nodeID;
index 8218b3e..a7d23f5 100644 (file)
@@ -45,7 +45,7 @@ bool isValidEnum(WebCore::ShouldOpenExternalURLsPolicy policy)
 
 void HTTPBody::Element::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(type);
+    encoder << type;
     encoder << data;
     encoder << filePath;
     encoder << fileStart;
@@ -69,7 +69,7 @@ static bool isValidEnum(HTTPBody::Element::Type type)
 auto HTTPBody::Element::decode(IPC::Decoder& decoder) -> Optional<Element>
 {
     Element result;
-    if (!decoder.decodeEnum(result.type) || !isValidEnum(result.type))
+    if (!decoder.decode(result.type) || !isValidEnum(result.type))
         return WTF::nullopt;
     if (!decoder.decode(result.data))
         return WTF::nullopt;
@@ -194,7 +194,7 @@ void PageState::encode(IPC::Encoder& encoder) const
     if (sessionStateObject)
         encoder << sessionStateObject->toWireBytes();
 
-    encoder.encodeEnum(shouldOpenExternalURLsPolicy);
+    encoder << shouldOpenExternalURLsPolicy;
 }
 
 bool PageState::decode(IPC::Decoder& decoder, PageState& result)
@@ -219,7 +219,7 @@ bool PageState::decode(IPC::Decoder& decoder, PageState& result)
         result.sessionStateObject = SerializedScriptValue::createFromWireBytes(WTFMove(wireBytes));
     }
 
-    if (!decoder.decodeEnum(result.shouldOpenExternalURLsPolicy) || !isValidEnum(result.shouldOpenExternalURLsPolicy))
+    if (!decoder.decode(result.shouldOpenExternalURLsPolicy) || !isValidEnum(result.shouldOpenExternalURLsPolicy))
         return false;
 
     return true;
index 94a036f..3b2d34d 100644 (file)
@@ -51,7 +51,7 @@ TouchBarMenuItemData::TouchBarMenuItemData(const WebCore::HTMLMenuItemElement& e
 
 void TouchBarMenuItemData::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(type);
+    encoder << type;
     
     encoder << identifier;
     encoder << priority;
@@ -60,7 +60,7 @@ void TouchBarMenuItemData::encode(IPC::Encoder& encoder) const
 Optional<TouchBarMenuItemData> TouchBarMenuItemData::decode(IPC::Decoder& decoder)
 {
     TouchBarMenuItemData result;
-    if (!decoder.decodeEnum(result.type))
+    if (!decoder.decode(result.type))
         return WTF::nullopt;
     
     if (!decoder.decode(result.identifier))
index bdc7f0c..ce9ac54 100644 (file)
@@ -156,7 +156,7 @@ bool UserData::decode(IPC::Decoder& decoder, UserData& userData)
 void UserData::encode(IPC::Encoder& encoder, const API::Object* object)
 {
     if (!object) {
-        encoder.encodeEnum(API::Object::Type::Null);
+        encoder << API::Object::Type::Null;
         return;
     }
 
@@ -166,7 +166,7 @@ void UserData::encode(IPC::Encoder& encoder, const API::Object* object)
 void UserData::encode(IPC::Encoder& encoder, const API::Object& object)
 {
     API::Object::Type type = object.type();
-    encoder.encodeEnum(type);
+    encoder << type;
 
     switch (object.type()) {
     case API::Object::Type::Array: {
@@ -336,7 +336,7 @@ void UserData::encode(IPC::Encoder& encoder, const API::Object& object)
 bool UserData::decode(IPC::Decoder& decoder, RefPtr<API::Object>& result)
 {
     API::Object::Type type;
-    if (!decoder.decodeEnum(type))
+    if (!decoder.decode(type))
         return false;
 
     switch (type) {
index 17dc4ce..8946c35 100644 (file)
@@ -100,8 +100,8 @@ void WebContextMenuItemData::setUserData(API::Object* userData)
     
 void WebContextMenuItemData::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(m_type);
-    encoder.encodeEnum(m_action);
+    encoder << m_type;
+    encoder << m_action;
     encoder << m_title;
     encoder << m_checked;
     encoder << m_enabled;
@@ -111,11 +111,11 @@ void WebContextMenuItemData::encode(IPC::Encoder& encoder) const
 Optional<WebContextMenuItemData> WebContextMenuItemData::decode(IPC::Decoder& decoder)
 {
     WebCore::ContextMenuItemType type;
-    if (!decoder.decodeEnum(type))
+    if (!decoder.decode(type))
         return WTF::nullopt;
 
     WebCore::ContextMenuAction action;
-    if (!decoder.decodeEnum(action))
+    if (!decoder.decode(action))
         return WTF::nullopt;
 
     String title;
index 21f27cd..5447fca 100644 (file)
@@ -492,7 +492,7 @@ bool ArgumentCoder<TransformationMatrix>::decode(Decoder& decoder, Transformatio
 
 void ArgumentCoder<LinearTimingFunction>::encode(Encoder& encoder, const LinearTimingFunction& timingFunction)
 {
-    encoder.encodeEnum(timingFunction.type());
+    encoder << timingFunction.type();
 }
 
 bool ArgumentCoder<LinearTimingFunction>::decode(Decoder&, LinearTimingFunction&)
@@ -503,14 +503,14 @@ bool ArgumentCoder<LinearTimingFunction>::decode(Decoder&, LinearTimingFunction&
 
 void ArgumentCoder<CubicBezierTimingFunction>::encode(Encoder& encoder, const CubicBezierTimingFunction& timingFunction)
 {
-    encoder.encodeEnum(timingFunction.type());
+    encoder << timingFunction.type();
     
     encoder << timingFunction.x1();
     encoder << timingFunction.y1();
     encoder << timingFunction.x2();
     encoder << timingFunction.y2();
     
-    encoder.encodeEnum(timingFunction.timingFunctionPreset());
+    encoder << timingFunction.timingFunctionPreset();
 }
 
 bool ArgumentCoder<CubicBezierTimingFunction>::decode(Decoder& decoder, CubicBezierTimingFunction& timingFunction)
@@ -533,7 +533,7 @@ bool ArgumentCoder<CubicBezierTimingFunction>::decode(Decoder& decoder, CubicBez
         return false;
 
     CubicBezierTimingFunction::TimingFunctionPreset preset;
-    if (!decoder.decodeEnum(preset))
+    if (!decoder.decode(preset))
         return false;
 
     timingFunction.setValues(x1, y1, x2, y2);
@@ -544,7 +544,7 @@ bool ArgumentCoder<CubicBezierTimingFunction>::decode(Decoder& decoder, CubicBez
 
 void ArgumentCoder<StepsTimingFunction>::encode(Encoder& encoder, const StepsTimingFunction& timingFunction)
 {
-    encoder.encodeEnum(timingFunction.type());
+    encoder << timingFunction.type();
     
     encoder << timingFunction.numberOfSteps();
     encoder << timingFunction.stepPosition();
@@ -569,7 +569,7 @@ bool ArgumentCoder<StepsTimingFunction>::decode(Decoder& decoder, StepsTimingFun
 
 void ArgumentCoder<SpringTimingFunction>::encode(Encoder& encoder, const SpringTimingFunction& timingFunction)
 {
-    encoder.encodeEnum(timingFunction.type());
+    encoder << timingFunction.type();
     
     encoder << timingFunction.mass();
     encoder << timingFunction.stiffness();
@@ -889,7 +889,7 @@ void ArgumentCoder<PluginInfo>::encode(Encoder& encoder, const PluginInfo& plugi
     encoder << pluginInfo.desc;
     encoder << pluginInfo.mimes;
     encoder << pluginInfo.isApplicationPlugin;
-    encoder.encodeEnum(pluginInfo.clientLoadPolicy);
+    encoder << pluginInfo.clientLoadPolicy;
     encoder << pluginInfo.bundleIdentifier;
 #if PLATFORM(MAC)
     encoder << pluginInfo.versionString;
@@ -909,7 +909,7 @@ Optional<WebCore::PluginInfo> ArgumentCoder<PluginInfo>::decode(Decoder& decoder
         return WTF::nullopt;
     if (!decoder.decode(pluginInfo.isApplicationPlugin))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(pluginInfo.clientLoadPolicy))
+    if (!decoder.decode(pluginInfo.clientLoadPolicy))
         return WTF::nullopt;
     if (!decoder.decode(pluginInfo.bundleIdentifier))
         return WTF::nullopt;
@@ -963,8 +963,8 @@ void ArgumentCoder<ProtectionSpace>::encode(Encoder& encoder, const ProtectionSp
 
     encoder << false;
     encoder << space.host() << space.port() << space.realm();
-    encoder.encodeEnum(space.authenticationScheme());
-    encoder.encodeEnum(space.serverType());
+    encoder << space.authenticationScheme();
+    encoder << space.serverType();
 }
 
 bool ArgumentCoder<ProtectionSpace>::decode(Decoder& decoder, ProtectionSpace& space)
@@ -989,11 +989,11 @@ bool ArgumentCoder<ProtectionSpace>::decode(Decoder& decoder, ProtectionSpace& s
         return false;
     
     ProtectionSpaceAuthenticationScheme authenticationScheme;
-    if (!decoder.decodeEnum(authenticationScheme))
+    if (!decoder.decode(authenticationScheme))
         return false;
 
     ProtectionSpaceServerType serverType;
-    if (!decoder.decodeEnum(serverType))
+    if (!decoder.decode(serverType))
         return false;
 
     space = ProtectionSpace(host, port, serverType, realm, authenticationScheme);
@@ -1010,7 +1010,7 @@ void ArgumentCoder<Credential>::encode(Encoder& encoder, const Credential& crede
 
     encoder << false;
     encoder << credential.user() << credential.password();
-    encoder.encodeEnum(credential.persistence());
+    encoder << credential.persistence();
 }
 
 bool ArgumentCoder<Credential>::decode(Decoder& decoder, Credential& credential)
@@ -1031,7 +1031,7 @@ bool ArgumentCoder<Credential>::decode(Decoder& decoder, Credential& credential)
         return false;
 
     CredentialPersistence persistence;
-    if (!decoder.decodeEnum(persistence))
+    if (!decoder.decode(persistence))
         return false;
     
     credential = Credential(user, password, persistence);
@@ -1252,7 +1252,7 @@ bool ArgumentCoder<FontHandle>::decode(Decoder& decoder, FontHandle& handle)
 
 void ArgumentCoder<Cursor>::encode(Encoder& encoder, const Cursor& cursor)
 {
-    encoder.encodeEnum(cursor.type());
+    encoder << cursor.type();
         
     if (cursor.type() != Cursor::Custom)
         return;
@@ -1273,7 +1273,7 @@ void ArgumentCoder<Cursor>::encode(Encoder& encoder, const Cursor& cursor)
 bool ArgumentCoder<Cursor>::decode(Decoder& decoder, Cursor& cursor)
 {
     Cursor::Type type;
-    if (!decoder.decodeEnum(type))
+    if (!decoder.decode(type))
         return false;
 
     if (type > Cursor::Custom)
@@ -1379,7 +1379,7 @@ bool ArgumentCoder<ResourceRequest>::decode(Decoder& decoder, ResourceRequest& r
 
 void ArgumentCoder<ResourceError>::encode(Encoder& encoder, const ResourceError& resourceError)
 {
-    encoder.encodeEnum(resourceError.type());
+    encoder << resourceError.type();
     if (resourceError.type() == ResourceError::Type::Null)
         return;
     encodePlatformData(encoder, resourceError);
@@ -1388,7 +1388,7 @@ void ArgumentCoder<ResourceError>::encode(Encoder& encoder, const ResourceError&
 bool ArgumentCoder<ResourceError>::decode(Decoder& decoder, ResourceError& resourceError)
 {
     ResourceError::Type type;
-    if (!decoder.decodeEnum(type))
+    if (!decoder.decode(type))
         return false;
 
     if (type == ResourceError::Type::Null) {
@@ -1532,7 +1532,7 @@ void ArgumentCoder<DragData>::encode(Encoder& encoder, const DragData& dragData)
     encoder << dragData.clientPosition();
     encoder << dragData.globalPosition();
     encoder << dragData.draggingSourceOperationMask();
-    encoder.encodeEnum(dragData.flags());
+    encoder << dragData.flags();
 #if PLATFORM(COCOA)
     encoder << dragData.pasteboardName();
     encoder << dragData.fileNames();
@@ -1555,7 +1555,7 @@ bool ArgumentCoder<DragData>::decode(Decoder& decoder, DragData& dragData)
         return false;
 
     DragApplicationFlags applicationFlags;
-    if (!decoder.decodeEnum(applicationFlags))
+    if (!decoder.decode(applicationFlags))
         return false;
 
     String pasteboardName;
@@ -1584,7 +1584,7 @@ void ArgumentCoder<CompositionUnderline>::encode(Encoder& encoder, const Composi
     encoder << underline.startOffset;
     encoder << underline.endOffset;
     encoder << underline.thick;
-    encoder.encodeEnum(underline.compositionUnderlineColor);
+    encoder << underline.compositionUnderlineColor;
     encoder << underline.color;
 }
 
@@ -1598,7 +1598,7 @@ Optional<CompositionUnderline> ArgumentCoder<CompositionUnderline>::decode(Decod
         return WTF::nullopt;
     if (!decoder.decode(underline.thick))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(underline.compositionUnderlineColor))
+    if (!decoder.decode(underline.compositionUnderlineColor))
         return WTF::nullopt;
     if (!decoder.decode(underline.color))
         return WTF::nullopt;
@@ -1912,7 +1912,7 @@ void ArgumentCoder<FileChooserSettings>::encode(Encoder& encoder, const FileChoo
     encoder << settings.acceptFileExtensions;
     encoder << settings.selectedFiles;
 #if ENABLE(MEDIA_CAPTURE)
-    encoder.encodeEnum(settings.mediaCaptureType);
+    encoder << settings.mediaCaptureType;
 #endif
 }
 
@@ -1929,7 +1929,7 @@ bool ArgumentCoder<FileChooserSettings>::decode(Decoder& decoder, FileChooserSet
     if (!decoder.decode(settings.selectedFiles))
         return false;
 #if ENABLE(MEDIA_CAPTURE)
-    if (!decoder.decodeEnum(settings.mediaCaptureType))
+    if (!decoder.decode(settings.mediaCaptureType))
         return false;
 #endif
 
@@ -2019,7 +2019,7 @@ void ArgumentCoder<TextCheckingRequestData>::encode(Encoder& encoder, const Text
     encoder << request.identifier();
     encoder << request.text();
     encoder << request.checkingTypes();
-    encoder.encodeEnum(request.processType());
+    encoder << request.processType();
 }
 
 bool ArgumentCoder<TextCheckingRequestData>::decode(Decoder& decoder, TextCheckingRequestData& request)
@@ -2037,7 +2037,7 @@ bool ArgumentCoder<TextCheckingRequestData>::decode(Decoder& decoder, TextChecki
         return false;
 
     TextCheckingProcessType processType;
-    if (!decoder.decodeEnum(processType))
+    if (!decoder.decode(processType))
         return false;
 
     request = TextCheckingRequestData { identifier, text, checkingTypes, processType };
@@ -2046,7 +2046,7 @@ bool ArgumentCoder<TextCheckingRequestData>::decode(Decoder& decoder, TextChecki
 
 void ArgumentCoder<TextCheckingResult>::encode(Encoder& encoder, const TextCheckingResult& result)
 {
-    encoder.encodeEnum(result.type);
+    encoder << result.type;
     encoder << result.range;
     encoder << result.details;
     encoder << result.replacement;
@@ -2055,7 +2055,7 @@ void ArgumentCoder<TextCheckingResult>::encode(Encoder& encoder, const TextCheck
 Optional<TextCheckingResult> ArgumentCoder<TextCheckingResult>::decode(Decoder& decoder)
 {
     TextCheckingType type;
-    if (!decoder.decodeEnum(type))
+    if (!decoder.decode(type))
         return WTF::nullopt;
     
     Optional<CharacterRange> range;
@@ -2082,8 +2082,8 @@ void ArgumentCoder<UserStyleSheet>::encode(Encoder& encoder, const UserStyleShee
     encoder << userStyleSheet.url();
     encoder << userStyleSheet.allowlist();
     encoder << userStyleSheet.blocklist();
-    encoder.encodeEnum(userStyleSheet.injectedFrames());
-    encoder.encodeEnum(userStyleSheet.level());
+    encoder << userStyleSheet.injectedFrames();
+    encoder << userStyleSheet.level();
     encoder << userStyleSheet.pageID();
 }
 
@@ -2106,11 +2106,11 @@ bool ArgumentCoder<UserStyleSheet>::decode(Decoder& decoder, UserStyleSheet& use
         return false;
 
     UserContentInjectedFrames injectedFrames;
-    if (!decoder.decodeEnum(injectedFrames))
+    if (!decoder.decode(injectedFrames))
         return false;
 
     UserStyleLevel level;
-    if (!decoder.decodeEnum(level))
+    if (!decoder.decode(level))
         return false;
 
     Optional<Optional<PageIdentifier>> pageID;
@@ -2150,11 +2150,11 @@ bool ArgumentCoder<MediaSessionMetadata>::decode(Decoder& decoder, MediaSessionM
 
 void ArgumentCoder<ScrollableAreaParameters>::encode(Encoder& encoder, const ScrollableAreaParameters& parameters)
 {
-    encoder.encodeEnum(parameters.horizontalScrollElasticity);
-    encoder.encodeEnum(parameters.verticalScrollElasticity);
+    encoder << parameters.horizontalScrollElasticity;
+    encoder << parameters.verticalScrollElasticity;
 
-    encoder.encodeEnum(parameters.horizontalScrollbarMode);
-    encoder.encodeEnum(parameters.verticalScrollbarMode);
+    encoder << parameters.horizontalScrollbarMode;
+    encoder << parameters.verticalScrollbarMode;
 
     encoder << parameters.hasEnabledHorizontalScrollbar;
     encoder << parameters.hasEnabledVerticalScrollbar;
@@ -2167,14 +2167,14 @@ void ArgumentCoder<ScrollableAreaParameters>::encode(Encoder& encoder, const Scr
 
 bool ArgumentCoder<ScrollableAreaParameters>::decode(Decoder& decoder, ScrollableAreaParameters& params)
 {
-    if (!decoder.decodeEnum(params.horizontalScrollElasticity))
+    if (!decoder.decode(params.horizontalScrollElasticity))
         return false;
-    if (!decoder.decodeEnum(params.verticalScrollElasticity))
+    if (!decoder.decode(params.verticalScrollElasticity))
         return false;
 
-    if (!decoder.decodeEnum(params.horizontalScrollbarMode))
+    if (!decoder.decode(params.horizontalScrollbarMode))
         return false;
-    if (!decoder.decodeEnum(params.verticalScrollbarMode))
+    if (!decoder.decode(params.verticalScrollbarMode))
         return false;
 
     if (!decoder.decode(params.hasEnabledHorizontalScrollbar))
@@ -2338,7 +2338,7 @@ bool ArgumentCoder<StickyPositionViewportConstraints>::decode(Decoder& decoder,
 #if !USE(COORDINATED_GRAPHICS)
 void ArgumentCoder<FilterOperation>::encode(Encoder& encoder, const FilterOperation& filter)
 {
-    encoder.encodeEnum(filter.type());
+    encoder << filter.type();
 
     switch (filter.type()) {
     case FilterOperation::NONE:
@@ -2371,7 +2371,7 @@ void ArgumentCoder<FilterOperation>::encode(Encoder& encoder, const FilterOperat
         break;
     }
     case FilterOperation::DEFAULT:
-        encoder.encodeEnum(downcast<DefaultFilterOperation>(filter).representedType());
+        encoder << downcast<DefaultFilterOperation>(filter).representedType();
         break;
     case FilterOperation::PASSTHROUGH:
         break;
@@ -2381,7 +2381,7 @@ void ArgumentCoder<FilterOperation>::encode(Encoder& encoder, const FilterOperat
 bool decodeFilterOperation(Decoder& decoder, RefPtr<FilterOperation>& filter)
 {
     FilterOperation::OperationType type;
-    if (!decoder.decodeEnum(type))
+    if (!decoder.decode(type))
         return false;
 
     switch (type) {
@@ -2435,7 +2435,7 @@ bool decodeFilterOperation(Decoder& decoder, RefPtr<FilterOperation>& filter)
     }
     case FilterOperation::DEFAULT: {
         FilterOperation::OperationType representedType;
-        if (!decoder.decodeEnum(representedType))
+        if (!decoder.decode(representedType))
             return false;
         filter = DefaultFilterOperation::create(representedType);
         break;
@@ -3060,8 +3060,8 @@ bool ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::decode(Decoder& decoder, Vec
 void ArgumentCoder<FontAttributes>::encode(Encoder& encoder, const FontAttributes& attributes)
 {
     encoder << attributes.backgroundColor << attributes.foregroundColor << attributes.fontShadow << attributes.hasUnderline << attributes.hasStrikeThrough << attributes.textLists;
-    encoder.encodeEnum(attributes.horizontalAlignment);
-    encoder.encodeEnum(attributes.subscriptOrSuperscript);
+    encoder << attributes.horizontalAlignment;
+    encoder << attributes.subscriptOrSuperscript;
 
     if (attributes.encodingRequiresPlatformData()) {
         encoder << true;
@@ -3092,10 +3092,10 @@ Optional<FontAttributes> ArgumentCoder<FontAttributes>::decode(Decoder& decoder)
     if (!decoder.decode(attributes.textLists))
         return WTF::nullopt;
 
-    if (!decoder.decodeEnum(attributes.horizontalAlignment))
+    if (!decoder.decode(attributes.horizontalAlignment))
         return WTF::nullopt;
 
-    if (!decoder.decodeEnum(attributes.subscriptOrSuperscript))
+    if (!decoder.decode(attributes.subscriptOrSuperscript))
         return WTF::nullopt;
 
     bool hasPlatformData;
@@ -3139,7 +3139,7 @@ void ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode(Encoder& enc
     bool hasPlatformData = value.encodingRequiresPlatformData();
     encoder << hasPlatformData;
 
-    encoder.encodeEnum(value.platformType());
+    encoder << value.platformType();
     if (hasPlatformData)
         encodePlatformData(encoder, value);
 }
@@ -3151,7 +3151,7 @@ Optional<SerializedPlatformDataCueValue> ArgumentCoder<WebCore::SerializedPlatfo
         return WTF::nullopt;
 
     WebCore::SerializedPlatformDataCueValue::PlatformType type;
-    if (!decoder.decodeEnum(type))
+    if (!decoder.decode(type))
         return WTF::nullopt;
 
     if (hasPlatformData)
index 23f88fa..e18736f 100644 (file)
@@ -36,7 +36,7 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << activityState;
 
     encoder << store;
-    encoder.encodeEnum(drawingAreaType);
+    encoder << drawingAreaType;
     encoder << drawingAreaIdentifier;
     encoder << webPageProxyIdentifier;
     encoder << pageGroupData;
@@ -47,7 +47,7 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << viewExposedRect;
     encoder << alwaysShowsHorizontalScroller;
     encoder << alwaysShowsVerticalScroller;
-    encoder.encodeEnum(paginationMode);
+    encoder << paginationMode;
     encoder << paginationBehavesLikeColumns;
     encoder << pageLength;
     encoder << gapBetweenPages;
@@ -71,10 +71,10 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << sizeToContentAutoSizeMaximumSize;
     encoder << autoSizingShouldExpandToViewHeight;
     encoder << viewportSizeForCSSViewportUnits;
-    encoder.encodeEnum(scrollPinningBehavior);
+    encoder << scrollPinningBehavior;
     encoder << scrollbarOverlayStyle;
     encoder << backgroundExtendsBeyondPage;
-    encoder.encodeEnum(layerHostingMode);
+    encoder << layerHostingMode;
     encoder << mimeTypesWithCustomContentProviders;
     encoder << controlledByAutomation;
     encoder << isProcessSwap;
@@ -125,7 +125,7 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << appleMailPaginationQuirkEnabled;
     encoder << appleMailLinesClampEnabled;
     encoder << shouldScaleViewToFitDocument;
-    encoder.encodeEnum(userInterfaceLayoutDirection);
+    encoder << userInterfaceLayoutDirection;
     encoder << observedLayoutMilestones;
     encoder << overrideContentSecurityPolicy;
     encoder << cpuLimit;
@@ -172,7 +172,7 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
         return WTF::nullopt;
     if (!decoder.decode(parameters.store))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(parameters.drawingAreaType))
+    if (!decoder.decode(parameters.drawingAreaType))
         return WTF::nullopt;
     Optional<DrawingAreaIdentifier> drawingAreaIdentifier;
     decoder >> drawingAreaIdentifier;
@@ -203,7 +203,7 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
         return WTF::nullopt;
     if (!decoder.decode(parameters.alwaysShowsVerticalScroller))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(parameters.paginationMode))
+    if (!decoder.decode(parameters.paginationMode))
         return WTF::nullopt;
     if (!decoder.decode(parameters.paginationBehavesLikeColumns))
         return WTF::nullopt;
@@ -264,7 +264,7 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
         return WTF::nullopt;
     if (!decoder.decode(parameters.viewportSizeForCSSViewportUnits))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(parameters.scrollPinningBehavior))
+    if (!decoder.decode(parameters.scrollPinningBehavior))
         return WTF::nullopt;
 
     Optional<Optional<uint32_t>> scrollbarOverlayStyle;
@@ -275,7 +275,7 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
 
     if (!decoder.decode(parameters.backgroundExtendsBeyondPage))
         return WTF::nullopt;
-    if (!decoder.decodeEnum(parameters.layerHostingMode))
+    if (!decoder.decode(parameters.layerHostingMode))
         return WTF::nullopt;
     if (!decoder.decode(parameters.mimeTypesWithCustomContentProviders))
         return WTF::nullopt;
@@ -383,7 +383,7 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
     if (!decoder.decode(parameters.shouldScaleViewToFitDocument))
         return WTF::nullopt;
 
-    if (!decoder.decodeEnum(parameters.userInterfaceLayoutDirection))
+    if (!decoder.decode(parameters.userInterfaceLayoutDirection))
         return WTF::nullopt;
     if (!decoder.decode(parameters.observedLayoutMilestones))
         return WTF::nullopt;
index c5d0ca8..6fb7a5c 100644 (file)
@@ -65,9 +65,9 @@ WebPopupItem::WebPopupItem(Type type, const String& text, WebCore::TextDirection
 
 void WebPopupItem::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(m_type);
+    encoder << m_type;
     encoder << m_text;
-    encoder.encodeEnum(m_textDirection);
+    encoder << m_textDirection;
     encoder << m_hasTextDirectionOverride;
     encoder << m_toolTip;
     encoder << m_accessibilityText;
@@ -79,7 +79,7 @@ void WebPopupItem::encode(IPC::Encoder& encoder) const
 Optional<WebPopupItem> WebPopupItem::decode(IPC::Decoder& decoder)
 {
     Type type;
-    if (!decoder.decodeEnum(type))
+    if (!decoder.decode(type))
         return WTF::nullopt;
 
     String text;
@@ -87,7 +87,7 @@ Optional<WebPopupItem> WebPopupItem::decode(IPC::Decoder& decoder)
         return WTF::nullopt;
     
     WebCore::TextDirection textDirection;
-    if (!decoder.decodeEnum(textDirection))
+    if (!decoder.decode(textDirection))
         return WTF::nullopt;
 
     bool hasTextDirectionOverride;
index ea64d6a..c009578 100644 (file)
@@ -72,7 +72,7 @@ void WebProcessCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << urlSchemesRegisteredAsAlwaysRevalidated;
     encoder << urlSchemesRegisteredAsCachePartitioned;
     encoder << urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest;
-    encoder.encodeEnum(cacheModel);
+    encoder << cacheModel;
     encoder << shouldAlwaysUseComplexTextCodePath;
     encoder << shouldEnableMemoryPressureReliefLogging;
     encoder << shouldSuppressMemoryPressureHandler;
@@ -270,7 +270,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat
         return false;
     if (!decoder.decode(parameters.urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest))
         return false;
-    if (!decoder.decodeEnum(parameters.cacheModel))
+    if (!decoder.decode(parameters.cacheModel))
         return false;
     if (!decoder.decode(parameters.shouldAlwaysUseComplexTextCodePath))
         return false;
index ef064bf..bab9e67 100644 (file)
@@ -36,7 +36,7 @@ namespace WebKit {
 void WebsiteData::Entry::encode(IPC::Encoder& encoder) const
 {
     encoder << origin;
-    encoder.encodeEnum(type);
+    encoder << type;
     encoder << size;
 }
 
@@ -50,7 +50,7 @@ auto WebsiteData::Entry::decode(IPC::Decoder& decoder) -> Optional<Entry>
         return WTF::nullopt;
     result.origin = WTFMove(*securityOriginData);
 
-    if (!decoder.decodeEnum(result.type))
+    if (!decoder.decode(result.type))
         return WTF::nullopt;
 
     if (!decoder.decode(result.size))
index b7b088f..89f6e61 100644 (file)
@@ -87,7 +87,7 @@ bool ArgumentCoder<CertificateInfo>::decode(Decoder& decoder, CertificateInfo& c
 
 void ArgumentCoder<ResourceError>::encodePlatformData(Encoder& encoder, const ResourceError& resourceError)
 {
-    encoder.encodeEnum(resourceError.type());
+    encoder << resourceError.type();
     if (resourceError.isNull())
         return;
 
@@ -101,7 +101,7 @@ void ArgumentCoder<ResourceError>::encodePlatformData(Encoder& encoder, const Re
 bool ArgumentCoder<ResourceError>::decodePlatformData(Decoder& decoder, ResourceError& resourceError)
 {
     ResourceErrorBase::Type errorType;
-    if (!decoder.decodeEnum(errorType))
+    if (!decoder.decode(errorType))
         return false;
     if (errorType == ResourceErrorBase::Type::Null) {
         resourceError = { };
@@ -137,8 +137,8 @@ bool ArgumentCoder<ResourceError>::decodePlatformData(Decoder& decoder, Resource
 void ArgumentCoder<ProtectionSpace>::encodePlatformData(Encoder& encoder, const ProtectionSpace& space)
 {
     encoder << space.host() << space.port() << space.realm();
-    encoder.encodeEnum(space.authenticationScheme());
-    encoder.encodeEnum(space.serverType());
+    encoder << space.authenticationScheme();
+    encoder << space.serverType();
     encoder << space.certificateInfo();
 }
 
@@ -157,11 +157,11 @@ bool ArgumentCoder<ProtectionSpace>::decodePlatformData(Decoder& decoder, Protec
         return false;
 
     ProtectionSpaceAuthenticationScheme authenticationScheme;
-    if (!decoder.decodeEnum(authenticationScheme))
+    if (!decoder.decode(authenticationScheme))
         return false;
 
     ProtectionSpaceServerType serverType;
-    if (!decoder.decodeEnum(serverType))
+    if (!decoder.decode(serverType))
         return false;
 
     CertificateInfo certificateInfo;
index a964055..12c83bf 100644 (file)
@@ -105,14 +105,14 @@ void InputMethodState::addHintsForAutocapitalizeType(WebCore::AutocapitalizeType
 
 void InputMethodState::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(purpose);
+    encoder << purpose;
     encoder << hints;
 }
 
 Optional<InputMethodState> InputMethodState::decode(IPC::Decoder& decoder)
 {
     InputMethodState state;
-    if (!decoder.decodeEnum(state.purpose))
+    if (!decoder.decode(state.purpose))
         return WTF::nullopt;
     if (!decoder.decode(state.hints))
         return WTF::nullopt;
index dc89e2d..ccfe3a2 100644 (file)
@@ -35,7 +35,7 @@ namespace WebKit {
 
 void UserMessage::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(type);
+    encoder << type;
     if (type == Type::Null)
         return;
 
@@ -59,7 +59,7 @@ void UserMessage::encode(IPC::Encoder& encoder) const
 Optional<UserMessage> UserMessage::decode(IPC::Decoder& decoder)
 {
     UserMessage result;
-    if (!decoder.decodeEnum(result.type))
+    if (!decoder.decode(result.type))
         return WTF::nullopt;
 
     if (result.type == Type::Null)
index e757168..e7b25bf 100644 (file)
@@ -44,27 +44,27 @@ void ColorSpaceData::encode(IPC::Encoder& encoder) const
     if (cgColorSpace) {
         // Try to encode the name.
         if (RetainPtr<CFStringRef> name = adoptCF(CGColorSpaceCopyName(cgColorSpace.get()))) {
-            encoder.encodeEnum(Name);
+            encoder << Name;
             IPC::encode(encoder, name.get());
             return;
         }
 
         // Failing that, just encode the ICC data.
         if (RetainPtr<CFDataRef> profileData = adoptCF(CGColorSpaceCopyICCData(cgColorSpace.get()))) {
-            encoder.encodeEnum(Data);
+            encoder << Data;
             IPC::encode(encoder, profileData.get());
             return;
         }
     }
 
     // The color space was null or failed to be encoded.
-    encoder.encodeEnum(Null);
+    encoder << Null;
 }
 
 bool ColorSpaceData::decode(IPC::Decoder& decoder, ColorSpaceData& colorSpaceData)
 {
     EncodedDataType dataType;
-    if (!decoder.decodeEnum(dataType))
+    if (!decoder.decode(dataType))
         return false;
 
     switch (dataType) {
index acd56f0..09f4b43 100644 (file)
@@ -46,7 +46,7 @@ SecItemRequestData::SecItemRequestData(Type type, CFDictionaryRef query, CFDicti
 
 void SecItemRequestData::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(m_type);
+    encoder << m_type;
 
     encoder << static_cast<bool>(m_queryDictionary);
     if (m_queryDictionary)
@@ -59,7 +59,7 @@ void SecItemRequestData::encode(IPC::Encoder& encoder) const
 
 bool SecItemRequestData::decode(IPC::Decoder& decoder, SecItemRequestData& secItemRequestData)
 {
-    if (!decoder.decodeEnum(secItemRequestData.m_type))
+    if (!decoder.decode(secItemRequestData.m_type))
         return false;
 
     bool expectQuery;
index 6c43ab5..2133938 100644 (file)
@@ -212,8 +212,8 @@ void ArgumentCoder<WebCore::ResourceRequest>::encodePlatformData(Encoder& encode
 
     // The fallback array is part of NSURLRequest, but it is not encoded by WKNSURLRequestCreateSerializableRepresentation.
     encoder << resourceRequest.responseContentDispositionEncodingFallbackArray();
-    encoder.encodeEnum(resourceRequest.requester());
-    encoder.encodeEnum(resourceRequest.cachePolicy());
+    encoder << resourceRequest.requester();
+    encoder << resourceRequest.cachePolicy();
 }
 
 bool ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData(Decoder& decoder, WebCore::ResourceRequest& resourceRequest)
@@ -248,12 +248,12 @@ bool ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData(Decoder& decode
     );
 
     WebCore::ResourceRequest::Requester requester;
-    if (!decoder.decodeEnum(requester))
+    if (!decoder.decode(requester))
         return false;
     resourceRequest.setRequester(requester);
 
     WebCore::ResourceRequestCachePolicy cachePolicy;
-    if (!decoder.decodeEnum(cachePolicy))
+    if (!decoder.decode(cachePolicy))
         return false;
     resourceRequest.setCachePolicy(cachePolicy);
 
@@ -262,7 +262,7 @@ bool ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData(Decoder& decode
 
 void ArgumentCoder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
 {
-    encoder.encodeEnum(certificateInfo.type());
+    encoder << certificateInfo.type();
 
     switch (certificateInfo.type()) {
 #if HAVE(SEC_TRUST_SERIALIZATION)
@@ -282,7 +282,7 @@ void ArgumentCoder<WebCore::CertificateInfo>::encode(Encoder& encoder, const Web
 bool ArgumentCoder<WebCore::CertificateInfo>::decode(Decoder& decoder, WebCore::CertificateInfo& certificateInfo)
 {
     WebCore::CertificateInfo::Type certificateInfoType;
-    if (!decoder.decodeEnum(certificateInfoType))
+    if (!decoder.decode(certificateInfoType))
         return false;
 
     switch (certificateInfoType) {
index 9b6037f..f8211bb 100644 (file)
@@ -162,7 +162,7 @@ bool ArgumentCoder<ResourceError>::decodePlatformData(Decoder& decoder, Resource
 void ArgumentCoder<SoupNetworkProxySettings>::encode(Encoder& encoder, const SoupNetworkProxySettings& settings)
 {
     ASSERT(!settings.isEmpty());
-    encoder.encodeEnum(settings.mode);
+    encoder << settings.mode;
     if (settings.mode != SoupNetworkProxySettings::Mode::Custom)
         return;
 
@@ -178,7 +178,7 @@ void ArgumentCoder<SoupNetworkProxySettings>::encode(Encoder& encoder, const Sou
 
 bool ArgumentCoder<SoupNetworkProxySettings>::decode(Decoder& decoder, SoupNetworkProxySettings& settings)
 {
-    if (!decoder.decodeEnum(settings.mode))
+    if (!decoder.decode(settings.mode))
         return false;
 
     if (settings.mode != SoupNetworkProxySettings::Mode::Custom)
index 70b2356..2c91ea9 100644 (file)
@@ -79,10 +79,10 @@ struct RemoteMediaPlayerState {
         encoder << languageOfPrimaryAudioTrack;
         encoder << wirelessPlaybackTargetName;
         encoder << bufferedRanges;
-        encoder.encodeEnum(networkState);
-        encoder.encodeEnum(readyState);
-        encoder.encodeEnum(movieLoadType);
-        encoder.encodeEnum(wirelessPlaybackTargetType);
+        encoder << networkState;
+        encoder << readyState;
+        encoder << movieLoadType;
+        encoder << wirelessPlaybackTargetType;
         encoder << naturalSize;
         encoder << maxFastForwardRate;
         encoder << minFastReverseRate;
@@ -152,19 +152,19 @@ struct RemoteMediaPlayerState {
             return WTF::nullopt;
 
         WebCore::MediaPlayerEnums::NetworkState networkState;
-        if (!decoder.decodeEnum(networkState))
+        if (!decoder.decode(networkState))
             return WTF::nullopt;
 
         WebCore::MediaPlayerEnums::ReadyState readyState;
-        if (!decoder.decodeEnum(readyState))
+        if (!decoder.decode(readyState))
             return WTF::nullopt;
 
         WebCore::MediaPlayerEnums::MovieLoadType movieLoadType;
-        if (!decoder.decodeEnum(movieLoadType))
+        if (!decoder.decode(movieLoadType))
             return WTF::nullopt;
 
         WebCore::MediaPlayerEnums::WirelessPlaybackTargetType wirelessPlaybackTargetType;
-        if (!decoder.decodeEnum(wirelessPlaybackTargetType))
+        if (!decoder.decode(wirelessPlaybackTargetType))
             return WTF::nullopt;
 
         Optional<WebCore::FloatSize> naturalSize;
index bbf9b69..8350dba 100644 (file)
@@ -74,7 +74,7 @@ struct NetworkProcessConnectionInfo {
     {
         if (!decoder.decode(info.connection))
             return false;
-        if (!decoder.decodeEnum(info.cookieAcceptPolicy))
+        if (!decoder.decode(info.cookieAcceptPolicy))
             return false;
 #if HAVE(AUDIT_TOKEN)
         if (!decoder.decode(info.auditToken))
index d602b6d..474787e 100644 (file)
@@ -47,7 +47,7 @@ void Plugin::Parameters::encode(IPC::Encoder& encoder) const
     encoder << isFullFramePlugin;
     encoder << shouldUseManualLoader;
 #if PLATFORM(COCOA)
-    encoder.encodeEnum(layerHostingMode);
+    encoder << layerHostingMode;
 #endif
 }
 
@@ -69,7 +69,7 @@ bool Plugin::Parameters::decode(IPC::Decoder& decoder, Parameters& parameters)
     if (!decoder.decode(parameters.shouldUseManualLoader))
         return false;
 #if PLATFORM(COCOA)
-    if (!decoder.decodeEnum(parameters.layerHostingMode))
+    if (!decoder.decode(parameters.layerHostingMode))
         return false;
 #endif
     if (parameters.names.size() != parameters.values.size()) {
index 45bb597..b7702c2 100644 (file)
@@ -100,7 +100,7 @@ using namespace WebCore;
 
 void PlatformCAAnimationRemote::KeyframeValue::encode(IPC::Encoder& encoder) const
 {
-    encoder.encodeEnum(keyType);
+    encoder << keyType;
 
     switch (keyType) {
     case NumberKeyType:
@@ -124,7 +124,7 @@ void PlatformCAAnimationRemote::KeyframeValue::encode(IPC::Encoder& encoder) con
 Optional<PlatformCAAnimationRemote::KeyframeValue> PlatformCAAnimationRemote::KeyframeValue::decode(IPC::Decoder& decoder)
 {
     PlatformCAAnimationRemote::KeyframeValue value;
-    if (!decoder.decodeEnum(value.keyType))
+    if (!decoder.decode(value.keyType))
         return WTF::nullopt;
 
     switch (value.keyType) {
@@ -156,7 +156,7 @@ Optional<PlatformCAAnimationRemote::KeyframeValue> PlatformCAAnimationRemote::Ke
 void PlatformCAAnimationRemote::Properties::encode(IPC::Encoder& encoder) const
 {
     encoder << keyPath;
-    encoder.encodeEnum(animationType);
+    encoder << animationType;
 
     encoder << beginTime;
     encoder << duration;
@@ -164,8 +164,8 @@ void PlatformCAAnimationRemote::Properties::encode(IPC::Encoder& encoder) const
     encoder << repeatCount;
     encoder << speed;
 
-    encoder.encodeEnum(fillMode);
-    encoder.encodeEnum(valueFunction);
+    encoder << fillMode;
+    encoder << valueFunction;
 
     encoder << autoReverses;
     encoder << removedOnCompletion;
@@ -204,7 +204,7 @@ Optional<PlatformCAAnimationRemote::Properties> PlatformCAAnimationRemote::Prope
     if (!decoder.decode(properties.keyPath))
         return WTF::nullopt;
 
-    if (!decoder.decodeEnum(properties.animationType))
+    if (!decoder.decode(properties.animationType))
         return WTF::nullopt;
 
     if (!decoder.decode(properties.beginTime))
@@ -222,10 +222,10 @@ Optional<PlatformCAAnimationRemote::Properties> PlatformCAAnimationRemote::Prope
     if (!decoder.decode(properties.speed))
         return WTF::nullopt;
 
-    if (!decoder.decodeEnum(properties.fillMode))
+    if (!decoder.decode(properties.fillMode))
         return WTF::nullopt;
 
-    if (!decoder.decodeEnum(properties.valueFunction))
+    if (!decoder.decode(properties.valueFunction))
         return WTF::nullopt;
 
     if (!decoder.decode(properties.autoReverses))
@@ -259,7 +259,7 @@ Optional<PlatformCAAnimationRemote::Properties> PlatformCAAnimationRemote::Prope
         for (size_t i = 0; i < numTimingFunctions; ++i) {
         
             TimingFunction::TimingFunctionType type;
-            if (!decoder.decodeEnum(type))
+            if (!decoder.decode(type))
                 return WTF::nullopt;
 
             RefPtr<TimingFunction> timingFunction;