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()
{
}
SavedHistory::SavedHistory(Vector<RefPtr<HistoryItem>>& entries)
: NondeterministicInput<SavedHistory>()
, m_entries(entries)
{
}
SavedHistory::~SavedHistory()
{
}
}
namespace JSC {
const String& InputTraits<Test::ArrayOfThings>::type()
{
static NeverDestroyed<const String> type(ASCIILiteral("ArrayOfThings"));
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;
}
const String& InputTraits<Test::SavedHistory>::type()
{
static NeverDestroyed<const String> type(ASCIILiteral("SavedHistory"));
return type;
}
void InputTraits<Test::SavedHistory>::encode(EncodedValue& encodedValue, const Test::SavedHistory& input)
{
encodedValue.put<Vector<WebCore::HistoryItem>>(ASCIILiteral("entries"), input.entries());
}
bool InputTraits<Test::SavedHistory>::decode(EncodedValue& encodedValue, std::unique_ptr<Test::SavedHistory>& input)
{
Vector<RefPtr<WebCore::HistoryItem>> entries;
if (!encodedValue.get<Vector<WebCore::HistoryItem>>(ASCIILiteral("entries"), entries))
return false;
input = std::make_unique<Test::SavedHistory>(entries);
return true;
}
}
#endif // ENABLE(WEB_REPLAY)