Begin transition to modern IPC decoding
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2017 22:49:50 +0000 (22:49 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2017 22:49:50 +0000 (22:49 +0000)
commitb0ffbfc9c69c81c2f793818794b2fd0f619b4d33
tree4594af77eee9d3e63e3add0e1affb47815c2c85d
parent869a92596ab87f98b3d2e3e346dc24a6a5babf73
Begin transition to modern IPC decoding
https://bugs.webkit.org/show_bug.cgi?id=176043

Reviewed by JF Bastien.

Right now, if a class is decoded from IPC we must have a default constructor.
This prevents us from having Ref or C++ references in such types, which is cluttering up our code.
This is because IPC::decode makes a default-constructed object, fills it, and returns a bool indicating success.
Making IPC::decode instead return a std::optional makes it so we do not need to call an empty constructor.
This could also enable us to add IPC::Decoder::operator>> and other fun things!
I also modernized two arbitrary classes, WebsitePolicies and WebPageGroupData with more to come.
There's no good way to update the actual generated IPC code until each class has been transitioned.

* Platform/IPC/ArgumentCoder.h:
(IPC::ArgumentCoder::decode):
* Platform/IPC/Decoder.h:
(IPC::Decoder::decode):
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebPageGroupData.cpp:
(WebKit::WebPageGroupData::decode):
* Shared/WebPageGroupData.h:
* Shared/WebsitePolicies.h:
(WebKit::WebsitePolicies::decode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/Platform/IPC/ArgumentCoder.h
Source/WebKit/Platform/IPC/ArgumentCoders.h
Source/WebKit/Platform/IPC/Decoder.h
Source/WebKit/Shared/API/APIPageGroupHandle.cpp
Source/WebKit/Shared/WebPageCreationParameters.cpp
Source/WebKit/Shared/WebPageCreationParameters.h
Source/WebKit/Shared/WebPageGroupData.cpp
Source/WebKit/Shared/WebPageGroupData.h
Source/WebKit/Shared/WebsitePolicies.h