type-requiring-runtime-casts.json-result [plain text]
### Begin File: InspectorBackendCommands.js
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
// Test.
InspectorBackend.registerEnum("Test.UncastedAnimals", {Pigs: "Pigs", Cows: "Cows", Cats: "Cats", Hens: "Hens"});
InspectorBackend.registerEnum("Test.CastedAnimals", {Ducks: "Ducks", Hens: "Hens", Crows: "Crows", Flamingos: "Flamingos"});
### End File: InspectorBackendCommands.js
### Begin File: TestAlternateBackendDispatchers.h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#pragma once
#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
#include "TestProtocolTypes.h"
#include <inspector/InspectorFrontendRouter.h>
#include <JavaScriptCore/InspectorBackendDispatcher.h>
namespace Inspector {
class AlternateBackendDispatcher {
public:
void setBackendDispatcher(RefPtr<BackendDispatcher>&& dispatcher) { m_backendDispatcher = WTFMove(dispatcher); }
BackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
private:
RefPtr<BackendDispatcher> m_backendDispatcher;
};
} // namespace Inspector
#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
### End File: TestAlternateBackendDispatchers.h
### Begin File: TestBackendDispatchers.h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#pragma once
#include "TestProtocolObjects.h"
#include <inspector/InspectorBackendDispatcher.h>
#include <wtf/text/WTFString.h>
namespace Inspector {
typedef String ErrorString;
} // namespace Inspector
### End File: TestBackendDispatchers.h
### Begin File: TestBackendDispatchers.cpp
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#include "config.h"
#include "TestBackendDispatchers.h"
#include <inspector/InspectorFrontendRouter.h>
#include <inspector/InspectorValues.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/text/CString.h>
#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
#include "TestAlternateBackendDispatchers.h"
#endif
namespace Inspector {
} // namespace Inspector
### End File: TestBackendDispatchers.cpp
### Begin File: TestFrontendDispatchers.h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#pragma once
#include "TestProtocolObjects.h"
#include <inspector/InspectorValues.h>
#include <wtf/text/WTFString.h>
namespace Inspector {
class FrontendRouter;
} // namespace Inspector
### End File: TestFrontendDispatchers.h
### Begin File: TestFrontendDispatchers.cpp
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#include "config.h"
#include "TestFrontendDispatchers.h"
#include "InspectorFrontendRouter.h"
#include <wtf/text/CString.h>
namespace Inspector {
} // namespace Inspector
### End File: TestFrontendDispatchers.cpp
### Begin File: TestProtocolObjects.h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#pragma once
#include <inspector/InspectorProtocolTypes.h>
#include <wtf/Assertions.h>
namespace Inspector {
namespace Protocol {
// Forward declarations.
namespace Test {
class TypeNeedingCast;
class RecursiveObject1;
class RecursiveObject2;
enum class UncastedAnimals;
enum class CastedAnimals;
} // Test
// End of forward declarations.
// Typedefs.
namespace Test {
typedef int CastedObjectId;
typedef int UncastedObjectId;
} // Test
// End of typedefs.
namespace TestHelpers {
String getEnumConstantValue(int code);
template<typename T> String getEnumConstantValue(T enumValue)
{
return getEnumConstantValue(static_cast<int>(enumValue));
}
} // namespace TestHelpers
namespace Test {
/* A dummy type that requires runtime casts, and forces non-primitive referenced types to also emit runtime cast helpers. */
class TypeNeedingCast : public Inspector::InspectorObjectBase {
public:
enum {
NoFieldsSet = 0,
StringSet = 1 << 0,
NumberSet = 1 << 1,
AnimalsSet = 1 << 2,
IdSet = 1 << 3,
TreeSet = 1 << 4,
AllFieldsSet = (StringSet | NumberSet | AnimalsSet | IdSet | TreeSet)
};
template<int STATE>
class Builder {
private:
RefPtr<InspectorObject> m_result;
template<int STEP> Builder<STATE | STEP>& castState()
{
return *reinterpret_cast<Builder<STATE | STEP>*>(this);
}
Builder(Ref</*TypeNeedingCast*/InspectorObject>&& object)
: m_result(WTFMove(object))
{
COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
}
friend class TypeNeedingCast;
public:
Builder<STATE | StringSet>& setString(const String& value)
{
COMPILE_ASSERT(!(STATE & StringSet), property_string_already_set);
m_result->setString(ASCIILiteral("string"), value);
return castState<StringSet>();
}
Builder<STATE | NumberSet>& setNumber(int value)
{
COMPILE_ASSERT(!(STATE & NumberSet), property_number_already_set);
m_result->setInteger(ASCIILiteral("number"), value);
return castState<NumberSet>();
}
Builder<STATE | AnimalsSet>& setAnimals(Inspector::Protocol::Test::CastedAnimals value)
{
COMPILE_ASSERT(!(STATE & AnimalsSet), property_animals_already_set);
m_result->setString(ASCIILiteral("animals"), Inspector::Protocol::TestHelpers::getEnumConstantValue(value));
return castState<AnimalsSet>();
}
Builder<STATE | IdSet>& setId(int value)
{
COMPILE_ASSERT(!(STATE & IdSet), property_id_already_set);
m_result->setInteger(ASCIILiteral("id"), value);
return castState<IdSet>();
}
Builder<STATE | TreeSet>& setTree(RefPtr<Inspector::Protocol::Test::RecursiveObject1> value)
{
COMPILE_ASSERT(!(STATE & TreeSet), property_tree_already_set);
m_result->setObject(ASCIILiteral("tree"), value);
return castState<TreeSet>();
}
Ref<TypeNeedingCast> release()
{
COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
COMPILE_ASSERT(sizeof(TypeNeedingCast) == sizeof(InspectorObject), cannot_cast);
Ref<InspectorObject> result = m_result.releaseNonNull();
return WTFMove(*reinterpret_cast<Ref<TypeNeedingCast>*>(&result));
}
};
/*
* Synthetic constructor:
* Ref<TypeNeedingCast> result = TypeNeedingCast::create()
* .setString(...)
* .setNumber(...)
* .setAnimals(...)
* .setId(...)
* .setTree(...)
* .release();
*/
static Builder<NoFieldsSet> create()
{
return Builder<NoFieldsSet>(InspectorObject::create());
}
};
/* */
enum class UncastedAnimals {
Pigs = 4,
Cows = 5,
Cats = 6,
Hens = 1,
}; // enum class UncastedAnimals
/* */
enum class CastedAnimals {
Ducks = 0,
Hens = 1,
Crows = 2,
Flamingos = 3,
}; // enum class CastedAnimals
class RecursiveObject1 : public Inspector::InspectorObjectBase {
public:
enum {
NoFieldsSet = 0,
AllFieldsSet = 0
};
template<int STATE>
class Builder {
private:
RefPtr<InspectorObject> m_result;
template<int STEP> Builder<STATE | STEP>& castState()
{
return *reinterpret_cast<Builder<STATE | STEP>*>(this);
}
Builder(Ref</*RecursiveObject1*/InspectorObject>&& object)
: m_result(WTFMove(object))
{
COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
}
friend class RecursiveObject1;
public:
Ref<RecursiveObject1> release()
{
COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
COMPILE_ASSERT(sizeof(RecursiveObject1) == sizeof(InspectorObject), cannot_cast);
Ref<InspectorObject> result = m_result.releaseNonNull();
return WTFMove(*reinterpret_cast<Ref<RecursiveObject1>*>(&result));
}
};
/*
* Synthetic constructor:
* Ref<RecursiveObject1> result = RecursiveObject1::create()
* .release();
*/
static Builder<NoFieldsSet> create()
{
return Builder<NoFieldsSet>(InspectorObject::create());
}
void setObj(RefPtr<Inspector::Protocol::Test::RecursiveObject2> value)
{
InspectorObjectBase::setObject(ASCIILiteral("obj"), WTFMove(value));
}
};
class RecursiveObject2 : public Inspector::InspectorObjectBase {
public:
enum {
NoFieldsSet = 0,
AllFieldsSet = 0
};
template<int STATE>
class Builder {
private:
RefPtr<InspectorObject> m_result;
template<int STEP> Builder<STATE | STEP>& castState()
{
return *reinterpret_cast<Builder<STATE | STEP>*>(this);
}
Builder(Ref</*RecursiveObject2*/InspectorObject>&& object)
: m_result(WTFMove(object))
{
COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
}
friend class RecursiveObject2;
public:
Ref<RecursiveObject2> release()
{
COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
COMPILE_ASSERT(sizeof(RecursiveObject2) == sizeof(InspectorObject), cannot_cast);
Ref<InspectorObject> result = m_result.releaseNonNull();
return WTFMove(*reinterpret_cast<Ref<RecursiveObject2>*>(&result));
}
};
/*
* Synthetic constructor:
* Ref<RecursiveObject2> result = RecursiveObject2::create()
* .release();
*/
static Builder<NoFieldsSet> create()
{
return Builder<NoFieldsSet>(InspectorObject::create());
}
void setObj(RefPtr<Inspector::Protocol::Test::RecursiveObject1> value)
{
InspectorObjectBase::setObject(ASCIILiteral("obj"), WTFMove(value));
}
};
} // Test
template<> struct BindingTraits<Inspector::Protocol::Test::CastedAnimals> {
#if !ASSERT_DISABLED
static void assertValueHasExpectedType(Inspector::InspectorValue*);
#endif // !ASSERT_DISABLED
};
template<> struct BindingTraits<Inspector::Protocol::Test::TypeNeedingCast> {
static RefPtr<Inspector::Protocol::Test::TypeNeedingCast> runtimeCast(RefPtr<Inspector::InspectorValue>&& value);
#if !ASSERT_DISABLED
static void assertValueHasExpectedType(Inspector::InspectorValue*);
#endif // !ASSERT_DISABLED
};
template<> struct BindingTraits<Inspector::Protocol::Test::RecursiveObject1> {
#if !ASSERT_DISABLED
static void assertValueHasExpectedType(Inspector::InspectorValue*);
#endif // !ASSERT_DISABLED
};
template<> struct BindingTraits<Inspector::Protocol::Test::RecursiveObject2> {
#if !ASSERT_DISABLED
static void assertValueHasExpectedType(Inspector::InspectorValue*);
#endif // !ASSERT_DISABLED
};
namespace TestHelpers {
template<typename ProtocolEnumType>
std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);
// Enums in the 'Test' Domain
template<>
std::optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String&);
template<>
std::optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String&);
} // namespace TestHelpers
} // namespace Protocol
} // namespace Inspector
### End File: TestProtocolObjects.h
### Begin File: TestProtocolObjects.cpp
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#include "config.h"
#include "TestProtocolObjects.h"
#include <wtf/Optional.h>
#include <wtf/text/CString.h>
namespace Inspector {
namespace Protocol {
namespace TestHelpers {
static const char* const enum_constant_values[] = {
"Ducks",
"Hens",
"Crows",
"Flamingos",
"Pigs",
"Cows",
"Cats",
};
String getEnumConstantValue(int code) {
return enum_constant_values[code];
}
// Enums in the 'Test' Domain
template<>
std::optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String& protocolString)
{
static const size_t constantValues[] = {
(size_t)Inspector::Protocol::Test::UncastedAnimals::Pigs,
(size_t)Inspector::Protocol::Test::UncastedAnimals::Cows,
(size_t)Inspector::Protocol::Test::UncastedAnimals::Cats,
(size_t)Inspector::Protocol::Test::UncastedAnimals::Hens,
};
for (size_t i = 0; i < 4; ++i)
if (protocolString == enum_constant_values[constantValues[i]])
return (Inspector::Protocol::Test::UncastedAnimals)constantValues[i];
return std::nullopt;
}
template<>
std::optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String& protocolString)
{
static const size_t constantValues[] = {
(size_t)Inspector::Protocol::Test::CastedAnimals::Ducks,
(size_t)Inspector::Protocol::Test::CastedAnimals::Hens,
(size_t)Inspector::Protocol::Test::CastedAnimals::Crows,
(size_t)Inspector::Protocol::Test::CastedAnimals::Flamingos,
};
for (size_t i = 0; i < 4; ++i)
if (protocolString == enum_constant_values[constantValues[i]])
return (Inspector::Protocol::Test::CastedAnimals)constantValues[i];
return std::nullopt;
}
} // namespace TestHelpers
#if !ASSERT_DISABLED
void BindingTraits<Inspector::Protocol::Test::CastedAnimals>::assertValueHasExpectedType(Inspector::InspectorValue* value)
{
ASSERT_ARG(value, value);
String result;
bool castSucceeded = value->asString(result);
ASSERT(castSucceeded);
ASSERT(result == "Ducks" || result == "Hens" || result == "Crows" || result == "Flamingos");
}
#endif // !ASSERT_DISABLED
#if !ASSERT_DISABLED
void BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::assertValueHasExpectedType(Inspector::InspectorValue* value)
{
ASSERT_ARG(value, value);
RefPtr<InspectorObject> object;
bool castSucceeded = value->asObject(object);
ASSERT_UNUSED(castSucceeded, castSucceeded);
{
InspectorObject::iterator stringPos = object->find(ASCIILiteral("string"));
ASSERT(stringPos != object->end());
BindingTraits<String>::assertValueHasExpectedType(stringPos->value.get());
}
{
InspectorObject::iterator numberPos = object->find(ASCIILiteral("number"));
ASSERT(numberPos != object->end());
BindingTraits<int>::assertValueHasExpectedType(numberPos->value.get());
}
{
InspectorObject::iterator animalsPos = object->find(ASCIILiteral("animals"));
ASSERT(animalsPos != object->end());
BindingTraits<Inspector::Protocol::Test::CastedAnimals>::assertValueHasExpectedType(animalsPos->value.get());
}
{
InspectorObject::iterator idPos = object->find(ASCIILiteral("id"));
ASSERT(idPos != object->end());
BindingTraits<int>::assertValueHasExpectedType(idPos->value.get());
}
{
InspectorObject::iterator treePos = object->find(ASCIILiteral("tree"));
ASSERT(treePos != object->end());
BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasExpectedType(treePos->value.get());
}
int foundPropertiesCount = 5;
if (foundPropertiesCount != object->size())
FATAL("Unexpected properties in object: %s\n", object->toJSONString().ascii().data());
}
#endif // !ASSERT_DISABLED
RefPtr<Inspector::Protocol::Test::TypeNeedingCast> BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::runtimeCast(RefPtr<InspectorValue>&& value)
{
RefPtr<InspectorObject> result;
bool castSucceeded = value->asObject(result);
ASSERT_UNUSED(castSucceeded, castSucceeded);
#if !ASSERT_DISABLED
BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::assertValueHasExpectedType(result.get());
#endif // !ASSERT_DISABLED
COMPILE_ASSERT(sizeof(Inspector::Protocol::Test::TypeNeedingCast) == sizeof(InspectorObjectBase), type_cast_problem);
return static_cast<Inspector::Protocol::Test::TypeNeedingCast*>(static_cast<InspectorObjectBase*>(result.get()));
}
#if !ASSERT_DISABLED
void BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasExpectedType(Inspector::InspectorValue* value)
{
ASSERT_ARG(value, value);
RefPtr<InspectorObject> object;
bool castSucceeded = value->asObject(object);
ASSERT_UNUSED(castSucceeded, castSucceeded);
int foundPropertiesCount = 0;
{
InspectorObject::iterator objPos = object->find(ASCIILiteral("obj"));
if (objPos != object->end()) {
BindingTraits<Inspector::Protocol::Test::RecursiveObject2>::assertValueHasExpectedType(objPos->value.get());
++foundPropertiesCount;
}
}
if (foundPropertiesCount != object->size())
FATAL("Unexpected properties in object: %s\n", object->toJSONString().ascii().data());
}
#endif // !ASSERT_DISABLED
#if !ASSERT_DISABLED
void BindingTraits<Inspector::Protocol::Test::RecursiveObject2>::assertValueHasExpectedType(Inspector::InspectorValue* value)
{
ASSERT_ARG(value, value);
RefPtr<InspectorObject> object;
bool castSucceeded = value->asObject(object);
ASSERT_UNUSED(castSucceeded, castSucceeded);
int foundPropertiesCount = 0;
{
InspectorObject::iterator objPos = object->find(ASCIILiteral("obj"));
if (objPos != object->end()) {
BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasExpectedType(objPos->value.get());
++foundPropertiesCount;
}
}
if (foundPropertiesCount != object->size())
FATAL("Unexpected properties in object: %s\n", object->toJSONString().ascii().data());
}
#endif // !ASSERT_DISABLED
} // namespace Protocol
} // namespace Inspector
### End File: TestProtocolObjects.cpp
### Begin File: TestProtocolBackendDispatchers.h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
#include <wtf/RetainPtr.h>
namespace Inspector {
} // namespace Inspector
### End File: TestProtocolBackendDispatchers.h
### Begin File: TestProtocolConfiguration.mm
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#import "config.h"
#import "TestProtocolConfiguration.h"
#import "TestProtocolInternal.h"
#import "TestProtocolBackendDispatchers.h"
#import <JavaScriptCore/AlternateDispatchableAgent.h>
#import <JavaScriptCore/AugmentableInspectorController.h>
#import <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
#import <JavaScriptCore/InspectorBackendDispatchers.h>
using namespace Inspector;
@implementation TestProtocolConfiguration
{
AugmentableInspectorController* _controller;
}
- (instancetype)initWithController:(AugmentableInspectorController*)controller
{
self = [super init];
if (!self)
return nil;
ASSERT(controller);
_controller = controller;
return self;
}
- (void)dealloc
{
[super dealloc];
}
@end
### End File: TestProtocolConfiguration.mm
### Begin File: TestProtocolConfiguration.h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#import <WebInspector/TestProtocol.h>
__attribute__((visibility ("default")))
@interface TestProtocolConfiguration : NSObject
@end
### End File: TestProtocolConfiguration.h
### Begin File: TestProtocolBackendDispatchers.mm
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#import "config.h"
#import "TestProtocolBackendDispatchers.h"
#include "TestProtocolInternal.h"
#include "TestProtocolTypeConversions.h"
#include <JavaScriptCore/InspectorValues.h>
namespace Inspector {
} // namespace Inspector
### End File: TestProtocolBackendDispatchers.mm
### Begin File: TestProtocolEventDispatchers.mm
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#import "config.h"
#import "TestProtocolInternal.h"
#import "TestProtocolTypeConversions.h"
#import <JavaScriptCore/InspectorValues.h>
using namespace Inspector;
### End File: TestProtocolEventDispatchers.mm
### Begin File: TestProtocol.h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#import <Foundation/Foundation.h>
#import <WebInspector/RWIProtocolJSONObject.h>
@class TestProtocolTestTypeNeedingCast;
@class TestProtocolTestRecursiveObject1;
@class TestProtocolTestRecursiveObject2;
typedef NS_ENUM(NSInteger, TestProtocolTestUncastedAnimals) {
TestProtocolTestUncastedAnimalsPigs,
TestProtocolTestUncastedAnimalsCows,
TestProtocolTestUncastedAnimalsCats,
TestProtocolTestUncastedAnimalsHens,
};
typedef NS_ENUM(NSInteger, TestProtocolTestCastedAnimals) {
TestProtocolTestCastedAnimalsDucks,
TestProtocolTestCastedAnimalsHens,
TestProtocolTestCastedAnimalsCrows,
TestProtocolTestCastedAnimalsFlamingos,
};
__attribute__((visibility ("default")))
@interface TestProtocolTestTypeNeedingCast : RWIProtocolJSONObject
- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload;
- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject;
- (instancetype)initWithString:(NSString *)string number:(int)number animals:(TestProtocolTestCastedAnimals)animals identifier:(int)identifier tree:(TestProtocolTestRecursiveObject1 *)tree;
/* required */ @property (nonatomic, copy) NSString *string;
/* required */ @property (nonatomic, assign) int number;
/* required */ @property (nonatomic, assign) TestProtocolTestCastedAnimals animals;
/* required */ @property (nonatomic, assign) int identifier;
/* required */ @property (nonatomic, retain) TestProtocolTestRecursiveObject1 *tree;
@end
__attribute__((visibility ("default")))
@interface TestProtocolTestRecursiveObject1 : RWIProtocolJSONObject
- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload;
- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject;
/* optional */ @property (nonatomic, retain) TestProtocolTestRecursiveObject2 *obj;
@end
__attribute__((visibility ("default")))
@interface TestProtocolTestRecursiveObject2 : RWIProtocolJSONObject
- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload;
- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject;
/* optional */ @property (nonatomic, retain) TestProtocolTestRecursiveObject1 *obj;
@end
### End File: TestProtocol.h
### Begin File: TestProtocolInternal.h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#import "TestProtocol.h"
#import "TestProtocolJSONObjectPrivate.h"
#import <JavaScriptCore/AugmentableInspectorController.h>
#import <JavaScriptCore/InspectorValues.h>
### End File: TestProtocolInternal.h
### Begin File: TestProtocolTypeConversions.h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#import "TestProtocol.h"
#import <WebInspector/RWIProtocolArrayConversions.h>
namespace Inspector {
template<typename ObjCEnumType>
ObjCEnumType fromProtocolString(const String& value);
inline String toProtocolString(TestProtocolTestUncastedAnimals value)
{
switch(value) {
case TestProtocolTestUncastedAnimalsPigs:
return ASCIILiteral("Pigs");
case TestProtocolTestUncastedAnimalsCows:
return ASCIILiteral("Cows");
case TestProtocolTestUncastedAnimalsCats:
return ASCIILiteral("Cats");
case TestProtocolTestUncastedAnimalsHens:
return ASCIILiteral("Hens");
}
}
template<>
inline TestProtocolTestUncastedAnimals fromProtocolString(const String& value)
{
if (value == "Pigs")
return TestProtocolTestUncastedAnimalsPigs;
if (value == "Cows")
return TestProtocolTestUncastedAnimalsCows;
if (value == "Cats")
return TestProtocolTestUncastedAnimalsCats;
if (value == "Hens")
return TestProtocolTestUncastedAnimalsHens;
ASSERT_NOT_REACHED();
return TestProtocolTestUncastedAnimalsPigs;
}
inline String toProtocolString(TestProtocolTestCastedAnimals value)
{
switch(value) {
case TestProtocolTestCastedAnimalsDucks:
return ASCIILiteral("Ducks");
case TestProtocolTestCastedAnimalsHens:
return ASCIILiteral("Hens");
case TestProtocolTestCastedAnimalsCrows:
return ASCIILiteral("Crows");
case TestProtocolTestCastedAnimalsFlamingos:
return ASCIILiteral("Flamingos");
}
}
template<>
inline TestProtocolTestCastedAnimals fromProtocolString(const String& value)
{
if (value == "Ducks")
return TestProtocolTestCastedAnimalsDucks;
if (value == "Hens")
return TestProtocolTestCastedAnimalsHens;
if (value == "Crows")
return TestProtocolTestCastedAnimalsCrows;
if (value == "Flamingos")
return TestProtocolTestCastedAnimalsFlamingos;
ASSERT_NOT_REACHED();
return TestProtocolTestCastedAnimalsDucks;
}
} // namespace Inspector
### End File: TestProtocolTypeConversions.h
### Begin File: TestProtocolTypeConversions.mm
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#import "config.h"
#import "TestProtocolTypeConversions.h"
#import "TestProtocol.h"
#import "TestProtocolTypeParser.h"
#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
using namespace Inspector;
@interface TestProtocolTypeConversions (TestDomain)
+ (void)_parseTypeNeedingCast:(TestProtocolTestTypeNeedingCast **)outValue fromPayload:(id)payload;
+ (void)_parseCastedObjectId:(NSNumber **)outValue fromPayload:(id)payload;
+ (void)_parseUncastedObjectId:(NSNumber **)outValue fromPayload:(id)payload;
+ (void)_parseUncastedAnimals:(NSNumber **)outValue fromPayload:(id)payload;
+ (void)_parseCastedAnimals:(NSNumber **)outValue fromPayload:(id)payload;
+ (void)_parseRecursiveObject1:(TestProtocolTestRecursiveObject1 **)outValue fromPayload:(id)payload;
+ (void)_parseRecursiveObject2:(TestProtocolTestRecursiveObject2 **)outValue fromPayload:(id)payload;
@end
@implementation TestProtocolTypeConversions (TestDomain)
+ (void)_parseTypeNeedingCast:(TestProtocolTestTypeNeedingCast **)outValue fromPayload:(id)payload
{
THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
*outValue = [[TestProtocolTestTypeNeedingCast alloc] initWithPayload:payload];
}
+ (void)_parseCastedObjectId:(NSNumber **)outValue fromPayload:(id)payload
{
THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
*outValue = (NSNumber *)payload;
}
+ (void)_parseUncastedObjectId:(NSNumber **)outValue fromPayload:(id)payload
{
THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
*outValue = (NSNumber *)payload;
}
+ (void)_parseUncastedAnimals:(NSNumber **)outValue fromPayload:(id)payload
{
THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
*outValue = @(Inspector::fromProtocolString<TestProtocolTestUncastedAnimals>(payload));
}
+ (void)_parseCastedAnimals:(NSNumber **)outValue fromPayload:(id)payload
{
THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
*outValue = @(Inspector::fromProtocolString<TestProtocolTestCastedAnimals>(payload));
}
+ (void)_parseRecursiveObject1:(TestProtocolTestRecursiveObject1 **)outValue fromPayload:(id)payload
{
THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
*outValue = [[TestProtocolTestRecursiveObject1 alloc] initWithPayload:payload];
}
+ (void)_parseRecursiveObject2:(TestProtocolTestRecursiveObject2 **)outValue fromPayload:(id)payload
{
THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
*outValue = [[TestProtocolTestRecursiveObject2 alloc] initWithPayload:payload];
}
@end
### End File: TestProtocolTypeConversions.mm
### Begin File: TestProtocolTypes.mm
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
* Copyright (C) 2013-2016 Apple Inc. All rights reserved.
* Copyright (C) 2014 University of Washington. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
#import "config.h"
#import "TestProtocolInternal.h"
#import "TestProtocolTypeConversions.h"
#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
#import <JavaScriptCore/InspectorValues.h>
#import <wtf/Assertions.h>
using namespace Inspector;
@implementation TestProtocolTestTypeNeedingCast
- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload
{
if (!(self = [super init]))
return nil;
THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"string"], @"string");
self.string = payload[@"string"];
THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"number"], @"number");
self.number = [payload[@"number"] integerValue];
THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"animals"], @"animals");
self.animals = fromProtocolString<TestProtocolTestCastedAnimals>(payload[@"animals"]);
THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"identifier"], @"identifier");
self.identifier = [payload[@"id"] integerValue];
THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"tree"], @"tree");
self.tree = [[TestProtocolTestRecursiveObject1 alloc] initWithPayload:payload[@"tree"]];
return self;
}
- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject
{
if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()]))
return nil;
return self;
}
- (instancetype)initWithString:(NSString *)string number:(int)number animals:(TestProtocolTestCastedAnimals)animals identifier:(int)identifier tree:(TestProtocolTestRecursiveObject1 *)tree
{
if (!(self = [super init]))
return nil;
THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(string, @"string");
THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(tree, @"tree");
self.string = string;
self.number = number;
self.animals = animals;
self.identifier = identifier;
self.tree = tree;
return self;
}
- (void)setString:(NSString *)string
{
[super setString:string forKey:@"string"];
}
- (NSString *)string
{
return [super stringForKey:@"string"];
}
- (void)setNumber:(int)number
{
[super setInteger:number forKey:@"number"];
}
- (int)number
{
return [super integerForKey:@"number"];
}
- (void)setAnimals:(TestProtocolTestCastedAnimals)animals
{
[super setString:toProtocolString(animals) forKey:@"animals"];
}
- (TestProtocolTestCastedAnimals)animals
{
return fromProtocolString<TestProtocolTestCastedAnimals>([super stringForKey:@"animals"]);
}
- (void)setIdentifier:(int)identifier
{
[super setInteger:identifier forKey:@"id"];
}
- (int)identifier
{
return [super integerForKey:@"id"];
}
- (void)setTree:(TestProtocolTestRecursiveObject1 *)tree
{
[super setObject:tree forKey:@"tree"];
}
- (TestProtocolTestRecursiveObject1 *)tree
{
return [[TestProtocolTestRecursiveObject1 alloc] initWithInspectorObject:[[super objectForKey:@"tree"] toInspectorObject].get()];
}
@end
@implementation TestProtocolTestRecursiveObject1
- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload
{
if (!(self = [super init]))
return nil;
self.obj = [[TestProtocolTestRecursiveObject2 alloc] initWithPayload:payload[@"obj"]];
return self;
}
- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject
{
if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()]))
return nil;
return self;
}
- (void)setObj:(TestProtocolTestRecursiveObject2 *)obj
{
[super setObject:obj forKey:@"obj"];
}
- (TestProtocolTestRecursiveObject2 *)obj
{
return [[TestProtocolTestRecursiveObject2 alloc] initWithInspectorObject:[[super objectForKey:@"obj"] toInspectorObject].get()];
}
@end
@implementation TestProtocolTestRecursiveObject2
- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload
{
if (!(self = [super init]))
return nil;
self.obj = [[TestProtocolTestRecursiveObject1 alloc] initWithPayload:payload[@"obj"]];
return self;
}
- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject
{
if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()]))
return nil;
return self;
}
- (void)setObj:(TestProtocolTestRecursiveObject1 *)obj
{
[super setObject:obj forKey:@"obj"];
}
- (TestProtocolTestRecursiveObject1 *)obj
{
return [[TestProtocolTestRecursiveObject1 alloc] initWithInspectorObject:[[super objectForKey:@"obj"] toInspectorObject].get()];
}
@end
### End File: TestProtocolTypes.mm