We should be able to define types as being move-only, and generate appropriate serialisers for them.
This should not need much of additional markup in the .serializers.in file. The fix should be to use different pattern to decode std::optional<Ref<WebCore::TimingFunction>> ArgumentCoder<WebCore::TimingFunction>::decode(Decoder& decoder) { std::optional<WebCore_TimingFunction_Subclass> type; decoder >> type; if (!type) return std::nullopt; if (type == WebCore_TimingFunction_Subclass::LinearTimingFunction) { std::optional<Ref<WebCore::LinearTimingFunction>> result; decoder >> result; if (!result) return std::nullopt; return WTFMove(*result); } should be std::optional<Ref<WebCore::TimingFunction>> ArgumentCoder<WebCore::TimingFunction>::decode(Decoder& decoder) { auto type = decoder.decode<WebCore_TimingFunction_Subclass>(); if (UNLIKELY(!decoder.isValid())) return std::nullopt; if (type == WebCore_TimingFunction_Subclass::LinearTimingFunction) { auto result = decoder.decode<Ref<WebCore::LinearTimingFunction>>() if (UNLIKELY(!decoder.isValid())) return std::nullopt; return WTFMove(*result); }
Pull request: https://github.com/WebKit/WebKit/pull/14658
Committed 264912@main (6b8b65111faf): <https://commits.webkit.org/264912@main> Reviewed commits have been landed. Closing PR #14658 and removing active labels.
<rdar://problem/110350309>