generate-input-with-vector-members.json-TestReplayInputs.cpp [plain text]
#include "config.h"
#include "generate-input-with-vector-members.json-TestReplayInputs.h"
#if ENABLE(WEB_REPLAY)
#include "InternalNamespaceImplIncludeDummy.h"
#include <platform/ExternalNamespaceImplIncludeDummy.h>
#include <things/JSThing.h>
#include <things/WebThing.h>
namespace Test {
ArrayOfThings::ArrayOfThings(Vector<double>& doubles, Vector<JSThing>& jsthings, Vector<WebThing>& webthings)
: NondeterministicInput<ArrayOfThings>()
, m_doubles(doubles)
, m_jsthings(jsthings)
, m_webthings(webthings)
{
}
ArrayOfThings::~ArrayOfThings()
{
}
}
namespace JSC {
const AtomicString& InputTraits<Test::ArrayOfThings>::type()
{
static NeverDestroyed<const AtomicString> type("ArrayOfThings", AtomicString::ConstructFromLiteral);
return type;
}
void InputTraits<Test::ArrayOfThings>::encode(EncodedValue& encodedValue, const Test::ArrayOfThings& input)
{
encodedValue.put<Vector<double>>(ASCIILiteral("doubles"), input.doubles());
encodedValue.put<Vector<JSThing>>(ASCIILiteral("jsthings"), input.jsthings());
encodedValue.put<Vector<WebCore::WebThing>>(ASCIILiteral("webthings"), input.webthings());
}
bool InputTraits<Test::ArrayOfThings>::decode(EncodedValue& encodedValue, std::unique_ptr<Test::ArrayOfThings>& input)
{
Vector<double> doubles;
if (!encodedValue.get<Vector<double>>(ASCIILiteral("doubles"), doubles))
return false;
Vector<JSThing> jsthings;
if (!encodedValue.get<Vector<JSThing>>(ASCIILiteral("jsthings"), jsthings))
return false;
Vector<WebCore::WebThing> webthings;
if (!encodedValue.get<Vector<WebCore::WebThing>>(ASCIILiteral("webthings"), webthings))
return false;
input = std::make_unique<Test::ArrayOfThings>(doubles, jsthings, webthings);
return true;
}
}
#endif // ENABLE(WEB_REPLAY)