[webkit-changes] [WebKit/WebKit] 3c0f2f: Use std::void_t in HasLegacyDecoder, HasModernDecoder
Žan Doberšek
noreply at github.com
Wed Jan 11 00:53:24 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3c0f2fdb4126f5bf8adba030e6718fcbc0dc3e23
https://github.com/WebKit/WebKit/commit/3c0f2fdb4126f5bf8adba030e6718fcbc0dc3e23
Author: Žan Doberšek <zdobersek at igalia.com>
Date: 2023-01-11 (Wed, 11 Jan 2023)
Changed paths:
M Source/WTF/wtf/ArgumentCoder.h
M Source/WebKit/Platform/IPC/Decoder.h
Log Message:
-----------
Use std::void_t in HasLegacyDecoder, HasModernDecoder
https://bugs.webkit.org/show_bug.cgi?id=250275
Reviewed by Fujii Hironori.
The HasLegacyDecoder and HasModernDecoder templates used to detect presence of
either decoding method on a given type's decoding-implementation class are
simplified.
The base templates inherit from std::false_type and gain the third template
parameter that defaults to void. In corresponding partial specializations that
inherit from std::true_type, that third template argument is then specified
as std::void_t instantiation with the type of the desired decoding method.
When the desired method is present, the std::true_type-based partial
specialization will be selected. When not present, the std::false_type-based
base template will be used.
Templated HasLegacyDecoderV and HasModernDecoderV constexpr booleans are
removed as they're only used in one place.
* Source/WTF/wtf/ArgumentCoder.h:
(IPC::ArgumentCoder::decode):
(IPC::Detail::TestLegacyDecoder): Deleted.
(IPC::Detail::TestModernDecoder): Deleted.
* Source/WebKit/Platform/IPC/Decoder.h:
Canonical link: https://commits.webkit.org/258778@main
More information about the webkit-changes
mailing list