12021-11-15 Chris Dumez <cdumez@apple.com>
2
3 Decoder::unwrapForTesting() is unnecessarily inefficient
4 https://bugs.webkit.org/show_bug.cgi?id=233145
5
6 Reviewed by NOBODY (OOPS!).
7
8 Decoder::unwrapForTesting() is unnecessarily inefficient. It can take the whole
9 m_attachments data members from the decoder instead of calling removeAttachment()
10 repeatedly on the Decoder.
11
12 Also rename removeAttachment() to takeAttachment() since it returns the Attachment.
13 Update it to return a std::optional<Attachment> instead of using an out-parameter.
14
15 * Platform/IPC/Attachment.cpp:
16 (IPC::Attachment::decode):
17 * Platform/IPC/Attachment.h:
18 * Platform/IPC/Decoder.cpp:
19 (IPC::Decoder::unwrapForTesting):
20 (IPC::Decoder::takeAttachment):
21 (IPC::Decoder::removeAttachment): Deleted.
22 * Platform/IPC/Decoder.h:
23 * Platform/IPC/win/AttachmentWin.cpp:
24 (IPC::Attachment::decode):
25