[webkit-changes] [WebKit/WebKit] 0a5871: [WK2] Avoid stream-extracting from the decoder in ...

Žan Doberšek noreply at github.com
Fri Dec 9 23:51:21 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0a587109bc724819728c860f1c9d044ecbc4d745
      https://github.com/WebKit/WebKit/commit/0a587109bc724819728c860f1c9d044ecbc4d745
  Author: Žan Doberšek <zdobersek at igalia.com>
  Date:   2022-12-09 (Fri, 09 Dec 2022)

  Changed paths:
    M Source/WebKit/Scripts/generate-serializers.py
    M Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.cpp

  Log Message:
  -----------
  [WK2] Avoid stream-extracting from the decoder in generated-serializers code
https://bugs.webkit.org/show_bug.cgi?id=249018

Reviewed by Kimmo Kinnunen.

Instead of using the stream extraction operator to retrieve objects from
the decoder, the decoder's decode<T>() method is called to retrieve the
resulting std::optional<> object more efficiently.

This requires some modifications to how and where the target
std::optional<T> object is defined. The sanitized-string member name in
the decoding-code generator is cached in a variable and used throughout.

Testing baseline is updated to reflect the changes.

* Source/WebKit/Scripts/generate-serializers.py:
(decode_type):
* Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.cpp:
(IPC::ArgumentCoder<Namespace::Subnamespace::StructName>::decode):
(IPC::ArgumentCoder<Namespace::OtherClass>::decode):
(IPC::ArgumentCoder<Namespace::ReturnRefClass>::decode):
(IPC::ArgumentCoder<Namespace::EmptyConstructorStruct>::decode):
(IPC::ArgumentCoder<Namespace::EmptyConstructorNullable>::decode):
(IPC::ArgumentCoder<WithoutNamespace>::decode):
(IPC::ArgumentCoder<WithoutNamespaceWithAttributes>::decode):
(IPC::ArgumentCoder<WebCore::InheritsFrom>::decode):
(IPC::ArgumentCoder<WebCore::InheritanceGrandchild>::decode):
(IPC::ArgumentCoder<WTF::Seconds>::decode):
(IPC::ArgumentCoder<WTF::CreateUsingClass>::decode):
(IPC::ArgumentCoder<WebCore::FloatBoxExtent>::decode):
(IPC::ArgumentCoder<NullableSoftLinkedMember>::decode):

Canonical link: https://commits.webkit.org/257677@main




More information about the webkit-changes mailing list