RESOLVED FIXED 257581
Add support to GeneratedSerializers for move-only types
https://bugs.webkit.org/show_bug.cgi?id=257581
Summary Add support to GeneratedSerializers for move-only types
Matt Woodrow
Reported 2023-05-31 19:18:08 PDT
We should be able to define types as being move-only, and generate appropriate serialisers for them.
Attachments
Kimmo Kinnunen
Comment 1 2023-05-31 23:16:49 PDT
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); }
Matt Woodrow
Comment 2 2023-06-04 15:04:12 PDT
EWS
Comment 3 2023-06-06 15:38:39 PDT
Committed 264912@main (6b8b65111faf): <https://commits.webkit.org/264912@main> Reviewed commits have been landed. Closing PR #14658 and removing active labels.
Radar WebKit Bug Importer
Comment 4 2023-06-06 15:39:16 PDT
Note You need to log in before you can comment on or make changes to this bug.