diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/inspector/scripts/tests | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/JavaScriptCore/inspector/scripts/tests')
70 files changed, 22436 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/all/definitions-with-mac-platform.json b/Source/JavaScriptCore/inspector/scripts/tests/all/definitions-with-mac-platform.json new file mode 100644 index 000000000..817f135ee --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/all/definitions-with-mac-platform.json @@ -0,0 +1,28 @@ +{ + "domain": "Network", + "types": [ + { + "id": "NetworkError", + "type": "object", + "platform": "macos", + "properties": [ + { "name": "message", "type": "string", "description": "Error message." }, + { "name": "code", "type": "integer", "description": "Error code." } + ] + } + ], + "commands": [ + { + "name": "loadResource", + "platform": "macos", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + } + ], + "events": [ + { + "name": "resourceLoaded", + "platform": "macos", + "description": "A resource was loaded." + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result b/Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result new file mode 100644 index 000000000..170d57c0a --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result @@ -0,0 +1,1203 @@ +### 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// Network. +InspectorBackend.registerNetworkDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Network"); +InspectorBackend.registerEvent("Network.resourceLoaded", []); +InspectorBackend.registerCommand("Network.loadResource", [], []); +InspectorBackend.activateDomain("Network"); +### 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 definitions-with-mac-platform.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; +}; + + +class AlternateNetworkBackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateNetworkBackendDispatcher() { } + virtual void loadResource(long callId) = 0; +}; + +} // 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 definitions-with-mac-platform.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; + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +class AlternateNetworkBackendDispatcher; +#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + +class NetworkBackendDispatcherHandler { +public: + virtual void loadResource(ErrorString&) = 0; +protected: + virtual ~NetworkBackendDispatcherHandler(); +}; + +class NetworkBackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<NetworkBackendDispatcher> create(BackendDispatcher&, NetworkBackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void loadResource(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateNetworkBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateNetworkBackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + NetworkBackendDispatcher(BackendDispatcher&, NetworkBackendDispatcherHandler*); + NetworkBackendDispatcherHandler* m_agent { nullptr }; +}; + +} // 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 definitions-with-mac-platform.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 { + +NetworkBackendDispatcherHandler::~NetworkBackendDispatcherHandler() { } + +Ref<NetworkBackendDispatcher> NetworkBackendDispatcher::create(BackendDispatcher& backendDispatcher, NetworkBackendDispatcherHandler* agent) +{ + return adoptRef(*new NetworkBackendDispatcher(backendDispatcher, agent)); +} + +NetworkBackendDispatcher::NetworkBackendDispatcher(BackendDispatcher& backendDispatcher, NetworkBackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Network"), this); +} + +void NetworkBackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<NetworkBackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "loadResource") + loadResource(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Network", '.', method, "' was not found")); +} + +void NetworkBackendDispatcher::loadResource(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +} // 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 definitions-with-mac-platform.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; + +class NetworkFrontendDispatcher { +public: + NetworkFrontendDispatcher(FrontendRouter& frontendRouter) : m_frontendRouter(frontendRouter) { } + void resourceLoaded(); +private: + FrontendRouter& m_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 definitions-with-mac-platform.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 { + +void NetworkFrontendDispatcher::resourceLoaded() +{ + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network.resourceLoaded")); + + m_frontendRouter.sendEvent(jsonMessage->toJSONString()); +} + +} // 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 definitions-with-mac-platform.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 Network { +class NetworkError; +} // Network +// End of forward declarations. + + + + +namespace Network { +class NetworkError : public Inspector::InspectorObjectBase { +public: + enum { + NoFieldsSet = 0, + MessageSet = 1 << 0, + CodeSet = 1 << 1, + AllFieldsSet = (MessageSet | CodeSet) + }; + + 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</*NetworkError*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class NetworkError; + public: + + Builder<STATE | MessageSet>& setMessage(const String& value) + { + COMPILE_ASSERT(!(STATE & MessageSet), property_message_already_set); + m_result->setString(ASCIILiteral("message"), value); + return castState<MessageSet>(); + } + + Builder<STATE | CodeSet>& setCode(int value) + { + COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); + m_result->setInteger(ASCIILiteral("code"), value); + return castState<CodeSet>(); + } + + Ref<NetworkError> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(NetworkError) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<NetworkError>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<NetworkError> result = NetworkError::create() + * .setMessage(...) + * .setCode(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } +}; + +} // Network + + + +} // 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 definitions-with-mac-platform.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 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h> +#include <wtf/RetainPtr.h> + +@protocol TestProtocolNetworkDomainHandler; + +namespace Inspector { + + +class ObjCInspectorNetworkBackendDispatcher final : public AlternateNetworkBackendDispatcher { +public: + ObjCInspectorNetworkBackendDispatcher(id<TestProtocolNetworkDomainHandler> handler) { m_delegate = handler; } + virtual void loadResource(long requestId) override; +private: + RetainPtr<id<TestProtocolNetworkDomainHandler>> m_delegate; +}; + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 definitions-with-mac-platform.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 { + +void ObjCInspectorNetworkBackendDispatcher::loadResource(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResourceWithErrorCallback:errorCallback successCallback:successCallback]; +} + + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <WebInspector/TestProtocol.h> + +__attribute__((visibility ("default"))) +@interface TestProtocolConfiguration : NSObject +@property (nonatomic, retain, setter=setNetworkHandler:) id<TestProtocolNetworkDomainHandler> networkHandler; +@property (nonatomic, readonly) TestProtocolNetworkDomainEventDispatcher *networkEventDispatcher; +@end + + +### End File: TestProtocolConfiguration.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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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; + id<TestProtocolNetworkDomainHandler> _networkHandler; + TestProtocolNetworkDomainEventDispatcher *_networkEventDispatcher; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)dealloc +{ + [_networkHandler release]; + [_networkEventDispatcher release]; + [super dealloc]; +} + +- (void)setNetworkHandler:(id<TestProtocolNetworkDomainHandler>)handler +{ + if (handler == _networkHandler) + return; + + [_networkHandler release]; + _networkHandler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorNetworkBackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<NetworkBackendDispatcher, AlternateNetworkBackendDispatcher>>(ASCIILiteral("Network"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolNetworkDomainHandler>)networkHandler +{ + return _networkHandler; +} + +- (TestProtocolNetworkDomainEventDispatcher *)networkEventDispatcher +{ + if (!_networkEventDispatcher) + _networkEventDispatcher = [[TestProtocolNetworkDomainEventDispatcher alloc] initWithController:_controller]; + return _networkEventDispatcher; +} + +@end + + +### End File: TestProtocolConfiguration.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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <JavaScriptCore/InspectorValues.h> + +using namespace Inspector; + +@implementation TestProtocolNetworkDomainEventDispatcher +{ + AugmentableInspectorController* _controller; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller; +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)resourceLoaded +{ + const FrontendRouter& router = _controller->frontendRouter(); + + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network.resourceLoaded")); + router.sendEvent(jsonMessage->toJSONString()); +} + +@end + + +### 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + +@class TestProtocolNetworkError; + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + +__attribute__((visibility ("default"))) +@interface TestProtocolNetworkError : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithMessage:(NSString *)message code:(int)code; +/* required */ @property (nonatomic, copy) NSString *message; +/* required */ @property (nonatomic, assign) int code; +@end + +@protocol TestProtocolNetworkDomainHandler <NSObject> +@required +- (void)loadResourceWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +@end + +__attribute__((visibility ("default"))) +@interface TestProtocolNetworkDomainEventDispatcher : NSObject +- (void)resourceLoaded; +@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 definitions-with-mac-platform.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> + +@interface TestProtocolNetworkDomainEventDispatcher (Private) +- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller; +@end + + +### 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 definitions-with-mac-platform.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + + +} // 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (NetworkDomain) + ++ (void)_parseNetworkError:(TestProtocolNetworkError **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (NetworkDomain) + ++ (void)_parseNetworkError:(TestProtocolNetworkError **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolNetworkError 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +@implementation TestProtocolNetworkError + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"message"], @"message"); + self.message = payload[@"message"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"code"], @"code"); + self.code = [payload[@"code"] integerValue]; + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithMessage:(NSString *)message code:(int)code +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(message, @"message"); + + self.message = message; + self.code = code; + + return self; +} + +- (void)setMessage:(NSString *)message +{ + [super setString:message forKey:@"message"]; +} + +- (NSString *)message +{ + return [super stringForKey:@"message"]; +} + +- (void)setCode:(int)code +{ + [super setInteger:code forKey:@"code"]; +} + +- (int)code +{ + return [super integerForKey:@"code"]; +} + +@end + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/commands-with-async-attribute.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/commands-with-async-attribute.json new file mode 100644 index 000000000..11262e889 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/commands-with-async-attribute.json @@ -0,0 +1,109 @@ +{ + "domain": "Database", + "types": [ + { + "id": "DatabaseId", + "type": "integer", + "description": "Unique identifier of Database object." + }, + { + "id": "PrimaryColors", + "type": "string", + "enum": ["red", "green", "blue"] + }, + { + "id": "ColorList", + "type": "array", + "items": { "$ref": "PrimaryColors" } + }, + { + "id": "Error", + "type": "object", + "description": "Database error.", + "properties": [ + { "name": "message", "type": "string", "description": "Error message." }, + { "name": "code", "type": "integer", "description": "Error code." } + ] + } + ], + "commands": [ + { + "name": "executeSQLSyncOptionalReturnValues", + "parameters": [ + { "name": "databaseId", "$ref": "DatabaseId" }, + { "name": "query", "type": "string" } + ], + "returns": [ + { "name": "columnNames", "type": "array", "optional": true, "items": { "type": "string" } }, + { "name": "notes", "type": "string", "optional": true }, + { "name": "timestamp", "type": "number", "optional": true }, + { "name": "values", "type": "object", "optional": true }, + { "name": "payload", "type": "any", "optional": true }, + { "name": "databaseId", "$ref": "DatabaseId", "optional": true }, + { "name": "sqlError", "$ref": "Error", "optional": true }, + { "name": "screenColor", "$ref": "PrimaryColors", "optional": true }, + { "name": "alternateColors", "$ref": "ColorList", "optional": true }, + { "name": "printColor", "type": "string", "enum": ["cyan", "magenta", "yellow", "black"], "optional": true } + ] + }, + { + "name": "executeSQLAsyncOptionalReturnValues", + "async": true, + "parameters": [ + { "name": "databaseId", "$ref": "DatabaseId" }, + { "name": "query", "type": "string" } + ], + "returns": [ + { "name": "columnNames", "type": "array", "optional": true, "items": { "type": "string" } }, + { "name": "notes", "type": "string", "optional": true }, + { "name": "timestamp", "type": "number", "optional": true }, + { "name": "values", "type": "object", "optional": true }, + { "name": "payload", "type": "any", "optional": true }, + { "name": "databaseId", "$ref": "DatabaseId", "optional": true }, + { "name": "sqlError", "$ref": "Error", "optional": true }, + { "name": "screenColor", "$ref": "PrimaryColors", "optional": true }, + { "name": "alternateColors", "$ref": "ColorList", "optional": true }, + { "name": "printColor", "type": "string", "enum": ["cyan", "magenta", "yellow", "black"], "optional": true } + ] + }, + { + "name": "executeSQLSync", + "parameters": [ + { "name": "databaseId", "$ref": "DatabaseId" }, + { "name": "query", "type": "string" } + ], + "returns": [ + { "name": "columnNames", "type": "array", "items": { "type": "string" } }, + { "name": "notes", "type": "string" }, + { "name": "timestamp", "type": "number" }, + { "name": "values", "type": "object" }, + { "name": "payload", "type": "any" }, + { "name": "databaseId", "$ref": "DatabaseId" }, + { "name": "sqlError", "$ref": "Error" }, + { "name": "alternateColors", "$ref": "ColorList" }, + { "name": "screenColor", "$ref": "PrimaryColors" }, + { "name": "printColor", "type": "string", "enum": ["cyan", "magenta", "yellow", "black"] } + ] + }, + { + "name": "executeSQLAsync", + "async": true, + "parameters": [ + { "name": "databaseId", "$ref": "DatabaseId" }, + { "name": "query", "type": "string" } + ], + "returns": [ + { "name": "columnNames", "type": "array", "items": { "type": "string" } }, + { "name": "notes", "type": "string" }, + { "name": "timestamp", "type": "number" }, + { "name": "values", "type": "object" }, + { "name": "payload", "type": "any" }, + { "name": "databaseId", "$ref": "DatabaseId" }, + { "name": "sqlError", "$ref": "Error" }, + { "name": "screenColor", "$ref": "PrimaryColors" }, + { "name": "alternateColors", "$ref": "ColorList" }, + { "name": "printColor", "type": "string", "enum": ["cyan", "magenta", "yellow", "black"] } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/commands-with-optional-call-return-parameters.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/commands-with-optional-call-return-parameters.json new file mode 100644 index 000000000..361d57d82 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/commands-with-optional-call-return-parameters.json @@ -0,0 +1,85 @@ +{ + "domain": "Database", + "types": [ + { + "id": "DatabaseId", + "type": "integer", + "description": "Unique identifier of Database object." + }, + { + "id": "PrimaryColors", + "type": "string", + "enum": ["red", "green", "blue"] + }, + { + "id": "ColorList", + "type": "array", + "items": { "$ref": "PrimaryColors" } + }, + { + "id": "Error", + "type": "object", + "description": "Database error.", + "properties": [ + { "name": "message", "type": "string", "description": "Error message." }, + { "name": "code", "type": "integer", "description": "Error code." } + ] + } + ], + "commands": [ + { + "name": "executeAllOptionalParameters", + "parameters": [ + { "name": "columnNames", "type": "array", "optional": true, "items": { "type": "string" } }, + { "name": "notes", "type": "string", "optional": true }, + { "name": "timestamp", "type": "number", "optional": true }, + { "name": "values", "type": "object", "optional": true }, + { "name": "payload", "type": "any", "optional": true }, + { "name": "databaseId", "$ref": "DatabaseId", "optional": true }, + { "name": "sqlError", "$ref": "Error", "optional": true }, + { "name": "screenColor", "$ref": "PrimaryColors", "optional": true }, + { "name": "alternateColors", "$ref": "ColorList", "optional": true }, + { "name": "printColor", "type": "string", "enum": ["cyan", "magenta", "yellow", "black"], "optional": true } + ], + "returns": [ + { "name": "columnNames", "type": "array", "optional": true, "items": { "type": "string" } }, + { "name": "notes", "type": "string", "optional": true }, + { "name": "timestamp", "type": "number", "optional": true }, + { "name": "values", "type": "object", "optional": true }, + { "name": "payload", "type": "any", "optional": true }, + { "name": "databaseId", "$ref": "DatabaseId", "optional": true }, + { "name": "sqlError", "$ref": "Error", "optional": true }, + { "name": "screenColor", "$ref": "PrimaryColors", "optional": true }, + { "name": "alternateColors", "$ref": "ColorList", "optional": true }, + { "name": "printColor", "type": "string", "enum": ["cyan", "magenta", "yellow", "black"], "optional": true } + ] + }, + { + "name": "executeNoOptionalParameters", + "parameters": [ + { "name": "columnNames", "type": "array", "items": { "type": "string" } }, + { "name": "notes", "type": "string" }, + { "name": "timestamp", "type": "number" }, + { "name": "values", "type": "object" }, + { "name": "payload", "type": "any" }, + { "name": "databaseId", "$ref": "DatabaseId" }, + { "name": "sqlError", "$ref": "Error" }, + { "name": "screenColor", "$ref": "PrimaryColors" }, + { "name": "alternateColors", "$ref": "ColorList" }, + { "name": "printColor", "type": "string", "enum": ["cyan", "magenta", "yellow", "black"] } + ], + "returns": [ + { "name": "columnNames", "type": "array", "items": { "type": "string" } }, + { "name": "notes", "type": "string" }, + { "name": "timestamp", "type": "number" }, + { "name": "values", "type": "object" }, + { "name": "payload", "type": "any" }, + { "name": "databaseId", "$ref": "DatabaseId" }, + { "name": "sqlError", "$ref": "Error" }, + { "name": "screenColor", "$ref": "PrimaryColors" }, + { "name": "alternateColors", "$ref": "ColorList" }, + { "name": "printColor", "type": "string", "enum": ["cyan", "magenta", "yellow", "black"] } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/definitions-with-mac-platform.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/definitions-with-mac-platform.json new file mode 100644 index 000000000..817f135ee --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/definitions-with-mac-platform.json @@ -0,0 +1,28 @@ +{ + "domain": "Network", + "types": [ + { + "id": "NetworkError", + "type": "object", + "platform": "macos", + "properties": [ + { "name": "message", "type": "string", "description": "Error message." }, + { "name": "code", "type": "integer", "description": "Error code." } + ] + } + ], + "commands": [ + { + "name": "loadResource", + "platform": "macos", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + } + ], + "events": [ + { + "name": "resourceLoaded", + "platform": "macos", + "description": "A resource was loaded." + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-availability.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-availability.json new file mode 100644 index 000000000..5939996e3 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-availability.json @@ -0,0 +1,11 @@ +[ +{ + "domain": "DomainA", + "availability": "web", + "commands": [{"name": "enable"}] +}, +{ + "domain": "DomainB", + "commands": [{"name": "enable"}] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/domains-with-varying-command-sizes.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/domains-with-varying-command-sizes.json new file mode 100644 index 000000000..94a8ecb17 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/domains-with-varying-command-sizes.json @@ -0,0 +1,54 @@ +[ +{ + "domain": "Network1", + "commands": [ + { + "name": "loadResource1", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + } + ] +}, +{ + "domain": "Network2", + "types": [ + { + "id": "LoaderId", + "type": "string", + "description": "Unique loader identifier." + } + ] +}, +{ + "domain": "Network3", + "commands": [ + { + "name": "loadResource1", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + }, + { + "name": "loadResource2", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + }, + { + "name": "loadResource3", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + }, + { + "name": "loadResource4", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + }, + { + "name": "loadResource5", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + }, + { + "name": "loadResource6", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + }, + { + "name": "loadResource7", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/enum-values.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/enum-values.json new file mode 100644 index 000000000..cdad61df7 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/enum-values.json @@ -0,0 +1,35 @@ +{"domains":[ +{ + "domain": "TypeDomain", + "types": [ + { + "id": "TypeDomainEnum", + "type": "string", + "enum": ["shared", "red", "green", "blue"] + } + ] +}, +{ + "domain": "CommandDomain", + "commands": [ + { + "name": "commandWithEnumReturnValue", + "parameters": [], + "returns": [ + { "name": "returnValue", "type": "string", "enum": ["shared", "cyan", "magenta", "yellow"] } + ] + } + ] +}, +{ + "domain": "EventDomain", + "events": [ + { + "name": "eventWithEnumParameter", + "parameters": [ + { "name": "parameter", "type": "string", "enum": ["shared", "black", "white"] } + ] + } + ] +} +]} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/events-with-optional-parameters.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/events-with-optional-parameters.json new file mode 100644 index 000000000..cabbf10b8 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/events-with-optional-parameters.json @@ -0,0 +1,59 @@ +{ + "domain": "Database", + "types": [ + { + "id": "DatabaseId", + "type": "string", + "description": "Unique identifier of Database object." + }, + { + "id": "PrimaryColors", + "type": "string", + "values": ["red", "green", "blue"] + }, + { + "id": "ColorList", + "type": "array", + "items": { "$ref": "PrimaryColors" } + }, + { + "id": "Error", + "type": "object", + "description": "Database error.", + "properties": [ + { "name": "message", "type": "string", "description": "Error message." }, + { "name": "code", "type": "integer", "description": "Error code." } + ] + } + ], + "events": [ + { + "name": "didExecuteOptionalParameters", + "parameters": [ + { "name": "columnNames", "type": "array", "optional": true, "items": { "type": "string" } }, + { "name": "notes", "type": "string", "optional": true }, + { "name": "timestamp", "type": "number", "optional": true }, + { "name": "values", "type": "object", "optional": true }, + { "name": "payload", "type": "any", "optional": true }, + { "name": "sqlError", "$ref": "Error", "optional": true }, + { "name": "screenColor", "$ref": "PrimaryColors", "optional": true }, + { "name": "alternateColors", "$ref": "ColorList", "optional": true }, + { "name": "printColor", "type": "string", "values": ["cyan", "magenta", "yellow", "black"], "optional": true } + ] + }, + { + "name": "didExecuteNoOptionalParameters", + "parameters": [ + { "name": "columnNames", "type": "array", "items": { "type": "string" } }, + { "name": "notes", "type": "string" }, + { "name": "timestamp", "type": "number" }, + { "name": "values", "type": "object" }, + { "name": "payload", "type": "any" }, + { "name": "sqlError", "$ref": "Error" }, + { "name": "screenColor", "$ref": "PrimaryColors" }, + { "name": "alternateColors", "$ref": "ColorList" }, + { "name": "printColor", "type": "string", "values": ["cyan", "magenta", "yellow", "black"] } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result new file mode 100644 index 000000000..ef9a2488d --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result @@ -0,0 +1,1780 @@ +### 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 commands-with-async-attribute.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// Database. +InspectorBackend.registerDatabaseDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Database"); +InspectorBackend.registerEnum("Database.PrimaryColors", {Red: "red", Green: "green", Blue: "blue"}); +InspectorBackend.registerCommand("Database.executeSQLSyncOptionalReturnValues", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]); +InspectorBackend.registerCommand("Database.executeSQLAsyncOptionalReturnValues", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]); +InspectorBackend.registerCommand("Database.executeSQLSync", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "alternateColors", "screenColor", "printColor"]); +InspectorBackend.registerCommand("Database.executeSQLAsync", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]); +InspectorBackend.activateDomain("Database"); +### 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 commands-with-async-attribute.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; +}; + + +class AlternateDatabaseBackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateDatabaseBackendDispatcher() { } + virtual void executeSQLSyncOptionalReturnValues(long callId, int in_databaseId, const String& in_query) = 0; + virtual void executeSQLAsyncOptionalReturnValues(long callId, int in_databaseId, const String& in_query) = 0; + virtual void executeSQLSync(long callId, int in_databaseId, const String& in_query) = 0; + virtual void executeSQLAsync(long callId, int in_databaseId, const String& in_query) = 0; +}; + +} // 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 commands-with-async-attribute.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; + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +class AlternateDatabaseBackendDispatcher; +#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + +class DatabaseBackendDispatcherHandler { +public: + // Named after parameter 'printColor' while generating command/event executeSQLSyncOptionalReturnValues. + enum class PrintColor { + Cyan = 3, + Magenta = 4, + Yellow = 5, + Black = 6, + }; // enum class PrintColor + virtual void executeSQLSyncOptionalReturnValues(ErrorString&, int in_databaseId, const String& in_query, RefPtr<Inspector::Protocol::Array<String>>& opt_out_columnNames, Inspector::Protocol::OptOutput<String>* opt_out_notes, Inspector::Protocol::OptOutput<double>* opt_out_timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* opt_out_values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* opt_out_payload, Inspector::Protocol::OptOutput<int>* opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& opt_out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0; + class ExecuteSQLAsyncOptionalReturnValuesCallback : public BackendDispatcher::CallbackBase { + public: + ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<BackendDispatcher>&&, int id); + void sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, Inspector::Protocol::OptOutput<String>* notes, Inspector::Protocol::OptOutput<double>* timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* payload, Inspector::Protocol::OptOutput<int>* databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Inspector::Protocol::OptOutput<String>* screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Inspector::Protocol::OptOutput<String>* printColor); + }; + virtual void executeSQLAsyncOptionalReturnValues(ErrorString&, int in_databaseId, const String& in_query, Ref<ExecuteSQLAsyncOptionalReturnValuesCallback>&& callback) = 0; + virtual void executeSQLSync(ErrorString&, int in_databaseId, const String& in_query, RefPtr<Inspector::Protocol::Array<String>>& out_columnNames, String* out_notes, double* out_timestamp, Inspector::InspectorObject* out_values, Inspector::InspectorValue* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, RefPtr<Inspector::Protocol::Database::ColorList>& out_alternateColors, Inspector::Protocol::Database::PrimaryColors* out_screenColor, DatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0; + class ExecuteSQLAsyncCallback : public BackendDispatcher::CallbackBase { + public: + ExecuteSQLAsyncCallback(Ref<BackendDispatcher>&&, int id); + void sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, const String& notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, const String& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, const String& printColor); + }; + virtual void executeSQLAsync(ErrorString&, int in_databaseId, const String& in_query, Ref<ExecuteSQLAsyncCallback>&& callback) = 0; +protected: + virtual ~DatabaseBackendDispatcherHandler(); +}; + +class DatabaseBackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<DatabaseBackendDispatcher> create(BackendDispatcher&, DatabaseBackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void executeSQLSyncOptionalReturnValues(long requestId, RefPtr<InspectorObject>&& parameters); + void executeSQLAsyncOptionalReturnValues(long requestId, RefPtr<InspectorObject>&& parameters); + void executeSQLSync(long requestId, RefPtr<InspectorObject>&& parameters); + void executeSQLAsync(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateDatabaseBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateDatabaseBackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + DatabaseBackendDispatcher(BackendDispatcher&, DatabaseBackendDispatcherHandler*); + DatabaseBackendDispatcherHandler* m_agent { nullptr }; +}; + +} // 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 commands-with-async-attribute.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 { + +DatabaseBackendDispatcherHandler::~DatabaseBackendDispatcherHandler() { } + +Ref<DatabaseBackendDispatcher> DatabaseBackendDispatcher::create(BackendDispatcher& backendDispatcher, DatabaseBackendDispatcherHandler* agent) +{ + return adoptRef(*new DatabaseBackendDispatcher(backendDispatcher, agent)); +} + +DatabaseBackendDispatcher::DatabaseBackendDispatcher(BackendDispatcher& backendDispatcher, DatabaseBackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Database"), this); +} + +void DatabaseBackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<DatabaseBackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "executeSQLSyncOptionalReturnValues") + executeSQLSyncOptionalReturnValues(requestId, WTFMove(parameters)); + else if (method == "executeSQLAsyncOptionalReturnValues") + executeSQLAsyncOptionalReturnValues(requestId, WTFMove(parameters)); + else if (method == "executeSQLSync") + executeSQLSync(requestId, WTFMove(parameters)); + else if (method == "executeSQLAsync") + executeSQLAsync(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Database", '.', method, "' was not found")); +} + +void DatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long requestId, RefPtr<InspectorObject>&& parameters) +{ + int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr); + String in_query = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("query"), nullptr); + if (m_backendDispatcher->hasProtocolErrors()) { + m_backendDispatcher->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLSyncOptionalReturnValues")); + return; + } + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->executeSQLSyncOptionalReturnValues(requestId, in_databaseId, in_query); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + RefPtr<Inspector::Protocol::Array<String>> out_columnNames; + Inspector::Protocol::OptOutput<String> out_notes; + Inspector::Protocol::OptOutput<double> out_timestamp; + Inspector::Protocol::OptOutput<Inspector::InspectorObject> out_values; + Inspector::Protocol::OptOutput<Inspector::InspectorValue> out_payload; + Inspector::Protocol::OptOutput<Inspector::Protocol::Database::DatabaseId> out_databaseId; + RefPtr<Inspector::Protocol::Database::Error> out_sqlError; + Inspector::Protocol::Database::PrimaryColors out_screenColor; + RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors; + DatabaseBackendDispatcherHandler::PrintColor out_printColor; + m_agent->executeSQLSyncOptionalReturnValues(error, in_databaseId, in_query, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, out_alternateColors, &out_printColor); + + if (!error.length()) { + if (out_columnNames) + result->setArray(ASCIILiteral("columnNames"), out_columnNames); + if (out_notes.isAssigned()) + result->setString(ASCIILiteral("notes"), out_notes.getValue()); + if (out_timestamp.isAssigned()) + result->setDouble(ASCIILiteral("timestamp"), out_timestamp.getValue()); + if (out_values.isAssigned()) + result->setObject(ASCIILiteral("values"), out_values.getValue()); + if (out_payload.isAssigned()) + result->setValue(ASCIILiteral("payload"), out_payload.getValue()); + if (out_databaseId.isAssigned()) + result->setInteger(ASCIILiteral("databaseId"), out_databaseId.getValue()); + if (out_sqlError) + result->setObject(ASCIILiteral("sqlError"), out_sqlError); + if (out_screenColor.isAssigned()) + result->setString(ASCIILiteral("screenColor"), out_screenColor.getValue()); + if (out_alternateColors) + result->setArray(ASCIILiteral("alternateColors"), out_alternateColors); + if (out_printColor.isAssigned()) + result->setString(ASCIILiteral("printColor"), out_printColor.getValue()); + } + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<BackendDispatcher>&& backendDispatcher, int id) : BackendDispatcher::CallbackBase(WTFMove(backendDispatcher), id) { } + +void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, Inspector::Protocol::OptOutput<String>* notes, Inspector::Protocol::OptOutput<double>* timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* payload, Inspector::Protocol::OptOutput<int>* databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Inspector::Protocol::OptOutput<String>* screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Inspector::Protocol::OptOutput<String>* printColor) +{ + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + if (columnNames) + jsonMessage->setArray(ASCIILiteral("columnNames"), columnNames); + if (notes.isAssigned()) + jsonMessage->setString(ASCIILiteral("notes"), notes.getValue()); + if (timestamp.isAssigned()) + jsonMessage->setDouble(ASCIILiteral("timestamp"), timestamp.getValue()); + if (values.isAssigned()) + jsonMessage->setObject(ASCIILiteral("values"), values.getValue()); + if (payload.isAssigned()) + jsonMessage->setValue(ASCIILiteral("payload"), payload.getValue()); + if (databaseId.isAssigned()) + jsonMessage->setInteger(ASCIILiteral("databaseId"), databaseId.getValue()); + if (sqlError) + jsonMessage->setObject(ASCIILiteral("sqlError"), sqlError); + if (screenColor.isAssigned()) + jsonMessage->setString(ASCIILiteral("screenColor"), screenColor.getValue()); + if (alternateColors) + jsonMessage->setArray(ASCIILiteral("alternateColors"), alternateColors); + if (printColor.isAssigned()) + jsonMessage->setString(ASCIILiteral("printColor"), printColor.getValue()); + CallbackBase::sendSuccess(WTFMove(jsonMessage)); +} + +void DatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long requestId, RefPtr<InspectorObject>&& parameters) +{ + int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr); + String in_query = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("query"), nullptr); + if (m_backendDispatcher->hasProtocolErrors()) { + m_backendDispatcher->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLAsyncOptionalReturnValues")); + return; + } + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->executeSQLAsyncOptionalReturnValues(requestId, in_databaseId, in_query); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + Ref<DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback> callback = adoptRef(*new DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback(m_backendDispatcher.copyRef(), requestId)); + m_agent->executeSQLAsyncOptionalReturnValues(error, in_databaseId, in_query, callback.copyRef()); + + if (error.length()) { + callback->disable(); + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, error); + return; + } +} + +void DatabaseBackendDispatcher::executeSQLSync(long requestId, RefPtr<InspectorObject>&& parameters) +{ + int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr); + String in_query = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("query"), nullptr); + if (m_backendDispatcher->hasProtocolErrors()) { + m_backendDispatcher->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLSync")); + return; + } + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->executeSQLSync(requestId, in_databaseId, in_query); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + RefPtr<Inspector::Protocol::Array<String>> out_columnNames; + String out_notes; + double out_timestamp; + Inspector::InspectorObject out_values; + Inspector::InspectorValue out_payload; + Inspector::Protocol::Database::DatabaseId out_databaseId; + RefPtr<Inspector::Protocol::Database::Error> out_sqlError; + RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors; + Inspector::Protocol::Database::PrimaryColors out_screenColor; + DatabaseBackendDispatcherHandler::PrintColor out_printColor; + m_agent->executeSQLSync(error, in_databaseId, in_query, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, out_alternateColors, &out_screenColor, &out_printColor); + + if (!error.length()) { + result->setArray(ASCIILiteral("columnNames"), out_columnNames); + result->setString(ASCIILiteral("notes"), out_notes); + result->setDouble(ASCIILiteral("timestamp"), out_timestamp); + result->setObject(ASCIILiteral("values"), out_values); + result->setValue(ASCIILiteral("payload"), out_payload); + result->setInteger(ASCIILiteral("databaseId"), out_databaseId); + result->setObject(ASCIILiteral("sqlError"), out_sqlError); + result->setArray(ASCIILiteral("alternateColors"), out_alternateColors); + result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_screenColor)); + result->setString(ASCIILiteral("printColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_printColor)); + } + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::ExecuteSQLAsyncCallback(Ref<BackendDispatcher>&& backendDispatcher, int id) : BackendDispatcher::CallbackBase(WTFMove(backendDispatcher), id) { } + +void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, const String& notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, const String& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, const String& printColor) +{ + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setArray(ASCIILiteral("columnNames"), columnNames); + jsonMessage->setString(ASCIILiteral("notes"), notes); + jsonMessage->setDouble(ASCIILiteral("timestamp"), timestamp); + jsonMessage->setObject(ASCIILiteral("values"), values); + jsonMessage->setValue(ASCIILiteral("payload"), payload); + jsonMessage->setInteger(ASCIILiteral("databaseId"), databaseId); + jsonMessage->setObject(ASCIILiteral("sqlError"), sqlError); + jsonMessage->setString(ASCIILiteral("screenColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(screenColor)); + jsonMessage->setArray(ASCIILiteral("alternateColors"), alternateColors); + jsonMessage->setString(ASCIILiteral("printColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(printColor)); + CallbackBase::sendSuccess(WTFMove(jsonMessage)); +} + +void DatabaseBackendDispatcher::executeSQLAsync(long requestId, RefPtr<InspectorObject>&& parameters) +{ + int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr); + String in_query = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("query"), nullptr); + if (m_backendDispatcher->hasProtocolErrors()) { + m_backendDispatcher->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLAsync")); + return; + } + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->executeSQLAsync(requestId, in_databaseId, in_query); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + Ref<DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback> callback = adoptRef(*new DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback(m_backendDispatcher.copyRef(), requestId)); + m_agent->executeSQLAsync(error, in_databaseId, in_query, callback.copyRef()); + + if (error.length()) { + callback->disable(); + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, error); + return; + } +} + +} // 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 commands-with-async-attribute.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 commands-with-async-attribute.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 commands-with-async-attribute.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 Database { +class Error; +enum class PrimaryColors; +} // Database +// End of forward declarations. + + +// Typedefs. +namespace Database { +/* Unique identifier of Database object. */ +typedef int DatabaseId; +typedef Inspector::Protocol::Array<Inspector::Protocol::Database::PrimaryColors> ColorList; +} // Database +// 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 Database { +/* */ +enum class PrimaryColors { + Red = 0, + Green = 1, + Blue = 2, +}; // enum class PrimaryColors +/* Database error. */ +class Error : public Inspector::InspectorObjectBase { +public: + enum { + NoFieldsSet = 0, + MessageSet = 1 << 0, + CodeSet = 1 << 1, + AllFieldsSet = (MessageSet | CodeSet) + }; + + 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</*Error*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class Error; + public: + + Builder<STATE | MessageSet>& setMessage(const String& value) + { + COMPILE_ASSERT(!(STATE & MessageSet), property_message_already_set); + m_result->setString(ASCIILiteral("message"), value); + return castState<MessageSet>(); + } + + Builder<STATE | CodeSet>& setCode(int value) + { + COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); + m_result->setInteger(ASCIILiteral("code"), value); + return castState<CodeSet>(); + } + + Ref<Error> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(Error) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<Error>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<Error> result = Error::create() + * .setMessage(...) + * .setCode(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } +}; + +} // Database + + + +namespace TestHelpers { + +template<typename ProtocolEnumType> +std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); + +// Enums in the 'Database' Domain +template<> +std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(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 commands-with-async-attribute.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[] = { + "red", + "green", + "blue", + "cyan", + "magenta", + "yellow", + "black", +}; + +String getEnumConstantValue(int code) { + return enum_constant_values[code]; +} + +// Enums in the 'Database' Domain +template<> +std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString) +{ + static const size_t constantValues[] = { + (size_t)Inspector::Protocol::Database::PrimaryColors::Red, + (size_t)Inspector::Protocol::Database::PrimaryColors::Green, + (size_t)Inspector::Protocol::Database::PrimaryColors::Blue, + }; + for (size_t i = 0; i < 3; ++i) + if (protocolString == enum_constant_values[constantValues[i]]) + return (Inspector::Protocol::Database::PrimaryColors)constantValues[i]; + + return std::nullopt; +} + + +} // namespace TestHelpers + + + +} // 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 commands-with-async-attribute.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h> +#include <wtf/RetainPtr.h> + +@protocol TestProtocolDatabaseDomainHandler; + +namespace Inspector { + + +class ObjCInspectorDatabaseBackendDispatcher final : public AlternateDatabaseBackendDispatcher { +public: + ObjCInspectorDatabaseBackendDispatcher(id<TestProtocolDatabaseDomainHandler> handler) { m_delegate = handler; } + virtual void executeSQLSyncOptionalReturnValues(long requestId, int in_databaseId, const String& in_query) override; + virtual void executeSQLAsyncOptionalReturnValues(long requestId, int in_databaseId, const String& in_query) override; + virtual void executeSQLSync(long requestId, int in_databaseId, const String& in_query) override; + virtual void executeSQLAsync(long requestId, int in_databaseId, const String& in_query) override; +private: + RetainPtr<id<TestProtocolDatabaseDomainHandler>> m_delegate; +}; + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 commands-with-async-attribute.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 { + +void ObjCInspectorDatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long requestId, int in_databaseId, const String& in_query) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor *printColor) { + Ref<InspectorObject> resultObject = InspectorObject::create(); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(payload, @"payload"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(sqlError, @"sqlError"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(alternateColors, @"alternateColors"); + if (columnNames) + resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(*columnNames)); + if (notes) + resultObject->setString(ASCIILiteral("notes"), *notes); + if (timestamp) + resultObject->setDouble(ASCIILiteral("timestamp"), *timestamp); + if (values) + resultObject->setObject(ASCIILiteral("values"), [*values toInspectorObject]); + if (payload) + resultObject->setValue(ASCIILiteral("payload"), [*payload toInspectorObject]); + if (databaseId) + resultObject->setInteger(ASCIILiteral("databaseId"), *databaseId); + if (sqlError) + resultObject->setObject(ASCIILiteral("sqlError"), [*sqlError toInspectorObject]); + if (screenColor) + resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(*screenColor)); + if (alternateColors) + resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(*alternateColors)); + if (printColor) + resultObject->setString(ASCIILiteral("printColor"), toProtocolString(*printColor)); + backendDispatcher()->sendResponse(requestId, WTFMove(resultObject)); + }; + + int o_in_databaseId = in_databaseId; + NSString *o_in_query = in_query; + + [m_delegate executeSQLSyncOptionalReturnValuesWithErrorCallback:errorCallback successCallback:successCallback databaseId:o_in_databaseId query:o_in_query]; +} + +void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long requestId, int in_databaseId, const String& in_query) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor *printColor) { + Ref<InspectorObject> resultObject = InspectorObject::create(); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(payload, @"payload"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(sqlError, @"sqlError"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(alternateColors, @"alternateColors"); + if (columnNames) + resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(*columnNames)); + if (notes) + resultObject->setString(ASCIILiteral("notes"), *notes); + if (timestamp) + resultObject->setDouble(ASCIILiteral("timestamp"), *timestamp); + if (values) + resultObject->setObject(ASCIILiteral("values"), [*values toInspectorObject]); + if (payload) + resultObject->setValue(ASCIILiteral("payload"), [*payload toInspectorObject]); + if (databaseId) + resultObject->setInteger(ASCIILiteral("databaseId"), *databaseId); + if (sqlError) + resultObject->setObject(ASCIILiteral("sqlError"), [*sqlError toInspectorObject]); + if (screenColor) + resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(*screenColor)); + if (alternateColors) + resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(*alternateColors)); + if (printColor) + resultObject->setString(ASCIILiteral("printColor"), toProtocolString(*printColor)); + backendDispatcher()->sendResponse(requestId, WTFMove(resultObject)); + }; + + int o_in_databaseId = in_databaseId; + NSString *o_in_query = in_query; + + [m_delegate executeSQLAsyncOptionalReturnValuesWithErrorCallback:errorCallback successCallback:successCallback databaseId:o_in_databaseId query:o_in_query]; +} + +void ObjCInspectorDatabaseBackendDispatcher::executeSQLSync(long requestId, int in_databaseId, const String& in_query) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabasePrimaryColors screenColor, TestProtocolDatabaseExecuteSQLSyncPrintColor printColor) { + Ref<InspectorObject> resultObject = InspectorObject::create(); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(payload, @"payload"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(sqlError, @"sqlError"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(alternateColors, @"alternateColors"); + resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(columnNames)); + resultObject->setString(ASCIILiteral("notes"), notes); + resultObject->setDouble(ASCIILiteral("timestamp"), timestamp); + resultObject->setObject(ASCIILiteral("values"), [values toInspectorObject]); + resultObject->setValue(ASCIILiteral("payload"), [payload toInspectorObject]); + resultObject->setInteger(ASCIILiteral("databaseId"), databaseId); + resultObject->setObject(ASCIILiteral("sqlError"), [sqlError toInspectorObject]); + resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(alternateColors)); + resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(screenColor)); + resultObject->setString(ASCIILiteral("printColor"), toProtocolString(printColor)); + backendDispatcher()->sendResponse(requestId, WTFMove(resultObject)); + }; + + int o_in_databaseId = in_databaseId; + NSString *o_in_query = in_query; + + [m_delegate executeSQLSyncWithErrorCallback:errorCallback successCallback:successCallback databaseId:o_in_databaseId query:o_in_query]; +} + +void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsync(long requestId, int in_databaseId, const String& in_query) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, TestProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabaseExecuteSQLAsyncPrintColor printColor) { + Ref<InspectorObject> resultObject = InspectorObject::create(); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(payload, @"payload"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(sqlError, @"sqlError"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(alternateColors, @"alternateColors"); + resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(columnNames)); + resultObject->setString(ASCIILiteral("notes"), notes); + resultObject->setDouble(ASCIILiteral("timestamp"), timestamp); + resultObject->setObject(ASCIILiteral("values"), [values toInspectorObject]); + resultObject->setValue(ASCIILiteral("payload"), [payload toInspectorObject]); + resultObject->setInteger(ASCIILiteral("databaseId"), databaseId); + resultObject->setObject(ASCIILiteral("sqlError"), [sqlError toInspectorObject]); + resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(screenColor)); + resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(alternateColors)); + resultObject->setString(ASCIILiteral("printColor"), toProtocolString(printColor)); + backendDispatcher()->sendResponse(requestId, WTFMove(resultObject)); + }; + + int o_in_databaseId = in_databaseId; + NSString *o_in_query = in_query; + + [m_delegate executeSQLAsyncWithErrorCallback:errorCallback successCallback:successCallback databaseId:o_in_databaseId query:o_in_query]; +} + + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 commands-with-async-attribute.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <WebInspector/TestProtocol.h> + +__attribute__((visibility ("default"))) +@interface TestProtocolConfiguration : NSObject +@property (nonatomic, retain, setter=setDatabaseHandler:) id<TestProtocolDatabaseDomainHandler> databaseHandler; +@end + + +### End File: TestProtocolConfiguration.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 commands-with-async-attribute.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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; + id<TestProtocolDatabaseDomainHandler> _databaseHandler; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)dealloc +{ + [_databaseHandler release]; + [super dealloc]; +} + +- (void)setDatabaseHandler:(id<TestProtocolDatabaseDomainHandler>)handler +{ + if (handler == _databaseHandler) + return; + + [_databaseHandler release]; + _databaseHandler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorDatabaseBackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<DatabaseBackendDispatcher, AlternateDatabaseBackendDispatcher>>(ASCIILiteral("Database"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolDatabaseDomainHandler>)databaseHandler +{ + return _databaseHandler; +} + +@end + + +### End File: TestProtocolConfiguration.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 commands-with-async-attribute.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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 commands-with-async-attribute.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + +@class TestProtocolDatabaseError; + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + +typedef NS_ENUM(NSInteger, TestProtocolDatabasePrimaryColors) { + TestProtocolDatabasePrimaryColorsRed, + TestProtocolDatabasePrimaryColorsGreen, + TestProtocolDatabasePrimaryColorsBlue, +}; + +typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor) { + TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan, + TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorMagenta, + TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorYellow, + TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorBlack, +}; + +typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor) { + TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan, + TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorMagenta, + TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorYellow, + TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorBlack, +}; + +typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteSQLSyncPrintColor) { + TestProtocolDatabaseExecuteSQLSyncPrintColorCyan, + TestProtocolDatabaseExecuteSQLSyncPrintColorMagenta, + TestProtocolDatabaseExecuteSQLSyncPrintColorYellow, + TestProtocolDatabaseExecuteSQLSyncPrintColorBlack, +}; + +typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteSQLAsyncPrintColor) { + TestProtocolDatabaseExecuteSQLAsyncPrintColorCyan, + TestProtocolDatabaseExecuteSQLAsyncPrintColorMagenta, + TestProtocolDatabaseExecuteSQLAsyncPrintColorYellow, + TestProtocolDatabaseExecuteSQLAsyncPrintColorBlack, +}; + + +__attribute__((visibility ("default"))) +@interface TestProtocolDatabaseError : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithMessage:(NSString *)message code:(int)code; +/* required */ @property (nonatomic, copy) NSString *message; +/* required */ @property (nonatomic, assign) int code; +@end + +@protocol TestProtocolDatabaseDomainHandler <NSObject> +@required +- (void)executeSQLSyncOptionalReturnValuesWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor *printColor))successCallback databaseId:(int)databaseId query:(NSString *)query; +- (void)executeSQLAsyncOptionalReturnValuesWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor *printColor))successCallback databaseId:(int)databaseId query:(NSString *)query; +- (void)executeSQLSyncWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabasePrimaryColors screenColor, TestProtocolDatabaseExecuteSQLSyncPrintColor printColor))successCallback databaseId:(int)databaseId query:(NSString *)query; +- (void)executeSQLAsyncWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, TestProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabaseExecuteSQLAsyncPrintColor printColor))successCallback databaseId:(int)databaseId query:(NSString *)query; +@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 commands-with-async-attribute.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 commands-with-async-attribute.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + +inline String toProtocolString(TestProtocolDatabasePrimaryColors value) +{ + switch(value) { + case TestProtocolDatabasePrimaryColorsRed: + return ASCIILiteral("red"); + case TestProtocolDatabasePrimaryColorsGreen: + return ASCIILiteral("green"); + case TestProtocolDatabasePrimaryColorsBlue: + return ASCIILiteral("blue"); + } +} + +template<> +inline std::optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const String& value) +{ + if (value == "red") + return TestProtocolDatabasePrimaryColorsRed; + if (value == "green") + return TestProtocolDatabasePrimaryColorsGreen; + if (value == "blue") + return TestProtocolDatabasePrimaryColorsBlue; + return std::nullopt; +} + +inline String toProtocolString(TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor value) +{ + switch(value) { + case TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan: + return ASCIILiteral("cyan"); + case TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorMagenta: + return ASCIILiteral("magenta"); + case TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorYellow: + return ASCIILiteral("yellow"); + case TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorBlack: + return ASCIILiteral("black"); + } +} + +template<> +inline std::optional<TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor> fromProtocolString(const String& value) +{ + if (value == "cyan") + return TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan; + if (value == "magenta") + return TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorMagenta; + if (value == "yellow") + return TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorYellow; + if (value == "black") + return TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorBlack; + return std::nullopt; +} + +inline String toProtocolString(TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor value) +{ + switch(value) { + case TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan: + return ASCIILiteral("cyan"); + case TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorMagenta: + return ASCIILiteral("magenta"); + case TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorYellow: + return ASCIILiteral("yellow"); + case TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorBlack: + return ASCIILiteral("black"); + } +} + +template<> +inline std::optional<TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor> fromProtocolString(const String& value) +{ + if (value == "cyan") + return TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan; + if (value == "magenta") + return TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorMagenta; + if (value == "yellow") + return TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorYellow; + if (value == "black") + return TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorBlack; + return std::nullopt; +} + +inline String toProtocolString(TestProtocolDatabaseExecuteSQLSyncPrintColor value) +{ + switch(value) { + case TestProtocolDatabaseExecuteSQLSyncPrintColorCyan: + return ASCIILiteral("cyan"); + case TestProtocolDatabaseExecuteSQLSyncPrintColorMagenta: + return ASCIILiteral("magenta"); + case TestProtocolDatabaseExecuteSQLSyncPrintColorYellow: + return ASCIILiteral("yellow"); + case TestProtocolDatabaseExecuteSQLSyncPrintColorBlack: + return ASCIILiteral("black"); + } +} + +template<> +inline std::optional<TestProtocolDatabaseExecuteSQLSyncPrintColor> fromProtocolString(const String& value) +{ + if (value == "cyan") + return TestProtocolDatabaseExecuteSQLSyncPrintColorCyan; + if (value == "magenta") + return TestProtocolDatabaseExecuteSQLSyncPrintColorMagenta; + if (value == "yellow") + return TestProtocolDatabaseExecuteSQLSyncPrintColorYellow; + if (value == "black") + return TestProtocolDatabaseExecuteSQLSyncPrintColorBlack; + return std::nullopt; +} + +inline String toProtocolString(TestProtocolDatabaseExecuteSQLAsyncPrintColor value) +{ + switch(value) { + case TestProtocolDatabaseExecuteSQLAsyncPrintColorCyan: + return ASCIILiteral("cyan"); + case TestProtocolDatabaseExecuteSQLAsyncPrintColorMagenta: + return ASCIILiteral("magenta"); + case TestProtocolDatabaseExecuteSQLAsyncPrintColorYellow: + return ASCIILiteral("yellow"); + case TestProtocolDatabaseExecuteSQLAsyncPrintColorBlack: + return ASCIILiteral("black"); + } +} + +template<> +inline std::optional<TestProtocolDatabaseExecuteSQLAsyncPrintColor> fromProtocolString(const String& value) +{ + if (value == "cyan") + return TestProtocolDatabaseExecuteSQLAsyncPrintColorCyan; + if (value == "magenta") + return TestProtocolDatabaseExecuteSQLAsyncPrintColorMagenta; + if (value == "yellow") + return TestProtocolDatabaseExecuteSQLAsyncPrintColorYellow; + if (value == "black") + return TestProtocolDatabaseExecuteSQLAsyncPrintColorBlack; + return std::nullopt; +} + +} // 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 commands-with-async-attribute.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (DatabaseDomain) + ++ (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload; ++ (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload; ++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload; ++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (DatabaseDomain) + ++ (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]); + *outValue = (NSNumber *)payload; +} + ++ (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + std::optional<TestProtocolDatabasePrimaryColors> result = Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"PrimaryColors"); + *outValue = @(result.value()); +} + ++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]); + *outValue = (NSArray/*<NSString>*/ *)payload; +} + ++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolDatabaseError 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 commands-with-async-attribute.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +@implementation TestProtocolDatabaseError + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"message"], @"message"); + self.message = payload[@"message"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"code"], @"code"); + self.code = [payload[@"code"] integerValue]; + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithMessage:(NSString *)message code:(int)code +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(message, @"message"); + + self.message = message; + self.code = code; + + return self; +} + +- (void)setMessage:(NSString *)message +{ + [super setString:message forKey:@"message"]; +} + +- (NSString *)message +{ + return [super stringForKey:@"message"]; +} + +- (void)setCode:(int)code +{ + [super setInteger:code forKey:@"code"]; +} + +- (int)code +{ + return [super integerForKey:@"code"]; +} + +@end + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result new file mode 100644 index 000000000..4c9e42618 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result @@ -0,0 +1,1643 @@ +### 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 commands-with-optional-call-return-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// Database. +InspectorBackend.registerEnum("Database.PrimaryColors", {Red: "red", Green: "green", Blue: "blue"}); +InspectorBackend.registerCommand("Database.executeAllOptionalParameters", [{"name": "columnNames", "type": "object", "optional": true}, {"name": "notes", "type": "string", "optional": true}, {"name": "timestamp", "type": "number", "optional": true}, {"name": "values", "type": "object", "optional": true}, {"name": "payload", "type": "object", "optional": true}, {"name": "databaseId", "type": "number", "optional": true}, {"name": "sqlError", "type": "object", "optional": true}, {"name": "screenColor", "type": "string", "optional": true}, {"name": "alternateColors", "type": "object", "optional": true}, {"name": "printColor", "type": "string", "optional": true}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]); +InspectorBackend.registerCommand("Database.executeNoOptionalParameters", [{"name": "columnNames", "type": "object", "optional": false}, {"name": "notes", "type": "string", "optional": false}, {"name": "timestamp", "type": "number", "optional": false}, {"name": "values", "type": "object", "optional": false}, {"name": "payload", "type": "object", "optional": false}, {"name": "databaseId", "type": "number", "optional": false}, {"name": "sqlError", "type": "object", "optional": false}, {"name": "screenColor", "type": "string", "optional": false}, {"name": "alternateColors", "type": "object", "optional": false}, {"name": "printColor", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]); +InspectorBackend.activateDomain("Database"); +### 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 commands-with-optional-call-return-parameters.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; +}; + + +class AlternateDatabaseBackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateDatabaseBackendDispatcher() { } + virtual void executeAllOptionalParameters(long callId, const Inspector::InspectorArray* in_columnNames, const String* const in_notes, const double* const in_timestamp, const Inspector::InspectorObject* in_values, const Inspector::InspectorValue* const in_payload, const int* const in_databaseId, const Inspector::InspectorObject* in_sqlError, const String* const in_screenColor, const Inspector::InspectorArray* in_alternateColors, const String* const in_printColor) = 0; + virtual void executeNoOptionalParameters(long callId, const Inspector::InspectorArray& in_columnNames, const String& in_notes, double in_timestamp, const Inspector::InspectorObject& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const Inspector::InspectorObject& in_sqlError, const String& in_screenColor, const Inspector::InspectorArray& in_alternateColors, const String& in_printColor) = 0; +}; + +} // 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 commands-with-optional-call-return-parameters.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; + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +class AlternateDatabaseBackendDispatcher; +#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + +class DatabaseBackendDispatcherHandler { +public: + // Named after parameter 'printColor' while generating command/event executeAllOptionalParameters. + enum class PrintColor { + Cyan = 3, + Magenta = 4, + Yellow = 5, + Black = 6, + }; // enum class PrintColor + virtual void executeAllOptionalParameters(ErrorString&, const Inspector::InspectorArray* opt_in_columnNames, const String* const opt_in_notes, const double* const opt_in_timestamp, const Inspector::InspectorObject* opt_in_values, const Inspector::InspectorValue* const opt_in_payload, const int* const opt_in_databaseId, const Inspector::InspectorObject* opt_in_sqlError, const String* const opt_in_screenColor, const Inspector::InspectorArray* opt_in_alternateColors, const String* const opt_in_printColor, RefPtr<Inspector::Protocol::Array<String>>& opt_out_columnNames, Inspector::Protocol::OptOutput<String>* opt_out_notes, Inspector::Protocol::OptOutput<double>* opt_out_timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* opt_out_values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* opt_out_payload, Inspector::Protocol::OptOutput<int>* opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& opt_out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0; + virtual void executeNoOptionalParameters(ErrorString&, const Inspector::InspectorArray& in_columnNames, const String& in_notes, double in_timestamp, const Inspector::InspectorObject& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const Inspector::InspectorObject& in_sqlError, const String& in_screenColor, const Inspector::InspectorArray& in_alternateColors, const String& in_printColor, RefPtr<Inspector::Protocol::Array<String>>& out_columnNames, String* out_notes, double* out_timestamp, Inspector::InspectorObject* out_values, Inspector::InspectorValue* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, Inspector::Protocol::Database::PrimaryColors* out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0; +protected: + virtual ~DatabaseBackendDispatcherHandler(); +}; + +class DatabaseBackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<DatabaseBackendDispatcher> create(BackendDispatcher&, DatabaseBackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void executeAllOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters); + void executeNoOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateDatabaseBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateDatabaseBackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + DatabaseBackendDispatcher(BackendDispatcher&, DatabaseBackendDispatcherHandler*); + DatabaseBackendDispatcherHandler* m_agent { nullptr }; +}; + +} // 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 commands-with-optional-call-return-parameters.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 { + +DatabaseBackendDispatcherHandler::~DatabaseBackendDispatcherHandler() { } + +Ref<DatabaseBackendDispatcher> DatabaseBackendDispatcher::create(BackendDispatcher& backendDispatcher, DatabaseBackendDispatcherHandler* agent) +{ + return adoptRef(*new DatabaseBackendDispatcher(backendDispatcher, agent)); +} + +DatabaseBackendDispatcher::DatabaseBackendDispatcher(BackendDispatcher& backendDispatcher, DatabaseBackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Database"), this); +} + +void DatabaseBackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<DatabaseBackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "executeAllOptionalParameters") + executeAllOptionalParameters(requestId, WTFMove(parameters)); + else if (method == "executeNoOptionalParameters") + executeNoOptionalParameters(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Database", '.', method, "' was not found")); +} + +void DatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters) +{ + bool opt_in_columnNames_valueFound = false; + RefPtr<Inspector::InspectorArray> opt_in_columnNames = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("columnNames"), &opt_in_columnNames_valueFound); + bool opt_in_notes_valueFound = false; + String opt_in_notes = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("notes"), &opt_in_notes_valueFound); + bool opt_in_timestamp_valueFound = false; + Inspector::Protocol::OptOutput<double> opt_in_timestamp = m_backendDispatcher->getDouble(parameters.get(), ASCIILiteral("timestamp"), &opt_in_timestamp_valueFound); + bool opt_in_values_valueFound = false; + RefPtr<Inspector::InspectorObject> opt_in_values = m_backendDispatcher->getObject(parameters.get(), ASCIILiteral("values"), &opt_in_values_valueFound); + bool opt_in_payload_valueFound = false; + RefPtr<Inspector::InspectorValue> opt_in_payload = m_backendDispatcher->getValue(parameters.get(), ASCIILiteral("payload"), &opt_in_payload_valueFound); + bool opt_in_databaseId_valueFound = false; + int opt_in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), &opt_in_databaseId_valueFound); + bool opt_in_sqlError_valueFound = false; + RefPtr<Inspector::InspectorObject> opt_in_sqlError = m_backendDispatcher->getObject(parameters.get(), ASCIILiteral("sqlError"), &opt_in_sqlError_valueFound); + bool opt_in_screenColor_valueFound = false; + String opt_in_screenColor = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("screenColor"), &opt_in_screenColor_valueFound); + bool opt_in_alternateColors_valueFound = false; + RefPtr<Inspector::InspectorArray> opt_in_alternateColors = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("alternateColors"), &opt_in_alternateColors_valueFound); + bool opt_in_printColor_valueFound = false; + String opt_in_printColor = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("printColor"), &opt_in_printColor_valueFound); + if (m_backendDispatcher->hasProtocolErrors()) { + m_backendDispatcher->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Some arguments of method '%s' can't be processed", "Database.executeAllOptionalParameters")); + return; + } + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->executeAllOptionalParameters(requestId, opt_in_columnNames_valueFound ? opt_in_columnNames.get() : nullptr, opt_in_notes_valueFound ? &opt_in_notes : nullptr, opt_in_timestamp_valueFound ? &opt_in_timestamp : nullptr, opt_in_values_valueFound ? opt_in_values.get() : nullptr, opt_in_payload_valueFound ? opt_in_payload.get() : nullptr, opt_in_databaseId_valueFound ? &opt_in_databaseId : nullptr, opt_in_sqlError_valueFound ? opt_in_sqlError.get() : nullptr, opt_in_screenColor_valueFound ? &opt_in_screenColor : nullptr, opt_in_alternateColors_valueFound ? opt_in_alternateColors.get() : nullptr, opt_in_printColor_valueFound ? &opt_in_printColor : nullptr); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + RefPtr<Inspector::Protocol::Array<String>> out_columnNames; + Inspector::Protocol::OptOutput<String> out_notes; + Inspector::Protocol::OptOutput<double> out_timestamp; + Inspector::Protocol::OptOutput<Inspector::InspectorObject> out_values; + Inspector::Protocol::OptOutput<Inspector::InspectorValue> out_payload; + Inspector::Protocol::OptOutput<Inspector::Protocol::Database::DatabaseId> out_databaseId; + RefPtr<Inspector::Protocol::Database::Error> out_sqlError; + Inspector::Protocol::Database::PrimaryColors out_screenColor; + RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors; + DatabaseBackendDispatcherHandler::PrintColor out_printColor; + m_agent->executeAllOptionalParameters(error, opt_in_columnNames_valueFound ? opt_in_columnNames.get() : nullptr, opt_in_notes_valueFound ? &opt_in_notes : nullptr, opt_in_timestamp_valueFound ? &opt_in_timestamp : nullptr, opt_in_values_valueFound ? opt_in_values.get() : nullptr, opt_in_payload_valueFound ? opt_in_payload.get() : nullptr, opt_in_databaseId_valueFound ? &opt_in_databaseId : nullptr, opt_in_sqlError_valueFound ? opt_in_sqlError.get() : nullptr, opt_in_screenColor_valueFound ? &opt_in_screenColor : nullptr, opt_in_alternateColors_valueFound ? opt_in_alternateColors.get() : nullptr, opt_in_printColor_valueFound ? &opt_in_printColor : nullptr, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, out_alternateColors, &out_printColor); + + if (!error.length()) { + if (out_columnNames) + result->setArray(ASCIILiteral("columnNames"), out_columnNames); + if (out_notes.isAssigned()) + result->setString(ASCIILiteral("notes"), out_notes.getValue()); + if (out_timestamp.isAssigned()) + result->setDouble(ASCIILiteral("timestamp"), out_timestamp.getValue()); + if (out_values.isAssigned()) + result->setObject(ASCIILiteral("values"), out_values.getValue()); + if (out_payload.isAssigned()) + result->setValue(ASCIILiteral("payload"), out_payload.getValue()); + if (out_databaseId.isAssigned()) + result->setInteger(ASCIILiteral("databaseId"), out_databaseId.getValue()); + if (out_sqlError) + result->setObject(ASCIILiteral("sqlError"), out_sqlError); + if (out_screenColor.isAssigned()) + result->setString(ASCIILiteral("screenColor"), out_screenColor.getValue()); + if (out_alternateColors) + result->setArray(ASCIILiteral("alternateColors"), out_alternateColors); + if (out_printColor.isAssigned()) + result->setString(ASCIILiteral("printColor"), out_printColor.getValue()); + } + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +void DatabaseBackendDispatcher::executeNoOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters) +{ + RefPtr<Inspector::InspectorArray> in_columnNames = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("columnNames"), nullptr); + String in_notes = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("notes"), nullptr); + double in_timestamp = m_backendDispatcher->getDouble(parameters.get(), ASCIILiteral("timestamp"), nullptr); + RefPtr<Inspector::InspectorObject> in_values = m_backendDispatcher->getObject(parameters.get(), ASCIILiteral("values"), nullptr); + RefPtr<Inspector::InspectorValue> in_payload = m_backendDispatcher->getValue(parameters.get(), ASCIILiteral("payload"), nullptr); + int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr); + RefPtr<Inspector::InspectorObject> in_sqlError = m_backendDispatcher->getObject(parameters.get(), ASCIILiteral("sqlError"), nullptr); + String in_screenColor = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("screenColor"), nullptr); + RefPtr<Inspector::InspectorArray> in_alternateColors = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("alternateColors"), nullptr); + String in_printColor = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("printColor"), nullptr); + if (m_backendDispatcher->hasProtocolErrors()) { + m_backendDispatcher->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Some arguments of method '%s' can't be processed", "Database.executeNoOptionalParameters")); + return; + } + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->executeNoOptionalParameters(requestId, *in_columnNames, in_notes, in_timestamp, *in_values, *in_payload, in_databaseId, *in_sqlError, in_screenColor, *in_alternateColors, in_printColor); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + RefPtr<Inspector::Protocol::Array<String>> out_columnNames; + String out_notes; + double out_timestamp; + Inspector::InspectorObject out_values; + Inspector::InspectorValue out_payload; + Inspector::Protocol::Database::DatabaseId out_databaseId; + RefPtr<Inspector::Protocol::Database::Error> out_sqlError; + Inspector::Protocol::Database::PrimaryColors out_screenColor; + RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors; + DatabaseBackendDispatcherHandler::PrintColor out_printColor; + m_agent->executeNoOptionalParameters(error, *in_columnNames, in_notes, in_timestamp, *in_values, *in_payload, in_databaseId, *in_sqlError, in_screenColor, *in_alternateColors, in_printColor, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, out_alternateColors, &out_printColor); + + if (!error.length()) { + result->setArray(ASCIILiteral("columnNames"), out_columnNames); + result->setString(ASCIILiteral("notes"), out_notes); + result->setDouble(ASCIILiteral("timestamp"), out_timestamp); + result->setObject(ASCIILiteral("values"), out_values); + result->setValue(ASCIILiteral("payload"), out_payload); + result->setInteger(ASCIILiteral("databaseId"), out_databaseId); + result->setObject(ASCIILiteral("sqlError"), out_sqlError); + result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_screenColor)); + result->setArray(ASCIILiteral("alternateColors"), out_alternateColors); + result->setString(ASCIILiteral("printColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_printColor)); + } + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +} // 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 commands-with-optional-call-return-parameters.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 commands-with-optional-call-return-parameters.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 commands-with-optional-call-return-parameters.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 Database { +class Error; +enum class PrimaryColors; +} // Database +// End of forward declarations. + + +// Typedefs. +namespace Database { +/* Unique identifier of Database object. */ +typedef int DatabaseId; +typedef Inspector::Protocol::Array<Inspector::Protocol::Database::PrimaryColors> ColorList; +} // Database +// 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 Database { +/* */ +enum class PrimaryColors { + Red = 0, + Green = 1, + Blue = 2, +}; // enum class PrimaryColors +/* Database error. */ +class Error : public Inspector::InspectorObjectBase { +public: + enum { + NoFieldsSet = 0, + MessageSet = 1 << 0, + CodeSet = 1 << 1, + AllFieldsSet = (MessageSet | CodeSet) + }; + + 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</*Error*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class Error; + public: + + Builder<STATE | MessageSet>& setMessage(const String& value) + { + COMPILE_ASSERT(!(STATE & MessageSet), property_message_already_set); + m_result->setString(ASCIILiteral("message"), value); + return castState<MessageSet>(); + } + + Builder<STATE | CodeSet>& setCode(int value) + { + COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); + m_result->setInteger(ASCIILiteral("code"), value); + return castState<CodeSet>(); + } + + Ref<Error> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(Error) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<Error>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<Error> result = Error::create() + * .setMessage(...) + * .setCode(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } +}; + +} // Database + + + +namespace TestHelpers { + +template<typename ProtocolEnumType> +std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); + +// Enums in the 'Database' Domain +template<> +std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(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 commands-with-optional-call-return-parameters.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[] = { + "red", + "green", + "blue", + "cyan", + "magenta", + "yellow", + "black", +}; + +String getEnumConstantValue(int code) { + return enum_constant_values[code]; +} + +// Enums in the 'Database' Domain +template<> +std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString) +{ + static const size_t constantValues[] = { + (size_t)Inspector::Protocol::Database::PrimaryColors::Red, + (size_t)Inspector::Protocol::Database::PrimaryColors::Green, + (size_t)Inspector::Protocol::Database::PrimaryColors::Blue, + }; + for (size_t i = 0; i < 3; ++i) + if (protocolString == enum_constant_values[constantValues[i]]) + return (Inspector::Protocol::Database::PrimaryColors)constantValues[i]; + + return std::nullopt; +} + + +} // namespace TestHelpers + + + +} // 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 commands-with-optional-call-return-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h> +#include <wtf/RetainPtr.h> + +@protocol TestProtocolDatabaseDomainHandler; + +namespace Inspector { + + +class ObjCInspectorDatabaseBackendDispatcher final : public AlternateDatabaseBackendDispatcher { +public: + ObjCInspectorDatabaseBackendDispatcher(id<TestProtocolDatabaseDomainHandler> handler) { m_delegate = handler; } + virtual void executeAllOptionalParameters(long requestId, const Inspector::InspectorArray* in_columnNames, const String* const in_notes, const double* const in_timestamp, const Inspector::InspectorObject* in_values, const Inspector::InspectorValue* const in_payload, const int* const in_databaseId, const Inspector::InspectorObject* in_sqlError, const String* const in_screenColor, const Inspector::InspectorArray* in_alternateColors, const String* const in_printColor) override; + virtual void executeNoOptionalParameters(long requestId, const Inspector::InspectorArray& in_columnNames, const String& in_notes, double in_timestamp, const Inspector::InspectorObject& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const Inspector::InspectorObject& in_sqlError, const String& in_screenColor, const Inspector::InspectorArray& in_alternateColors, const String& in_printColor) override; +private: + RetainPtr<id<TestProtocolDatabaseDomainHandler>> m_delegate; +}; + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 commands-with-optional-call-return-parameters.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 { + +void ObjCInspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, const Inspector::InspectorArray* in_columnNames, const String* const in_notes, const double* const in_timestamp, const Inspector::InspectorObject* in_values, const Inspector::InspectorValue* const in_payload, const int* const in_databaseId, const Inspector::InspectorObject* in_sqlError, const String* const in_screenColor, const Inspector::InspectorArray* in_alternateColors, const String* const in_printColor) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteAllOptionalParametersPrintColor *printColor) { + Ref<InspectorObject> resultObject = InspectorObject::create(); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(payload, @"payload"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(sqlError, @"sqlError"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(alternateColors, @"alternateColors"); + if (columnNames) + resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(*columnNames)); + if (notes) + resultObject->setString(ASCIILiteral("notes"), *notes); + if (timestamp) + resultObject->setDouble(ASCIILiteral("timestamp"), *timestamp); + if (values) + resultObject->setObject(ASCIILiteral("values"), [*values toInspectorObject]); + if (payload) + resultObject->setValue(ASCIILiteral("payload"), [*payload toInspectorObject]); + if (databaseId) + resultObject->setInteger(ASCIILiteral("databaseId"), *databaseId); + if (sqlError) + resultObject->setObject(ASCIILiteral("sqlError"), [*sqlError toInspectorObject]); + if (screenColor) + resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(*screenColor)); + if (alternateColors) + resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(*alternateColors)); + if (printColor) + resultObject->setString(ASCIILiteral("printColor"), toProtocolString(*printColor)); + backendDispatcher()->sendResponse(requestId, WTFMove(resultObject)); + }; + + NSArray/*<NSString>*/ *o_in_columnNames; + if (in_columnNames) + o_in_columnNames = objcStringArray(in_columnNames); + NSString *o_in_notes; + if (in_notes) + o_in_notes = *in_notes; + double o_in_timestamp; + if (in_timestamp) + o_in_timestamp = *in_timestamp; + RWIProtocolJSONObject *o_in_values; + if (in_values) + o_in_values = [[[RWIProtocolJSONObject alloc] initWithInspectorObject:in_values] autorelease]; + RWIProtocolJSONObject *o_in_payload; + if (in_payload) + o_in_payload = [[[RWIProtocolJSONObject alloc] initWithInspectorObject:in_payload] autorelease]; + int o_in_databaseId; + if (in_databaseId) + o_in_databaseId = *in_databaseId; + TestProtocolDatabaseError *o_in_sqlError; + if (in_sqlError) + o_in_sqlError = [[[TestProtocolDatabaseError alloc] initWithInspectorObject:in_sqlError] autorelease]; + std::optional<TestProtocolDatabasePrimaryColors> o_in_screenColor; + if (in_screenColor) + o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(*in_screenColor); + NSArray/*<NSString>*/ *o_in_alternateColors; + if (in_alternateColors) + o_in_alternateColors = objcStringArray(in_alternateColors); + std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> o_in_printColor; + if (in_printColor) + o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor>(*in_printColor); + + [m_delegate executeAllOptionalParametersWithErrorCallback:errorCallback successCallback:successCallback columnNames:(in_columnNames ? &o_in_columnNames : nil) notes:(in_notes ? &o_in_notes : nil) timestamp:(in_timestamp ? &o_in_timestamp : nil) values:(in_values ? &o_in_values : nil) payload:(in_payload ? &o_in_payload : nil) databaseId:(in_databaseId ? &o_in_databaseId : nil) sqlError:(in_sqlError ? &o_in_sqlError : nil) screenColor:(in_screenColor ? &o_in_screenColor : nil) alternateColors:(in_alternateColors ? &o_in_alternateColors : nil) printColor:(in_printColor ? &o_in_printColor : nil)]; +} + +void ObjCInspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long requestId, const Inspector::InspectorArray& in_columnNames, const String& in_notes, double in_timestamp, const Inspector::InspectorObject& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const Inspector::InspectorObject& in_sqlError, const String& in_screenColor, const Inspector::InspectorArray& in_alternateColors, const String& in_printColor) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, TestProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabaseExecuteNoOptionalParametersPrintColor printColor) { + Ref<InspectorObject> resultObject = InspectorObject::create(); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(payload, @"payload"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(sqlError, @"sqlError"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(alternateColors, @"alternateColors"); + resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(columnNames)); + resultObject->setString(ASCIILiteral("notes"), notes); + resultObject->setDouble(ASCIILiteral("timestamp"), timestamp); + resultObject->setObject(ASCIILiteral("values"), [values toInspectorObject]); + resultObject->setValue(ASCIILiteral("payload"), [payload toInspectorObject]); + resultObject->setInteger(ASCIILiteral("databaseId"), databaseId); + resultObject->setObject(ASCIILiteral("sqlError"), [sqlError toInspectorObject]); + resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(screenColor)); + resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(alternateColors)); + resultObject->setString(ASCIILiteral("printColor"), toProtocolString(printColor)); + backendDispatcher()->sendResponse(requestId, WTFMove(resultObject)); + }; + + NSArray/*<NSString>*/ *o_in_columnNames = objcStringArray(&in_columnNames); + NSString *o_in_notes = in_notes; + double o_in_timestamp = in_timestamp; + RWIProtocolJSONObject *o_in_values = [[[RWIProtocolJSONObject alloc] initWithInspectorObject:&in_values] autorelease]; + RWIProtocolJSONObject *o_in_payload = [[[RWIProtocolJSONObject alloc] initWithInspectorObject:&in_payload] autorelease]; + int o_in_databaseId = in_databaseId; + TestProtocolDatabaseError *o_in_sqlError = [[[TestProtocolDatabaseError alloc] initWithInspectorObject:&in_sqlError] autorelease]; + std::optional<TestProtocolDatabasePrimaryColors> o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(in_screenColor); + if (!o_in_screenColor) { + backendDispatcher()->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Parameter '%s' of method '%s' cannot be processed", "screenColor", "Database.executeNoOptionalParameters")); + return; + } + NSArray/*<NSString>*/ *o_in_alternateColors = objcStringArray(&in_alternateColors); + std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor>(in_printColor); + if (!o_in_printColor) { + backendDispatcher()->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Parameter '%s' of method '%s' cannot be processed", "printColor", "Database.executeNoOptionalParameters")); + return; + } + + [m_delegate executeNoOptionalParametersWithErrorCallback:errorCallback successCallback:successCallback columnNames:o_in_columnNames notes:o_in_notes timestamp:o_in_timestamp values:o_in_values payload:o_in_payload databaseId:o_in_databaseId sqlError:o_in_sqlError screenColor:o_in_screenColor.value() alternateColors:o_in_alternateColors printColor:o_in_printColor.value()]; +} + + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 commands-with-optional-call-return-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <WebInspector/TestProtocol.h> + +__attribute__((visibility ("default"))) +@interface TestProtocolConfiguration : NSObject +@property (nonatomic, retain, setter=setDatabaseHandler:) id<TestProtocolDatabaseDomainHandler> databaseHandler; +@end + + +### End File: TestProtocolConfiguration.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 commands-with-optional-call-return-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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; + id<TestProtocolDatabaseDomainHandler> _databaseHandler; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)dealloc +{ + [_databaseHandler release]; + [super dealloc]; +} + +- (void)setDatabaseHandler:(id<TestProtocolDatabaseDomainHandler>)handler +{ + if (handler == _databaseHandler) + return; + + [_databaseHandler release]; + _databaseHandler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorDatabaseBackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<DatabaseBackendDispatcher, AlternateDatabaseBackendDispatcher>>(ASCIILiteral("Database"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolDatabaseDomainHandler>)databaseHandler +{ + return _databaseHandler; +} + +@end + + +### End File: TestProtocolConfiguration.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 commands-with-optional-call-return-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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 commands-with-optional-call-return-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + +@class TestProtocolDatabaseError; + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + +typedef NS_ENUM(NSInteger, TestProtocolDatabasePrimaryColors) { + TestProtocolDatabasePrimaryColorsRed, + TestProtocolDatabasePrimaryColorsGreen, + TestProtocolDatabasePrimaryColorsBlue, +}; + +typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteAllOptionalParametersPrintColor) { + TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan, + TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta, + TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow, + TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack, +}; + +typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteAllOptionalParametersPrintColor) { + TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan, + TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta, + TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow, + TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack, +}; + +typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteNoOptionalParametersPrintColor) { + TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan, + TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta, + TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow, + TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack, +}; + +typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteNoOptionalParametersPrintColor) { + TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan, + TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta, + TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow, + TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack, +}; + + +__attribute__((visibility ("default"))) +@interface TestProtocolDatabaseError : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithMessage:(NSString *)message code:(int)code; +/* required */ @property (nonatomic, copy) NSString *message; +/* required */ @property (nonatomic, assign) int code; +@end + +@protocol TestProtocolDatabaseDomainHandler <NSObject> +@required +- (void)executeAllOptionalParametersWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteAllOptionalParametersPrintColor *printColor))successCallback columnNames:(NSArray/*<NSString>*/ **)columnNames notes:(NSString **)notes timestamp:(double *)timestamp values:(RWIProtocolJSONObject **)values payload:(RWIProtocolJSONObject **)payload databaseId:(int *)databaseId sqlError:(TestProtocolDatabaseError **)sqlError screenColor:(TestProtocolDatabasePrimaryColors *)screenColor alternateColors:(NSArray/*<NSString>*/ **)alternateColors printColor:(TestProtocolDatabaseExecuteAllOptionalParametersPrintColor *)printColor; +- (void)executeNoOptionalParametersWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, TestProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabaseExecuteNoOptionalParametersPrintColor printColor))successCallback columnNames:(NSArray/*<NSString>*/ *)columnNames notes:(NSString *)notes timestamp:(double)timestamp values:(RWIProtocolJSONObject *)values payload:(RWIProtocolJSONObject *)payload databaseId:(int)databaseId sqlError:(TestProtocolDatabaseError *)sqlError screenColor:(TestProtocolDatabasePrimaryColors)screenColor alternateColors:(NSArray/*<NSString>*/ *)alternateColors printColor:(TestProtocolDatabaseExecuteNoOptionalParametersPrintColor)printColor; +@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 commands-with-optional-call-return-parameters.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 commands-with-optional-call-return-parameters.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + +inline String toProtocolString(TestProtocolDatabasePrimaryColors value) +{ + switch(value) { + case TestProtocolDatabasePrimaryColorsRed: + return ASCIILiteral("red"); + case TestProtocolDatabasePrimaryColorsGreen: + return ASCIILiteral("green"); + case TestProtocolDatabasePrimaryColorsBlue: + return ASCIILiteral("blue"); + } +} + +template<> +inline std::optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const String& value) +{ + if (value == "red") + return TestProtocolDatabasePrimaryColorsRed; + if (value == "green") + return TestProtocolDatabasePrimaryColorsGreen; + if (value == "blue") + return TestProtocolDatabasePrimaryColorsBlue; + return std::nullopt; +} + +inline String toProtocolString(TestProtocolDatabaseExecuteAllOptionalParametersPrintColor value) +{ + switch(value) { + case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan: + return ASCIILiteral("cyan"); + case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta: + return ASCIILiteral("magenta"); + case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow: + return ASCIILiteral("yellow"); + case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack: + return ASCIILiteral("black"); + } +} + +template<> +inline std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> fromProtocolString(const String& value) +{ + if (value == "cyan") + return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan; + if (value == "magenta") + return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta; + if (value == "yellow") + return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow; + if (value == "black") + return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack; + return std::nullopt; +} + +inline String toProtocolString(TestProtocolDatabaseExecuteAllOptionalParametersPrintColor value) +{ + switch(value) { + case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan: + return ASCIILiteral("cyan"); + case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta: + return ASCIILiteral("magenta"); + case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow: + return ASCIILiteral("yellow"); + case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack: + return ASCIILiteral("black"); + } +} + +template<> +inline std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> fromProtocolString(const String& value) +{ + if (value == "cyan") + return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan; + if (value == "magenta") + return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta; + if (value == "yellow") + return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow; + if (value == "black") + return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack; + return std::nullopt; +} + +inline String toProtocolString(TestProtocolDatabaseExecuteNoOptionalParametersPrintColor value) +{ + switch(value) { + case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan: + return ASCIILiteral("cyan"); + case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta: + return ASCIILiteral("magenta"); + case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow: + return ASCIILiteral("yellow"); + case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack: + return ASCIILiteral("black"); + } +} + +template<> +inline std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> fromProtocolString(const String& value) +{ + if (value == "cyan") + return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan; + if (value == "magenta") + return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta; + if (value == "yellow") + return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow; + if (value == "black") + return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack; + return std::nullopt; +} + +inline String toProtocolString(TestProtocolDatabaseExecuteNoOptionalParametersPrintColor value) +{ + switch(value) { + case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan: + return ASCIILiteral("cyan"); + case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta: + return ASCIILiteral("magenta"); + case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow: + return ASCIILiteral("yellow"); + case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack: + return ASCIILiteral("black"); + } +} + +template<> +inline std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> fromProtocolString(const String& value) +{ + if (value == "cyan") + return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan; + if (value == "magenta") + return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta; + if (value == "yellow") + return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow; + if (value == "black") + return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack; + return std::nullopt; +} + +} // 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 commands-with-optional-call-return-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (DatabaseDomain) + ++ (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload; ++ (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload; ++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload; ++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (DatabaseDomain) + ++ (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]); + *outValue = (NSNumber *)payload; +} + ++ (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + std::optional<TestProtocolDatabasePrimaryColors> result = Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"PrimaryColors"); + *outValue = @(result.value()); +} + ++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]); + *outValue = (NSArray/*<NSString>*/ *)payload; +} + ++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolDatabaseError 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 commands-with-optional-call-return-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +@implementation TestProtocolDatabaseError + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"message"], @"message"); + self.message = payload[@"message"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"code"], @"code"); + self.code = [payload[@"code"] integerValue]; + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithMessage:(NSString *)message code:(int)code +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(message, @"message"); + + self.message = message; + self.code = code; + + return self; +} + +- (void)setMessage:(NSString *)message +{ + [super setString:message forKey:@"message"]; +} + +- (NSString *)message +{ + return [super stringForKey:@"message"]; +} + +- (void)setCode:(int)code +{ + [super setInteger:code forKey:@"code"]; +} + +- (int)code +{ + return [super integerForKey:@"code"]; +} + +@end + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result new file mode 100644 index 000000000..d9cec9c61 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result @@ -0,0 +1,866 @@ +### 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py +### 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 definitions-with-mac-platform.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 definitions-with-mac-platform.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 definitions-with-mac-platform.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 definitions-with-mac-platform.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 definitions-with-mac-platform.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 definitions-with-mac-platform.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 { + + + + + + + +} // 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 definitions-with-mac-platform.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 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 definitions-with-mac-platform.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: 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 definitions-with-mac-platform.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: 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 definitions-with-mac-platform.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: 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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: 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + + + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + + + + + + + +### 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 definitions-with-mac-platform.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 definitions-with-mac-platform.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + +} // 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + + + + + + +### 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 definitions-with-mac-platform.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result new file mode 100644 index 000000000..0c4c30499 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result @@ -0,0 +1,1120 @@ +### 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 domain-availability.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// DomainA. +InspectorBackend.registerCommand("DomainA.enable", [], []); +InspectorBackend.activateDomain("DomainA", "web"); + +// DomainB. +InspectorBackend.registerCommand("DomainB.enable", [], []); +InspectorBackend.activateDomain("DomainB"); +### 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 domain-availability.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; +}; + + +class AlternateDomainABackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateDomainABackendDispatcher() { } + virtual void enable(long callId) = 0; +}; +class AlternateDomainBBackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateDomainBBackendDispatcher() { } + virtual void enable(long callId) = 0; +}; + +} // 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 domain-availability.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; + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +class AlternateDomainABackendDispatcher; +class AlternateDomainBBackendDispatcher; +#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + +class DomainABackendDispatcherHandler { +public: + virtual void enable(ErrorString&) = 0; +protected: + virtual ~DomainABackendDispatcherHandler(); +}; + +class DomainBBackendDispatcherHandler { +public: + virtual void enable(ErrorString&) = 0; +protected: + virtual ~DomainBBackendDispatcherHandler(); +}; + +class DomainABackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<DomainABackendDispatcher> create(BackendDispatcher&, DomainABackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void enable(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateDomainABackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateDomainABackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + DomainABackendDispatcher(BackendDispatcher&, DomainABackendDispatcherHandler*); + DomainABackendDispatcherHandler* m_agent { nullptr }; +}; + +class DomainBBackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<DomainBBackendDispatcher> create(BackendDispatcher&, DomainBBackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void enable(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateDomainBBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateDomainBBackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + DomainBBackendDispatcher(BackendDispatcher&, DomainBBackendDispatcherHandler*); + DomainBBackendDispatcherHandler* m_agent { nullptr }; +}; + +} // 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 domain-availability.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 { + +DomainABackendDispatcherHandler::~DomainABackendDispatcherHandler() { } +DomainBBackendDispatcherHandler::~DomainBBackendDispatcherHandler() { } + +Ref<DomainABackendDispatcher> DomainABackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainABackendDispatcherHandler* agent) +{ + return adoptRef(*new DomainABackendDispatcher(backendDispatcher, agent)); +} + +DomainABackendDispatcher::DomainABackendDispatcher(BackendDispatcher& backendDispatcher, DomainABackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("DomainA"), this); +} + +void DomainABackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<DomainABackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "enable") + enable(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "DomainA", '.', method, "' was not found")); +} + +void DomainABackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->enable(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->enable(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +Ref<DomainBBackendDispatcher> DomainBBackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainBBackendDispatcherHandler* agent) +{ + return adoptRef(*new DomainBBackendDispatcher(backendDispatcher, agent)); +} + +DomainBBackendDispatcher::DomainBBackendDispatcher(BackendDispatcher& backendDispatcher, DomainBBackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("DomainB"), this); +} + +void DomainBBackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<DomainBBackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "enable") + enable(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "DomainB", '.', method, "' was not found")); +} + +void DomainBBackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->enable(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->enable(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +} // 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 domain-availability.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 domain-availability.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 domain-availability.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 { + + + + + + + +} // 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 domain-availability.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 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 domain-availability.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h> +#include <wtf/RetainPtr.h> + +@protocol TestProtocolDomainADomainHandler; +@protocol TestProtocolDomainBDomainHandler; + +namespace Inspector { + + +class ObjCInspectorDomainABackendDispatcher final : public AlternateDomainABackendDispatcher { +public: + ObjCInspectorDomainABackendDispatcher(id<TestProtocolDomainADomainHandler> handler) { m_delegate = handler; } + virtual void enable(long requestId) override; +private: + RetainPtr<id<TestProtocolDomainADomainHandler>> m_delegate; +}; + +class ObjCInspectorDomainBBackendDispatcher final : public AlternateDomainBBackendDispatcher { +public: + ObjCInspectorDomainBBackendDispatcher(id<TestProtocolDomainBDomainHandler> handler) { m_delegate = handler; } + virtual void enable(long requestId) override; +private: + RetainPtr<id<TestProtocolDomainBDomainHandler>> m_delegate; +}; + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 domain-availability.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 { + +void ObjCInspectorDomainABackendDispatcher::enable(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback]; +} + + +void ObjCInspectorDomainBBackendDispatcher::enable(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback]; +} + + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 domain-availability.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <WebInspector/TestProtocol.h> + +__attribute__((visibility ("default"))) +@interface TestProtocolConfiguration : NSObject +@property (nonatomic, retain, setter=setDomainAHandler:) id<TestProtocolDomainADomainHandler> domainAHandler; +@property (nonatomic, retain, setter=setDomainBHandler:) id<TestProtocolDomainBDomainHandler> domainBHandler; +@end + + +### End File: TestProtocolConfiguration.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 domain-availability.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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; + id<TestProtocolDomainADomainHandler> _domainAHandler; + id<TestProtocolDomainBDomainHandler> _domainBHandler; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)dealloc +{ + [_domainAHandler release]; + [_domainBHandler release]; + [super dealloc]; +} + +- (void)setDomainAHandler:(id<TestProtocolDomainADomainHandler>)handler +{ + if (handler == _domainAHandler) + return; + + [_domainAHandler release]; + _domainAHandler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorDomainABackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<DomainABackendDispatcher, AlternateDomainABackendDispatcher>>(ASCIILiteral("DomainA"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolDomainADomainHandler>)domainAHandler +{ + return _domainAHandler; +} + +- (void)setDomainBHandler:(id<TestProtocolDomainBDomainHandler>)handler +{ + if (handler == _domainBHandler) + return; + + [_domainBHandler release]; + _domainBHandler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorDomainBBackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<DomainBBackendDispatcher, AlternateDomainBBackendDispatcher>>(ASCIILiteral("DomainB"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolDomainBDomainHandler>)domainBHandler +{ + return _domainBHandler; +} + +@end + + +### End File: TestProtocolConfiguration.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 domain-availability.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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 domain-availability.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + + + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + + +@protocol TestProtocolDomainADomainHandler <NSObject> +@required +- (void)enableWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +@end + +@protocol TestProtocolDomainBDomainHandler <NSObject> +@required +- (void)enableWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +@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 domain-availability.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 domain-availability.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + +} // 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 domain-availability.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + + + + + + +### 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 domain-availability.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result new file mode 100644 index 000000000..e9afc2a18 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result @@ -0,0 +1,1399 @@ +### 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 domains-with-varying-command-sizes.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// Network1. +InspectorBackend.registerCommand("Network1.loadResource1", [], []); +InspectorBackend.activateDomain("Network1"); + +// Network3. +InspectorBackend.registerCommand("Network3.loadResource1", [], []); +InspectorBackend.registerCommand("Network3.loadResource2", [], []); +InspectorBackend.registerCommand("Network3.loadResource3", [], []); +InspectorBackend.registerCommand("Network3.loadResource4", [], []); +InspectorBackend.registerCommand("Network3.loadResource5", [], []); +InspectorBackend.registerCommand("Network3.loadResource6", [], []); +InspectorBackend.registerCommand("Network3.loadResource7", [], []); +InspectorBackend.activateDomain("Network3"); +### 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 domains-with-varying-command-sizes.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; +}; + + +class AlternateNetwork1BackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateNetwork1BackendDispatcher() { } + virtual void loadResource1(long callId) = 0; +}; +class AlternateNetwork3BackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateNetwork3BackendDispatcher() { } + virtual void loadResource1(long callId) = 0; + virtual void loadResource2(long callId) = 0; + virtual void loadResource3(long callId) = 0; + virtual void loadResource4(long callId) = 0; + virtual void loadResource5(long callId) = 0; + virtual void loadResource6(long callId) = 0; + virtual void loadResource7(long callId) = 0; +}; + +} // 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 domains-with-varying-command-sizes.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; + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +class AlternateNetwork1BackendDispatcher; +class AlternateNetwork3BackendDispatcher; +#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + +class Network1BackendDispatcherHandler { +public: + virtual void loadResource1(ErrorString&) = 0; +protected: + virtual ~Network1BackendDispatcherHandler(); +}; + +class Network3BackendDispatcherHandler { +public: + virtual void loadResource1(ErrorString&) = 0; + virtual void loadResource2(ErrorString&) = 0; + virtual void loadResource3(ErrorString&) = 0; + virtual void loadResource4(ErrorString&) = 0; + virtual void loadResource5(ErrorString&) = 0; + virtual void loadResource6(ErrorString&) = 0; + virtual void loadResource7(ErrorString&) = 0; +protected: + virtual ~Network3BackendDispatcherHandler(); +}; + +class Network1BackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<Network1BackendDispatcher> create(BackendDispatcher&, Network1BackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void loadResource1(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateNetwork1BackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateNetwork1BackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + Network1BackendDispatcher(BackendDispatcher&, Network1BackendDispatcherHandler*); + Network1BackendDispatcherHandler* m_agent { nullptr }; +}; + +class Network3BackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<Network3BackendDispatcher> create(BackendDispatcher&, Network3BackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void loadResource1(long requestId, RefPtr<InspectorObject>&& parameters); + void loadResource2(long requestId, RefPtr<InspectorObject>&& parameters); + void loadResource3(long requestId, RefPtr<InspectorObject>&& parameters); + void loadResource4(long requestId, RefPtr<InspectorObject>&& parameters); + void loadResource5(long requestId, RefPtr<InspectorObject>&& parameters); + void loadResource6(long requestId, RefPtr<InspectorObject>&& parameters); + void loadResource7(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateNetwork3BackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateNetwork3BackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + Network3BackendDispatcher(BackendDispatcher&, Network3BackendDispatcherHandler*); + Network3BackendDispatcherHandler* m_agent { nullptr }; +}; + +} // 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 domains-with-varying-command-sizes.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 { + +Network1BackendDispatcherHandler::~Network1BackendDispatcherHandler() { } +Network3BackendDispatcherHandler::~Network3BackendDispatcherHandler() { } + +Ref<Network1BackendDispatcher> Network1BackendDispatcher::create(BackendDispatcher& backendDispatcher, Network1BackendDispatcherHandler* agent) +{ + return adoptRef(*new Network1BackendDispatcher(backendDispatcher, agent)); +} + +Network1BackendDispatcher::Network1BackendDispatcher(BackendDispatcher& backendDispatcher, Network1BackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Network1"), this); +} + +void Network1BackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<Network1BackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "loadResource1") + loadResource1(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Network1", '.', method, "' was not found")); +} + +void Network1BackendDispatcher::loadResource1(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource1(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource1(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +Ref<Network3BackendDispatcher> Network3BackendDispatcher::create(BackendDispatcher& backendDispatcher, Network3BackendDispatcherHandler* agent) +{ + return adoptRef(*new Network3BackendDispatcher(backendDispatcher, agent)); +} + +Network3BackendDispatcher::Network3BackendDispatcher(BackendDispatcher& backendDispatcher, Network3BackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Network3"), this); +} + +void Network3BackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<Network3BackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + typedef void (Network3BackendDispatcher::*CallHandler)(long requestId, RefPtr<InspectorObject>&& message); + typedef HashMap<String, CallHandler> DispatchMap; + static NeverDestroyed<DispatchMap> dispatchMap; + if (dispatchMap.get().isEmpty()) { + static const struct MethodTable { + const char* name; + CallHandler handler; + } commands[] = { + { "loadResource1", &Network3BackendDispatcher::loadResource1 }, + { "loadResource2", &Network3BackendDispatcher::loadResource2 }, + { "loadResource3", &Network3BackendDispatcher::loadResource3 }, + { "loadResource4", &Network3BackendDispatcher::loadResource4 }, + { "loadResource5", &Network3BackendDispatcher::loadResource5 }, + { "loadResource6", &Network3BackendDispatcher::loadResource6 }, + { "loadResource7", &Network3BackendDispatcher::loadResource7 }, + }; + size_t length = WTF_ARRAY_LENGTH(commands); + for (size_t i = 0; i < length; ++i) + dispatchMap.get().add(commands[i].name, commands[i].handler); + } + + auto findResult = dispatchMap.get().find(method); + if (findResult == dispatchMap.get().end()) { + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Network3", '.', method, "' was not found")); + return; + } + + ((*this).*findResult->value)(requestId, WTFMove(parameters)); +} + +void Network3BackendDispatcher::loadResource1(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource1(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource1(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +void Network3BackendDispatcher::loadResource2(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource2(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource2(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +void Network3BackendDispatcher::loadResource3(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource3(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource3(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +void Network3BackendDispatcher::loadResource4(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource4(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource4(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +void Network3BackendDispatcher::loadResource5(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource5(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource5(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +void Network3BackendDispatcher::loadResource6(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource6(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource6(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +void Network3BackendDispatcher::loadResource7(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource7(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource7(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +} // 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 domains-with-varying-command-sizes.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 domains-with-varying-command-sizes.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 domains-with-varying-command-sizes.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 { + + + +// Typedefs. +namespace Network2 { +/* Unique loader identifier. */ +typedef String LoaderId; +} // Network2 +// End of typedefs. + + + +} // 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 domains-with-varying-command-sizes.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 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 domains-with-varying-command-sizes.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h> +#include <wtf/RetainPtr.h> + +@protocol TestProtocolNetwork1DomainHandler; +@protocol TestProtocolNetwork3DomainHandler; + +namespace Inspector { + + +class ObjCInspectorNetwork1BackendDispatcher final : public AlternateNetwork1BackendDispatcher { +public: + ObjCInspectorNetwork1BackendDispatcher(id<TestProtocolNetwork1DomainHandler> handler) { m_delegate = handler; } + virtual void loadResource1(long requestId) override; +private: + RetainPtr<id<TestProtocolNetwork1DomainHandler>> m_delegate; +}; + +class ObjCInspectorNetwork3BackendDispatcher final : public AlternateNetwork3BackendDispatcher { +public: + ObjCInspectorNetwork3BackendDispatcher(id<TestProtocolNetwork3DomainHandler> handler) { m_delegate = handler; } + virtual void loadResource1(long requestId) override; + virtual void loadResource2(long requestId) override; + virtual void loadResource3(long requestId) override; + virtual void loadResource4(long requestId) override; + virtual void loadResource5(long requestId) override; + virtual void loadResource6(long requestId) override; + virtual void loadResource7(long requestId) override; +private: + RetainPtr<id<TestProtocolNetwork3DomainHandler>> m_delegate; +}; + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 domains-with-varying-command-sizes.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 { + +void ObjCInspectorNetwork1BackendDispatcher::loadResource1(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResource1WithErrorCallback:errorCallback successCallback:successCallback]; +} + + +void ObjCInspectorNetwork3BackendDispatcher::loadResource1(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResource1WithErrorCallback:errorCallback successCallback:successCallback]; +} + +void ObjCInspectorNetwork3BackendDispatcher::loadResource2(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResource2WithErrorCallback:errorCallback successCallback:successCallback]; +} + +void ObjCInspectorNetwork3BackendDispatcher::loadResource3(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResource3WithErrorCallback:errorCallback successCallback:successCallback]; +} + +void ObjCInspectorNetwork3BackendDispatcher::loadResource4(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResource4WithErrorCallback:errorCallback successCallback:successCallback]; +} + +void ObjCInspectorNetwork3BackendDispatcher::loadResource5(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResource5WithErrorCallback:errorCallback successCallback:successCallback]; +} + +void ObjCInspectorNetwork3BackendDispatcher::loadResource6(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResource6WithErrorCallback:errorCallback successCallback:successCallback]; +} + +void ObjCInspectorNetwork3BackendDispatcher::loadResource7(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResource7WithErrorCallback:errorCallback successCallback:successCallback]; +} + + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 domains-with-varying-command-sizes.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <WebInspector/TestProtocol.h> + +__attribute__((visibility ("default"))) +@interface TestProtocolConfiguration : NSObject +@property (nonatomic, retain, setter=setNetwork1Handler:) id<TestProtocolNetwork1DomainHandler> network1Handler; +@property (nonatomic, retain, setter=setNetwork3Handler:) id<TestProtocolNetwork3DomainHandler> network3Handler; +@end + + +### End File: TestProtocolConfiguration.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 domains-with-varying-command-sizes.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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; + id<TestProtocolNetwork1DomainHandler> _network1Handler; + id<TestProtocolNetwork3DomainHandler> _network3Handler; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)dealloc +{ + [_network1Handler release]; + [_network3Handler release]; + [super dealloc]; +} + +- (void)setNetwork1Handler:(id<TestProtocolNetwork1DomainHandler>)handler +{ + if (handler == _network1Handler) + return; + + [_network1Handler release]; + _network1Handler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorNetwork1BackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<Network1BackendDispatcher, AlternateNetwork1BackendDispatcher>>(ASCIILiteral("Network1"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolNetwork1DomainHandler>)network1Handler +{ + return _network1Handler; +} + +- (void)setNetwork3Handler:(id<TestProtocolNetwork3DomainHandler>)handler +{ + if (handler == _network3Handler) + return; + + [_network3Handler release]; + _network3Handler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorNetwork3BackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<Network3BackendDispatcher, AlternateNetwork3BackendDispatcher>>(ASCIILiteral("Network3"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolNetwork3DomainHandler>)network3Handler +{ + return _network3Handler; +} + +@end + + +### End File: TestProtocolConfiguration.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 domains-with-varying-command-sizes.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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 domains-with-varying-command-sizes.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + + + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + + +@protocol TestProtocolNetwork1DomainHandler <NSObject> +@required +- (void)loadResource1WithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +@end + +@protocol TestProtocolNetwork3DomainHandler <NSObject> +@required +- (void)loadResource1WithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +- (void)loadResource2WithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +- (void)loadResource3WithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +- (void)loadResource4WithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +- (void)loadResource5WithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +- (void)loadResource6WithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +- (void)loadResource7WithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +@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 domains-with-varying-command-sizes.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 domains-with-varying-command-sizes.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + + +} // 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 domains-with-varying-command-sizes.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (Network2Domain) + ++ (void)_parseLoaderId:(NSString **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (Network2Domain) + ++ (void)_parseLoaderId:(NSString **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + *outValue = (NSString *)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 domains-with-varying-command-sizes.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result new file mode 100644 index 000000000..d2a01c84e --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result @@ -0,0 +1,1208 @@ +### 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 enum-values.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// TypeDomain. +InspectorBackend.registerEnum("TypeDomain.TypeDomainEnum", {Shared: "shared", Red: "red", Green: "green", Blue: "blue"}); + +// CommandDomain. +InspectorBackend.registerCommand("CommandDomain.commandWithEnumReturnValue", [], ["returnValue"]); +InspectorBackend.activateDomain("CommandDomain"); + +// EventDomain. +InspectorBackend.registerEventDomainDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "EventDomain"); +InspectorBackend.registerEnum("EventDomain.EventWithEnumParameterParameter", {Shared: "shared", Black: "black", White: "white"}); +InspectorBackend.registerEvent("EventDomain.eventWithEnumParameter", ["parameter"]); +InspectorBackend.activateDomain("EventDomain"); +### 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 enum-values.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; +}; + + +class AlternateCommandDomainBackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateCommandDomainBackendDispatcher() { } + virtual void commandWithEnumReturnValue(long callId) = 0; +}; + +} // 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 enum-values.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; + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +class AlternateCommandDomainBackendDispatcher; +#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + +class CommandDomainBackendDispatcherHandler { +public: + // Named after parameter 'returnValue' while generating command/event commandWithEnumReturnValue. + enum class ReturnValue { + Shared = 0, + Cyan = 6, + Magenta = 7, + Yellow = 8, + }; // enum class ReturnValue + virtual void commandWithEnumReturnValue(ErrorString&, CommandDomainBackendDispatcherHandler::ReturnValue* out_returnValue) = 0; +protected: + virtual ~CommandDomainBackendDispatcherHandler(); +}; + +class CommandDomainBackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<CommandDomainBackendDispatcher> create(BackendDispatcher&, CommandDomainBackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void commandWithEnumReturnValue(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateCommandDomainBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateCommandDomainBackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + CommandDomainBackendDispatcher(BackendDispatcher&, CommandDomainBackendDispatcherHandler*); + CommandDomainBackendDispatcherHandler* m_agent { nullptr }; +}; + +} // 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 enum-values.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 { + +CommandDomainBackendDispatcherHandler::~CommandDomainBackendDispatcherHandler() { } + +Ref<CommandDomainBackendDispatcher> CommandDomainBackendDispatcher::create(BackendDispatcher& backendDispatcher, CommandDomainBackendDispatcherHandler* agent) +{ + return adoptRef(*new CommandDomainBackendDispatcher(backendDispatcher, agent)); +} + +CommandDomainBackendDispatcher::CommandDomainBackendDispatcher(BackendDispatcher& backendDispatcher, CommandDomainBackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("CommandDomain"), this); +} + +void CommandDomainBackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<CommandDomainBackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "commandWithEnumReturnValue") + commandWithEnumReturnValue(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "CommandDomain", '.', method, "' was not found")); +} + +void CommandDomainBackendDispatcher::commandWithEnumReturnValue(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->commandWithEnumReturnValue(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + CommandDomainBackendDispatcherHandler::ReturnValue out_returnValue; + m_agent->commandWithEnumReturnValue(error, &out_returnValue); + + if (!error.length()) + result->setString(ASCIILiteral("returnValue"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_returnValue)); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +} // 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 enum-values.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; + +class EventDomainFrontendDispatcher { +public: + EventDomainFrontendDispatcher(FrontendRouter& frontendRouter) : m_frontendRouter(frontendRouter) { } + // Named after parameter 'parameter' while generating command/event eventWithEnumParameter. + enum class Parameter { + Shared = 0, + Black = 4, + White = 5, + }; // enum class Parameter + void eventWithEnumParameter(Parameter parameter); +private: + FrontendRouter& m_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 enum-values.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 { + +void EventDomainFrontendDispatcher::eventWithEnumParameter(Parameter parameter) +{ + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("EventDomain.eventWithEnumParameter")); + Ref<InspectorObject> paramsObject = InspectorObject::create(); + paramsObject->setString(ASCIILiteral("parameter"), Inspector::Protocol::TestHelpers::getEnumConstantValue(parameter)); + jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject)); + + m_frontendRouter.sendEvent(jsonMessage->toJSONString()); +} + +} // 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 enum-values.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 TypeDomain { +enum class TypeDomainEnum; +} // TypeDomain +// End of forward declarations. + + + + +namespace TestHelpers { + +String getEnumConstantValue(int code); + +template<typename T> String getEnumConstantValue(T enumValue) +{ + return getEnumConstantValue(static_cast<int>(enumValue)); +} + +} // namespace TestHelpers + +namespace TypeDomain { +/* */ +enum class TypeDomainEnum { + Shared = 0, + Red = 1, + Green = 2, + Blue = 3, +}; // enum class TypeDomainEnum +} // TypeDomain + + + +namespace TestHelpers { + +template<typename ProtocolEnumType> +std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); + +// Enums in the 'TypeDomain' Domain +template<> +std::optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(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 enum-values.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[] = { + "shared", + "red", + "green", + "blue", + "black", + "white", + "cyan", + "magenta", + "yellow", +}; + +String getEnumConstantValue(int code) { + return enum_constant_values[code]; +} + +// Enums in the 'TypeDomain' Domain +template<> +std::optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String& protocolString) +{ + static const size_t constantValues[] = { + (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Shared, + (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Red, + (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Green, + (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Blue, + }; + for (size_t i = 0; i < 4; ++i) + if (protocolString == enum_constant_values[constantValues[i]]) + return (Inspector::Protocol::TypeDomain::TypeDomainEnum)constantValues[i]; + + return std::nullopt; +} + + +} // namespace TestHelpers + + + +} // 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 enum-values.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h> +#include <wtf/RetainPtr.h> + +@protocol TestProtocolCommandDomainDomainHandler; + +namespace Inspector { + + +class ObjCInspectorCommandDomainBackendDispatcher final : public AlternateCommandDomainBackendDispatcher { +public: + ObjCInspectorCommandDomainBackendDispatcher(id<TestProtocolCommandDomainDomainHandler> handler) { m_delegate = handler; } + virtual void commandWithEnumReturnValue(long requestId) override; +private: + RetainPtr<id<TestProtocolCommandDomainDomainHandler>> m_delegate; +}; + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 enum-values.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 { + +void ObjCInspectorCommandDomainBackendDispatcher::commandWithEnumReturnValue(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^(TestProtocolCommandDomainCommandWithEnumReturnValueReturnValue returnValue) { + Ref<InspectorObject> resultObject = InspectorObject::create(); + resultObject->setString(ASCIILiteral("returnValue"), toProtocolString(returnValue)); + backendDispatcher()->sendResponse(requestId, WTFMove(resultObject)); + }; + + [m_delegate commandWithEnumReturnValueWithErrorCallback:errorCallback successCallback:successCallback]; +} + + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 enum-values.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <WebInspector/TestProtocol.h> + +__attribute__((visibility ("default"))) +@interface TestProtocolConfiguration : NSObject +@property (nonatomic, retain, setter=setCommandDomainHandler:) id<TestProtocolCommandDomainDomainHandler> commandDomainHandler; +@property (nonatomic, readonly) TestProtocolEventDomainDomainEventDispatcher *eventDomainEventDispatcher; +@end + + +### End File: TestProtocolConfiguration.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 enum-values.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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; + id<TestProtocolCommandDomainDomainHandler> _commandDomainHandler; + TestProtocolEventDomainDomainEventDispatcher *_eventDomainEventDispatcher; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)dealloc +{ + [_commandDomainHandler release]; + [_eventDomainEventDispatcher release]; + [super dealloc]; +} + +- (void)setCommandDomainHandler:(id<TestProtocolCommandDomainDomainHandler>)handler +{ + if (handler == _commandDomainHandler) + return; + + [_commandDomainHandler release]; + _commandDomainHandler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorCommandDomainBackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<CommandDomainBackendDispatcher, AlternateCommandDomainBackendDispatcher>>(ASCIILiteral("CommandDomain"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolCommandDomainDomainHandler>)commandDomainHandler +{ + return _commandDomainHandler; +} + +- (TestProtocolEventDomainDomainEventDispatcher *)eventDomainEventDispatcher +{ + if (!_eventDomainEventDispatcher) + _eventDomainEventDispatcher = [[TestProtocolEventDomainDomainEventDispatcher alloc] initWithController:_controller]; + return _eventDomainEventDispatcher; +} + +@end + + +### End File: TestProtocolConfiguration.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 enum-values.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <JavaScriptCore/InspectorValues.h> + +using namespace Inspector; + +@implementation TestProtocolEventDomainDomainEventDispatcher +{ + AugmentableInspectorController* _controller; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller; +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)eventWithEnumParameterWithParameter:(TestProtocolEventDomainEventWithEnumParameterParameter)parameter +{ + const FrontendRouter& router = _controller->frontendRouter(); + + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("EventDomain.eventWithEnumParameter")); + Ref<InspectorObject> paramsObject = InspectorObject::create(); + paramsObject->setString(ASCIILiteral("parameter"), toProtocolString(parameter)); + jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject)); + router.sendEvent(jsonMessage->toJSONString()); +} + +@end + + +### 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 enum-values.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + + + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + +typedef NS_ENUM(NSInteger, TestProtocolTypeDomainEnum) { + TestProtocolTypeDomainEnumShared, + TestProtocolTypeDomainEnumRed, + TestProtocolTypeDomainEnumGreen, + TestProtocolTypeDomainEnumBlue, +}; + + + +@protocol TestProtocolCommandDomainDomainHandler <NSObject> +@required +- (void)commandWithEnumReturnValueWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(TestProtocolCommandDomainCommandWithEnumReturnValueReturnValue returnValue))successCallback; +@end + +__attribute__((visibility ("default"))) +@interface TestProtocolEventDomainDomainEventDispatcher : NSObject +- (void)eventWithEnumParameterWithParameter:(TestProtocolEventDomainEventWithEnumParameterParameter)parameter; +@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 enum-values.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> + +@interface TestProtocolEventDomainDomainEventDispatcher (Private) +- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller; +@end + + +### 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 enum-values.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + +inline String toProtocolString(TestProtocolTypeDomainEnum value) +{ + switch(value) { + case TestProtocolTypeDomainEnumShared: + return ASCIILiteral("shared"); + case TestProtocolTypeDomainEnumRed: + return ASCIILiteral("red"); + case TestProtocolTypeDomainEnumGreen: + return ASCIILiteral("green"); + case TestProtocolTypeDomainEnumBlue: + return ASCIILiteral("blue"); + } +} + +template<> +inline std::optional<TestProtocolTypeDomainEnum> fromProtocolString(const String& value) +{ + if (value == "shared") + return TestProtocolTypeDomainEnumShared; + if (value == "red") + return TestProtocolTypeDomainEnumRed; + if (value == "green") + return TestProtocolTypeDomainEnumGreen; + if (value == "blue") + return TestProtocolTypeDomainEnumBlue; + return std::nullopt; +} + +} // 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 enum-values.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (TypeDomainDomain) + ++ (void)_parseTypeDomainEnum:(NSNumber **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (TypeDomainDomain) + ++ (void)_parseTypeDomainEnum:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + std::optional<TestProtocolTypeDomainEnum> result = Inspector::fromProtocolString<TestProtocolTypeDomainEnum>(payload); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"TypeDomainEnum"); + *outValue = @(result.value()); +} + +@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 enum-values.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result new file mode 100644 index 000000000..137d1827e --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result @@ -0,0 +1,1210 @@ +### 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 events-with-optional-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// Database. +InspectorBackend.registerDatabaseDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Database"); +InspectorBackend.registerEvent("Database.didExecuteOptionalParameters", ["columnNames", "notes", "timestamp", "values", "payload", "sqlError", "screenColor", "alternateColors", "printColor"]); +InspectorBackend.registerEvent("Database.didExecuteNoOptionalParameters", ["columnNames", "notes", "timestamp", "values", "payload", "sqlError", "screenColor", "alternateColors", "printColor"]); +InspectorBackend.activateDomain("Database"); +### 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 events-with-optional-parameters.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 events-with-optional-parameters.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 events-with-optional-parameters.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 events-with-optional-parameters.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; + +class DatabaseFrontendDispatcher { +public: + DatabaseFrontendDispatcher(FrontendRouter& frontendRouter) : m_frontendRouter(frontendRouter) { } + void didExecuteOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String* const notes, const double* const timestamp, RefPtr<Inspector::InspectorObject> values, RefPtr<Inspector::InspectorValue> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors* const screenColor, RefPtr<Inspector::Protocol::Database::ColorList> alternateColors, const String* const printColor); + void didExecuteNoOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String& notes, double timestamp, RefPtr<Inspector::InspectorObject> values, RefPtr<Inspector::InspectorValue> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors& screenColor, RefPtr<Inspector::Protocol::Database::ColorList> alternateColors, const String& printColor); +private: + FrontendRouter& m_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 events-with-optional-parameters.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 { + +void DatabaseFrontendDispatcher::didExecuteOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String* const notes, const double* const timestamp, RefPtr<Inspector::InspectorObject> values, RefPtr<Inspector::InspectorValue> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors* const screenColor, RefPtr<Inspector::Protocol::Database::ColorList> alternateColors, const String* const printColor) +{ + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteOptionalParameters")); + Ref<InspectorObject> paramsObject = InspectorObject::create(); + if (columnNames) + paramsObject->setArray(ASCIILiteral("columnNames"), columnNames); + if (notes) + paramsObject->setString(ASCIILiteral("notes"), *notes); + if (timestamp) + paramsObject->setDouble(ASCIILiteral("timestamp"), *timestamp); + if (values) + paramsObject->setObject(ASCIILiteral("values"), values); + if (payload) + paramsObject->setValue(ASCIILiteral("payload"), *payload); + if (sqlError) + paramsObject->setObject(ASCIILiteral("sqlError"), sqlError); + if (screenColor) + paramsObject->setString(ASCIILiteral("screenColor"), *screenColor); + if (alternateColors) + paramsObject->setArray(ASCIILiteral("alternateColors"), alternateColors); + if (printColor) + paramsObject->setString(ASCIILiteral("printColor"), *printColor); + jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject)); + + m_frontendRouter.sendEvent(jsonMessage->toJSONString()); +} + +void DatabaseFrontendDispatcher::didExecuteNoOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String& notes, double timestamp, RefPtr<Inspector::InspectorObject> values, RefPtr<Inspector::InspectorValue> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors& screenColor, RefPtr<Inspector::Protocol::Database::ColorList> alternateColors, const String& printColor) +{ + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteNoOptionalParameters")); + Ref<InspectorObject> paramsObject = InspectorObject::create(); + paramsObject->setArray(ASCIILiteral("columnNames"), columnNames); + paramsObject->setString(ASCIILiteral("notes"), notes); + paramsObject->setDouble(ASCIILiteral("timestamp"), timestamp); + paramsObject->setObject(ASCIILiteral("values"), values); + paramsObject->setValue(ASCIILiteral("payload"), payload); + paramsObject->setObject(ASCIILiteral("sqlError"), sqlError); + paramsObject->setString(ASCIILiteral("screenColor"), screenColor); + paramsObject->setArray(ASCIILiteral("alternateColors"), alternateColors); + paramsObject->setString(ASCIILiteral("printColor"), printColor); + jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject)); + + m_frontendRouter.sendEvent(jsonMessage->toJSONString()); +} + +} // 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 events-with-optional-parameters.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 Database { +class Error; +} // Database +// End of forward declarations. + + +// Typedefs. +namespace Database { +/* Unique identifier of Database object. */ +typedef String DatabaseId; +typedef String PrimaryColors; +typedef Inspector::Protocol::Array<Inspector::Protocol::Database::PrimaryColors> ColorList; +} // Database +// End of typedefs. + +namespace Database { +/* Database error. */ +class Error : public Inspector::InspectorObjectBase { +public: + enum { + NoFieldsSet = 0, + MessageSet = 1 << 0, + CodeSet = 1 << 1, + AllFieldsSet = (MessageSet | CodeSet) + }; + + 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</*Error*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class Error; + public: + + Builder<STATE | MessageSet>& setMessage(const String& value) + { + COMPILE_ASSERT(!(STATE & MessageSet), property_message_already_set); + m_result->setString(ASCIILiteral("message"), value); + return castState<MessageSet>(); + } + + Builder<STATE | CodeSet>& setCode(int value) + { + COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); + m_result->setInteger(ASCIILiteral("code"), value); + return castState<CodeSet>(); + } + + Ref<Error> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(Error) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<Error>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<Error> result = Error::create() + * .setMessage(...) + * .setCode(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } +}; + +} // Database + + + +} // 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 events-with-optional-parameters.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 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 events-with-optional-parameters.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: 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 events-with-optional-parameters.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: 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 events-with-optional-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <WebInspector/TestProtocol.h> + +__attribute__((visibility ("default"))) +@interface TestProtocolConfiguration : NSObject +@property (nonatomic, readonly) TestProtocolDatabaseDomainEventDispatcher *databaseEventDispatcher; +@end + + +### End File: TestProtocolConfiguration.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 events-with-optional-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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; + TestProtocolDatabaseDomainEventDispatcher *_databaseEventDispatcher; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)dealloc +{ + [_databaseEventDispatcher release]; + [super dealloc]; +} + +- (TestProtocolDatabaseDomainEventDispatcher *)databaseEventDispatcher +{ + if (!_databaseEventDispatcher) + _databaseEventDispatcher = [[TestProtocolDatabaseDomainEventDispatcher alloc] initWithController:_controller]; + return _databaseEventDispatcher; +} + +@end + + +### End File: TestProtocolConfiguration.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 events-with-optional-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <JavaScriptCore/InspectorValues.h> + +using namespace Inspector; + +@implementation TestProtocolDatabaseDomainEventDispatcher +{ + AugmentableInspectorController* _controller; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller; +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)didExecuteOptionalParametersWithColumnNames:(NSArray/*<NSString>*/ **)columnNames notes:(NSString **)notes timestamp:(double *)timestamp values:(RWIProtocolJSONObject **)values payload:(RWIProtocolJSONObject **)payload sqlError:(TestProtocolDatabaseError **)sqlError screenColor:(NSString **)screenColor alternateColors:(NSArray/*<NSString>*/ **)alternateColors printColor:(NSString **)printColor +{ + const FrontendRouter& router = _controller->frontendRouter(); + + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(payload, @"payload"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(sqlError, @"sqlError"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(screenColor, @"screenColor"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(alternateColors, @"alternateColors"); + THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(printColor, @"printColor"); + + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteOptionalParameters")); + Ref<InspectorObject> paramsObject = InspectorObject::create(); + if (columnNames) + paramsObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray((*columnNames))); + if (notes) + paramsObject->setString(ASCIILiteral("notes"), (*notes)); + if (timestamp) + paramsObject->setDouble(ASCIILiteral("timestamp"), (*timestamp)); + if (values) + paramsObject->setObject(ASCIILiteral("values"), [(*values) toInspectorObject]); + if (payload) + paramsObject->setValue(ASCIILiteral("payload"), [(*payload) toInspectorObject]); + if (sqlError) + paramsObject->setObject(ASCIILiteral("sqlError"), [(*sqlError) toInspectorObject]); + if (screenColor) + paramsObject->setString(ASCIILiteral("screenColor"), (*screenColor)); + if (alternateColors) + paramsObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray((*alternateColors))); + if (printColor) + paramsObject->setString(ASCIILiteral("printColor"), (*printColor)); + jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject)); + router.sendEvent(jsonMessage->toJSONString()); +} + +- (void)didExecuteNoOptionalParametersWithColumnNames:(NSArray/*<NSString>*/ *)columnNames notes:(NSString *)notes timestamp:(double)timestamp values:(RWIProtocolJSONObject *)values payload:(RWIProtocolJSONObject *)payload sqlError:(TestProtocolDatabaseError *)sqlError screenColor:(NSString *)screenColor alternateColors:(NSArray/*<NSString>*/ *)alternateColors printColor:(NSString *)printColor +{ + const FrontendRouter& router = _controller->frontendRouter(); + + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(payload, @"payload"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(sqlError, @"sqlError"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(screenColor, @"screenColor"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(alternateColors, @"alternateColors"); + THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(printColor, @"printColor"); + + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteNoOptionalParameters")); + Ref<InspectorObject> paramsObject = InspectorObject::create(); + paramsObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(columnNames)); + paramsObject->setString(ASCIILiteral("notes"), notes); + paramsObject->setDouble(ASCIILiteral("timestamp"), timestamp); + paramsObject->setObject(ASCIILiteral("values"), [values toInspectorObject]); + paramsObject->setValue(ASCIILiteral("payload"), [payload toInspectorObject]); + paramsObject->setObject(ASCIILiteral("sqlError"), [sqlError toInspectorObject]); + paramsObject->setString(ASCIILiteral("screenColor"), screenColor); + paramsObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(alternateColors)); + paramsObject->setString(ASCIILiteral("printColor"), printColor); + jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject)); + router.sendEvent(jsonMessage->toJSONString()); +} + +@end + + +### 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 events-with-optional-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + +@class TestProtocolDatabaseError; + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + +__attribute__((visibility ("default"))) +@interface TestProtocolDatabaseError : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithMessage:(NSString *)message code:(int)code; +/* required */ @property (nonatomic, copy) NSString *message; +/* required */ @property (nonatomic, assign) int code; +@end + + + +__attribute__((visibility ("default"))) +@interface TestProtocolDatabaseDomainEventDispatcher : NSObject +- (void)didExecuteOptionalParametersWithColumnNames:(NSArray/*<NSString>*/ **)columnNames notes:(NSString **)notes timestamp:(double *)timestamp values:(RWIProtocolJSONObject **)values payload:(RWIProtocolJSONObject **)payload sqlError:(TestProtocolDatabaseError **)sqlError screenColor:(NSString **)screenColor alternateColors:(NSArray/*<NSString>*/ **)alternateColors printColor:(NSString **)printColor; +- (void)didExecuteNoOptionalParametersWithColumnNames:(NSArray/*<NSString>*/ *)columnNames notes:(NSString *)notes timestamp:(double)timestamp values:(RWIProtocolJSONObject *)values payload:(RWIProtocolJSONObject *)payload sqlError:(TestProtocolDatabaseError *)sqlError screenColor:(NSString *)screenColor alternateColors:(NSArray/*<NSString>*/ *)alternateColors printColor:(NSString *)printColor; +@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 events-with-optional-parameters.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> + +@interface TestProtocolDatabaseDomainEventDispatcher (Private) +- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller; +@end + + +### 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 events-with-optional-parameters.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + + +} // 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 events-with-optional-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (DatabaseDomain) + ++ (void)_parseDatabaseId:(NSString **)outValue fromPayload:(id)payload; ++ (void)_parsePrimaryColors:(NSString **)outValue fromPayload:(id)payload; ++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload; ++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (DatabaseDomain) + ++ (void)_parseDatabaseId:(NSString **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + *outValue = (NSString *)payload; +} + ++ (void)_parsePrimaryColors:(NSString **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + *outValue = (NSString *)payload; +} + ++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]); + *outValue = (NSArray/*<NSString>*/ *)payload; +} + ++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolDatabaseError 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 events-with-optional-parameters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +@implementation TestProtocolDatabaseError + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"message"], @"message"); + self.message = payload[@"message"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"code"], @"code"); + self.code = [payload[@"code"] integerValue]; + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithMessage:(NSString *)message code:(int)code +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(message, @"message"); + + self.message = message; + self.code = code; + + return self; +} + +- (void)setMessage:(NSString *)message +{ + [super setString:message forKey:@"message"]; +} + +- (NSString *)message +{ + return [super stringForKey:@"message"]; +} + +- (void)setCode:(int)code +{ + [super setInteger:code forKey:@"code"]; +} + +- (int)code +{ + return [super integerForKey:@"code"]; +} + +@end + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-command-with-invalid-platform.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-command-with-invalid-platform.json-error new file mode 100644 index 000000000..ec636c54b --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-command-with-invalid-platform.json-error @@ -0,0 +1 @@ +ERROR: Unknown platform: invalid diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-availability.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-availability.json-error new file mode 100644 index 000000000..90d7195d6 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-availability.json-error @@ -0,0 +1 @@ +ERROR: Malformed domain specification: availability is an unsupported string. Was: "webb", Allowed values: web diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-command-call-parameter-names.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-command-call-parameter-names.json-error new file mode 100644 index 000000000..3f756de32 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-command-call-parameter-names.json-error @@ -0,0 +1 @@ +ERROR: Malformed domain specification: call parameter list for command processPoints has duplicate parameter names diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-command-return-parameter-names.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-command-return-parameter-names.json-error new file mode 100644 index 000000000..ea148ff67 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-command-return-parameter-names.json-error @@ -0,0 +1 @@ +ERROR: Malformed domain specification: return parameter list for command processPoints has duplicate parameter names diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-event-parameter-names.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-event-parameter-names.json-error new file mode 100644 index 000000000..c71bbd21c --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-event-parameter-names.json-error @@ -0,0 +1 @@ +ERROR: Malformed domain specification: parameter list for event processedPoints has duplicate parameter names diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-type-declarations.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-type-declarations.json-error new file mode 100644 index 000000000..447cdf8e2 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-type-declarations.json-error @@ -0,0 +1 @@ +ERROR: Duplicate type declaration: Runtime.RemoteObjectId diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-type-member-names.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-type-member-names.json-error new file mode 100644 index 000000000..d5376a77a --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-type-member-names.json-error @@ -0,0 +1 @@ +ERROR: Malformed domain specification: type declaration for Point has duplicate member names diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-enum-with-no-values.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-enum-with-no-values.json-error new file mode 100644 index 000000000..2655c2b90 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-enum-with-no-values.json-error @@ -0,0 +1 @@ +ERROR: Type reference with enum values must have at least one enum value. diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-number-typed-optional-parameter-flag.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-number-typed-optional-parameter-flag.json-error new file mode 100644 index 000000000..97b2af0e4 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-number-typed-optional-parameter-flag.json-error @@ -0,0 +1 @@ +ERROR: The 'optional' flag for a parameter must be a boolean literal. diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-number-typed-optional-type-member.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-number-typed-optional-type-member.json-error new file mode 100644 index 000000000..86df3750c --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-number-typed-optional-type-member.json-error @@ -0,0 +1 @@ +ERROR: The 'optional' flag for a type member must be a boolean literal. diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-string-typed-optional-parameter-flag.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-string-typed-optional-parameter-flag.json-error new file mode 100644 index 000000000..97b2af0e4 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-string-typed-optional-parameter-flag.json-error @@ -0,0 +1 @@ +ERROR: The 'optional' flag for a parameter must be a boolean literal. diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-string-typed-optional-type-member.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-string-typed-optional-type-member.json-error new file mode 100644 index 000000000..86df3750c --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-string-typed-optional-type-member.json-error @@ -0,0 +1 @@ +ERROR: The 'optional' flag for a type member must be a boolean literal. diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-declaration-using-type-reference.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-declaration-using-type-reference.json-error new file mode 100644 index 000000000..42f5753a4 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-declaration-using-type-reference.json-error @@ -0,0 +1 @@ +ERROR: Type reference cannot have both 'type' and '$ref' keys. diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-reference-as-primitive-type.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-reference-as-primitive-type.json-error new file mode 100644 index 000000000..d76bc1c77 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-reference-as-primitive-type.json-error @@ -0,0 +1 @@ +ERROR: Type reference 'DatabaseId' is not a primitive type. Allowed values: integer, number, string, boolean, enum, object, array, any diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-with-invalid-platform.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-with-invalid-platform.json-error new file mode 100644 index 000000000..ec636c54b --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-with-invalid-platform.json-error @@ -0,0 +1 @@ +ERROR: Unknown platform: invalid diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-with-lowercase-name.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-with-lowercase-name.json-error new file mode 100644 index 000000000..4e462250c --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-with-lowercase-name.json-error @@ -0,0 +1 @@ +ERROR: Types must begin with an uppercase character. diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-unknown-type-reference-in-type-declaration.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-unknown-type-reference-in-type-declaration.json-error new file mode 100644 index 000000000..2d38e6467 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-unknown-type-reference-in-type-declaration.json-error @@ -0,0 +1 @@ +ERROR: Type reference 'dragon' is not a primitive type. Allowed values: integer, number, string, boolean, enum, object, array, any diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-unknown-type-reference-in-type-member.json-error b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-unknown-type-reference-in-type-member.json-error new file mode 100644 index 000000000..faf6672cb --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-unknown-type-reference-in-type-member.json-error @@ -0,0 +1 @@ +ERROR: Lookup failed for type reference: Color (referenced from domain: Fantasy) diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result new file mode 100644 index 000000000..9eeb0b1c9 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result @@ -0,0 +1,1230 @@ +### 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 generate-domains-with-feature-guards.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// Network1. +InspectorBackend.registerCommand("Network1.loadResource", [], []); +InspectorBackend.activateDomain("Network1"); + +// Network3. +InspectorBackend.registerNetwork3Dispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Network3"); +InspectorBackend.registerEvent("Network3.resourceLoaded", []); +InspectorBackend.activateDomain("Network3"); +### 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 generate-domains-with-feature-guards.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; +}; + + +#if PLATFORM(WEB_COMMANDS) +class AlternateNetwork1BackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateNetwork1BackendDispatcher() { } + virtual void loadResource(long callId) = 0; +}; +#endif // PLATFORM(WEB_COMMANDS) + +} // 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 generate-domains-with-feature-guards.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; + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +#if PLATFORM(WEB_COMMANDS) +class AlternateNetwork1BackendDispatcher; +#endif // PLATFORM(WEB_COMMANDS) +#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + +#if PLATFORM(WEB_COMMANDS) +class Network1BackendDispatcherHandler { +public: + virtual void loadResource(ErrorString&) = 0; +protected: + virtual ~Network1BackendDispatcherHandler(); +}; +#endif // PLATFORM(WEB_COMMANDS) + +#if PLATFORM(WEB_COMMANDS) +class Network1BackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<Network1BackendDispatcher> create(BackendDispatcher&, Network1BackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void loadResource(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateNetwork1BackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateNetwork1BackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + Network1BackendDispatcher(BackendDispatcher&, Network1BackendDispatcherHandler*); + Network1BackendDispatcherHandler* m_agent { nullptr }; +}; +#endif // PLATFORM(WEB_COMMANDS) + +} // 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 generate-domains-with-feature-guards.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 { + +#if PLATFORM(WEB_COMMANDS) +Network1BackendDispatcherHandler::~Network1BackendDispatcherHandler() { } +#endif // PLATFORM(WEB_COMMANDS) + +#if PLATFORM(WEB_COMMANDS) +Ref<Network1BackendDispatcher> Network1BackendDispatcher::create(BackendDispatcher& backendDispatcher, Network1BackendDispatcherHandler* agent) +{ + return adoptRef(*new Network1BackendDispatcher(backendDispatcher, agent)); +} + +Network1BackendDispatcher::Network1BackendDispatcher(BackendDispatcher& backendDispatcher, Network1BackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Network1"), this); +} + +void Network1BackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<Network1BackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "loadResource") + loadResource(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Network1", '.', method, "' was not found")); +} + +void Network1BackendDispatcher::loadResource(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->loadResource(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->loadResource(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} +#endif // PLATFORM(WEB_COMMANDS) + +} // 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 generate-domains-with-feature-guards.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; + +#if PLATFORM(WEB_EVENTS) +class Network3FrontendDispatcher { +public: + Network3FrontendDispatcher(FrontendRouter& frontendRouter) : m_frontendRouter(frontendRouter) { } + void resourceLoaded(); +private: + FrontendRouter& m_frontendRouter; +}; +#endif // PLATFORM(WEB_EVENTS) + +} // 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 generate-domains-with-feature-guards.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 { + +#if PLATFORM(WEB_EVENTS) +void Network3FrontendDispatcher::resourceLoaded() +{ + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network3.resourceLoaded")); + + m_frontendRouter.sendEvent(jsonMessage->toJSONString()); +} +#endif // PLATFORM(WEB_EVENTS) + +} // 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 generate-domains-with-feature-guards.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. +#if PLATFORM(WEB_TYPES) +namespace Network2 { +class NetworkError; +} // Network2 +#endif // PLATFORM(WEB_TYPES) +// End of forward declarations. + + + + +#if PLATFORM(WEB_TYPES) +namespace Network2 { +class NetworkError : public Inspector::InspectorObjectBase { +public: + enum { + NoFieldsSet = 0, + MessageSet = 1 << 0, + CodeSet = 1 << 1, + AllFieldsSet = (MessageSet | CodeSet) + }; + + 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</*NetworkError*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class NetworkError; + public: + + Builder<STATE | MessageSet>& setMessage(const String& value) + { + COMPILE_ASSERT(!(STATE & MessageSet), property_message_already_set); + m_result->setString(ASCIILiteral("message"), value); + return castState<MessageSet>(); + } + + Builder<STATE | CodeSet>& setCode(int value) + { + COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); + m_result->setInteger(ASCIILiteral("code"), value); + return castState<CodeSet>(); + } + + Ref<NetworkError> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(NetworkError) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<NetworkError>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<NetworkError> result = NetworkError::create() + * .setMessage(...) + * .setCode(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } +}; + +} // Network2 +#endif // PLATFORM(WEB_TYPES) + + + +} // 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 generate-domains-with-feature-guards.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 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 generate-domains-with-feature-guards.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h> +#include <wtf/RetainPtr.h> + +@protocol TestProtocolNetwork1DomainHandler; + +namespace Inspector { + + +#if PLATFORM(WEB_COMMANDS) +class ObjCInspectorNetwork1BackendDispatcher final : public AlternateNetwork1BackendDispatcher { +public: + ObjCInspectorNetwork1BackendDispatcher(id<TestProtocolNetwork1DomainHandler> handler) { m_delegate = handler; } + virtual void loadResource(long requestId) override; +private: + RetainPtr<id<TestProtocolNetwork1DomainHandler>> m_delegate; +}; +#endif // PLATFORM(WEB_COMMANDS) + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 generate-domains-with-feature-guards.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 { + +#if PLATFORM(WEB_COMMANDS) +void ObjCInspectorNetwork1BackendDispatcher::loadResource(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate loadResourceWithErrorCallback:errorCallback successCallback:successCallback]; +} + +#endif // PLATFORM(WEB_COMMANDS) + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 generate-domains-with-feature-guards.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <WebInspector/TestProtocol.h> + +__attribute__((visibility ("default"))) +@interface TestProtocolConfiguration : NSObject +@property (nonatomic, retain, setter=setNetwork1Handler:) id<TestProtocolNetwork1DomainHandler> network1Handler; +@property (nonatomic, readonly) TestProtocolNetwork3DomainEventDispatcher *network3EventDispatcher; +@end + + +### End File: TestProtocolConfiguration.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 generate-domains-with-feature-guards.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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; + id<TestProtocolNetwork1DomainHandler> _network1Handler; + TestProtocolNetwork3DomainEventDispatcher *_network3EventDispatcher; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)dealloc +{ + [_network1Handler release]; + [_network3EventDispatcher release]; + [super dealloc]; +} + +- (void)setNetwork1Handler:(id<TestProtocolNetwork1DomainHandler>)handler +{ + if (handler == _network1Handler) + return; + + [_network1Handler release]; + _network1Handler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorNetwork1BackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<Network1BackendDispatcher, AlternateNetwork1BackendDispatcher>>(ASCIILiteral("Network1"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolNetwork1DomainHandler>)network1Handler +{ + return _network1Handler; +} + +- (TestProtocolNetwork3DomainEventDispatcher *)network3EventDispatcher +{ + if (!_network3EventDispatcher) + _network3EventDispatcher = [[TestProtocolNetwork3DomainEventDispatcher alloc] initWithController:_controller]; + return _network3EventDispatcher; +} + +@end + + +### End File: TestProtocolConfiguration.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 generate-domains-with-feature-guards.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <JavaScriptCore/InspectorValues.h> + +using namespace Inspector; + +@implementation TestProtocolNetwork3DomainEventDispatcher +{ + AugmentableInspectorController* _controller; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller; +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)resourceLoaded +{ + const FrontendRouter& router = _controller->frontendRouter(); + + Ref<InspectorObject> jsonMessage = InspectorObject::create(); + jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network3.resourceLoaded")); + router.sendEvent(jsonMessage->toJSONString()); +} + +@end + + +### 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 generate-domains-with-feature-guards.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + +@class TestProtocolNetwork2NetworkError; + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + +__attribute__((visibility ("default"))) +@interface TestProtocolNetwork2NetworkError : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithMessage:(NSString *)message code:(int)code; +/* required */ @property (nonatomic, copy) NSString *message; +/* required */ @property (nonatomic, assign) int code; +@end + +@protocol TestProtocolNetwork1DomainHandler <NSObject> +@required +- (void)loadResourceWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +@end + +__attribute__((visibility ("default"))) +@interface TestProtocolNetwork3DomainEventDispatcher : NSObject +- (void)resourceLoaded; +@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 generate-domains-with-feature-guards.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> + +@interface TestProtocolNetwork3DomainEventDispatcher (Private) +- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller; +@end + + +### 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 generate-domains-with-feature-guards.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + + +} // 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 generate-domains-with-feature-guards.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (Network2Domain) + ++ (void)_parseNetworkError:(TestProtocolNetwork2NetworkError **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (Network2Domain) + ++ (void)_parseNetworkError:(TestProtocolNetwork2NetworkError **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolNetwork2NetworkError 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 generate-domains-with-feature-guards.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +@implementation TestProtocolNetwork2NetworkError + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"message"], @"message"); + self.message = payload[@"message"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"code"], @"code"); + self.code = [payload[@"code"] integerValue]; + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithMessage:(NSString *)message code:(int)code +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(message, @"message"); + + self.message = message; + self.code = code; + + return self; +} + +- (void)setMessage:(NSString *)message +{ + [super setString:message forKey:@"message"]; +} + +- (NSString *)message +{ + return [super stringForKey:@"message"]; +} + +- (void)setCode:(int)code +{ + [super setInteger:code forKey:@"code"]; +} + +- (int)code +{ + return [super integerForKey:@"code"]; +} + +@end + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result new file mode 100644 index 000000000..d65129eb8 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result @@ -0,0 +1,910 @@ +### 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 same-type-id-different-domain.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py +### 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 same-type-id-different-domain.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 same-type-id-different-domain.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 same-type-id-different-domain.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 same-type-id-different-domain.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 same-type-id-different-domain.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 same-type-id-different-domain.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 { + + + +// Typedefs. +namespace Runtime { +/* Unique object identifier. */ +typedef String RemoteObjectId; +} // Runtime + +namespace Runtime2 { +/* Unique object identifier. */ +typedef String RemoteObjectId; +} // Runtime2 +// End of typedefs. + + + +} // 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 same-type-id-different-domain.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 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 same-type-id-different-domain.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: 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 same-type-id-different-domain.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: 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 same-type-id-different-domain.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: 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 same-type-id-different-domain.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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: 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 same-type-id-different-domain.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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 same-type-id-different-domain.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + + + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + + + + + + + +### 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 same-type-id-different-domain.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 same-type-id-different-domain.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + + + + +} // 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 same-type-id-different-domain.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseRemoteObjectId:(NSString **)outValue fromPayload:(id)payload; + +@end +@interface TestProtocolTypeConversions (Runtime2Domain) + ++ (void)_parseRemoteObjectId:(NSString **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseRemoteObjectId:(NSString **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + *outValue = (NSString *)payload; +} + +@end +@implementation TestProtocolTypeConversions (Runtime2Domain) + ++ (void)_parseRemoteObjectId:(NSString **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + *outValue = (NSString *)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 same-type-id-different-domain.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + + + + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result new file mode 100644 index 000000000..b7eff1b15 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result @@ -0,0 +1,1119 @@ +### 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 shadowed-optional-type-setters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py +### 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 shadowed-optional-type-setters.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 shadowed-optional-type-setters.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 shadowed-optional-type-setters.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 shadowed-optional-type-setters.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 shadowed-optional-type-setters.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 shadowed-optional-type-setters.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 Runtime { +class KeyPath; +} // Runtime +// End of forward declarations. + + + + +namespace TestHelpers { + +String getEnumConstantValue(int code); + +template<typename T> String getEnumConstantValue(T enumValue) +{ + return getEnumConstantValue(static_cast<int>(enumValue)); +} + +} // namespace TestHelpers + +namespace Runtime { +/* Key path. */ +class KeyPath : public Inspector::InspectorObjectBase { +public: + // Named after property name 'type' while generating KeyPath. + enum class Type { + Null = 0, + String = 1, + Array = 2, + }; // enum class Type + enum { + NoFieldsSet = 0, + TypeSet = 1 << 0, + AllFieldsSet = (TypeSet) + }; + + 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</*KeyPath*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class KeyPath; + public: + + Builder<STATE | TypeSet>& setType(Type value) + { + COMPILE_ASSERT(!(STATE & TypeSet), property_type_already_set); + m_result->setString(ASCIILiteral("type"), Inspector::Protocol::TestHelpers::getEnumConstantValue(value)); + return castState<TypeSet>(); + } + + Ref<KeyPath> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(KeyPath) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<KeyPath>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<KeyPath> result = KeyPath::create() + * .setType(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } + + void setString(const String& value) + { + InspectorObjectBase::setString(ASCIILiteral("string"), value); + } + + void setArray(RefPtr<Inspector::Protocol::Array<String>> value) + { + InspectorObjectBase::setArray(ASCIILiteral("array"), WTFMove(value)); + } +}; + +} // Runtime + + + +namespace TestHelpers { + +template<typename ProtocolEnumType> +std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); + +// Enums in the 'Runtime' Domain +template<> +std::optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(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 shadowed-optional-type-setters.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[] = { + "null", + "string", + "array", +}; + +String getEnumConstantValue(int code) { + return enum_constant_values[code]; +} + +// Enums in the 'Runtime' Domain +template<> +std::optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String& protocolString) +{ + static const size_t constantValues[] = { + (size_t)Inspector::Protocol::Runtime::KeyPath::Type::Null, + (size_t)Inspector::Protocol::Runtime::KeyPath::Type::String, + (size_t)Inspector::Protocol::Runtime::KeyPath::Type::Array, + }; + for (size_t i = 0; i < 3; ++i) + if (protocolString == enum_constant_values[constantValues[i]]) + return (Inspector::Protocol::Runtime::KeyPath::Type)constantValues[i]; + + return std::nullopt; +} + + +} // namespace TestHelpers + + + +} // 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 shadowed-optional-type-setters.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: 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 shadowed-optional-type-setters.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: 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 shadowed-optional-type-setters.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: 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 shadowed-optional-type-setters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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: 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 shadowed-optional-type-setters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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 shadowed-optional-type-setters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + +@class TestProtocolRuntimeKeyPath; + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + +typedef NS_ENUM(NSInteger, TestProtocolRuntimeKeyPathType) { + TestProtocolRuntimeKeyPathTypeNull, + TestProtocolRuntimeKeyPathTypeString, + TestProtocolRuntimeKeyPathTypeArray, +}; + + +__attribute__((visibility ("default"))) +@interface TestProtocolRuntimeKeyPath : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithType:(TestProtocolRuntimeKeyPathType)type; +/* required */ @property (nonatomic, assign) TestProtocolRuntimeKeyPathType type; +/* optional */ @property (nonatomic, copy) NSString *string; +/* optional */ @property (nonatomic, copy) NSArray/*<NSString>*/ *array; +@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 shadowed-optional-type-setters.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 shadowed-optional-type-setters.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + +inline String toProtocolString(TestProtocolRuntimeKeyPathType value) +{ + switch(value) { + case TestProtocolRuntimeKeyPathTypeNull: + return ASCIILiteral("null"); + case TestProtocolRuntimeKeyPathTypeString: + return ASCIILiteral("string"); + case TestProtocolRuntimeKeyPathTypeArray: + return ASCIILiteral("array"); + } +} + +template<> +inline std::optional<TestProtocolRuntimeKeyPathType> fromProtocolString(const String& value) +{ + if (value == "null") + return TestProtocolRuntimeKeyPathTypeNull; + if (value == "string") + return TestProtocolRuntimeKeyPathTypeString; + if (value == "array") + return TestProtocolRuntimeKeyPathTypeArray; + return std::nullopt; +} + +} // 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 shadowed-optional-type-setters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseKeyPath:(TestProtocolRuntimeKeyPath **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseKeyPath:(TestProtocolRuntimeKeyPath **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolRuntimeKeyPath 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 shadowed-optional-type-setters.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +@implementation TestProtocolRuntimeKeyPath + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"type"], @"type"); + std::optional<TestProtocolRuntimeKeyPathType> type = fromProtocolString<TestProtocolRuntimeKeyPathType>(payload[@"type"]); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(type, @"type"); + self.type = type.value(); + + self.string = payload[@"string"]; + + self.array = objcArrayFromPayload<NSString>(payload[@"array"]); + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithType:(TestProtocolRuntimeKeyPathType)type +{ + if (!(self = [super init])) + return nil; + + self.type = type; + + return self; +} + +- (void)setType:(TestProtocolRuntimeKeyPathType)type +{ + [super setString:toProtocolString(type) forKey:@"type"]; +} + +- (TestProtocolRuntimeKeyPathType)type +{ + return fromProtocolString<TestProtocolRuntimeKeyPathType>([super stringForKey:@"type"]).value(); +} + +- (void)setString:(NSString *)string +{ + [super setString:string forKey:@"string"]; +} + +- (NSString *)string +{ + return [super stringForKey:@"string"]; +} + +- (void)setArray:(NSArray/*<NSString>*/ *)array +{ + [super setInspectorArray:inspectorStringArray(array) forKey:@"array"]; +} + +- (NSArray/*<NSString>*/ *)array +{ + return objcStringArray([super inspectorArrayForKey:@"array"]); +} + +@end + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result new file mode 100644 index 000000000..6ece43d9c --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result @@ -0,0 +1,887 @@ +### 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-declaration-aliased-primitive-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py +### 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-declaration-aliased-primitive-type.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-declaration-aliased-primitive-type.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-declaration-aliased-primitive-type.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-declaration-aliased-primitive-type.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-declaration-aliased-primitive-type.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-declaration-aliased-primitive-type.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 { + + + +// Typedefs. +namespace Runtime { +/* Unique object identifier. */ +typedef int RemoteObjectId; +} // Runtime +// End of typedefs. + + + +} // 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-declaration-aliased-primitive-type.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 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-declaration-aliased-primitive-type.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: 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-declaration-aliased-primitive-type.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: 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-declaration-aliased-primitive-type.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: 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-declaration-aliased-primitive-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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: 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-declaration-aliased-primitive-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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-declaration-aliased-primitive-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + + + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + + + + + + + +### 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-declaration-aliased-primitive-type.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-declaration-aliased-primitive-type.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + + +} // 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-declaration-aliased-primitive-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseRemoteObjectId:(NSNumber **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseRemoteObjectId:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]); + *outValue = (NSNumber *)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-declaration-aliased-primitive-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result new file mode 100644 index 000000000..d2a62c9ff --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result @@ -0,0 +1,1055 @@ +### 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-declaration-array-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// Debugger. +InspectorBackend.registerEnum("Debugger.Reason", {Died: "Died", Fainted: "Fainted", Hungry: "Hungry"}); +### 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-declaration-array-type.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-declaration-array-type.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-declaration-array-type.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-declaration-array-type.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-declaration-array-type.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-declaration-array-type.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 Debugger { +enum class Reason; +} // Debugger +// End of forward declarations. + + +// Typedefs. +namespace Debugger { +typedef int BreakpointId; +} // Debugger + +namespace Runtime { +typedef int ObjectId; +typedef Inspector::Protocol::Array<int> LuckyNumbers; +typedef Inspector::Protocol::Array<String> BabyNames; +typedef Inspector::Protocol::Array<Inspector::Protocol::Runtime::ObjectId> NewObjects; +typedef Inspector::Protocol::Array<Inspector::Protocol::Debugger::BreakpointId> OldObjects; +typedef Inspector::Protocol::Array<Inspector::Protocol::Debugger::Reason> StopReasons; +} // Runtime +// 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 Debugger { +/* */ +enum class Reason { + Died = 0, + Fainted = 1, + Hungry = 2, +}; // enum class Reason +} // Debugger + + + +namespace TestHelpers { + +template<typename ProtocolEnumType> +std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); + +// Enums in the 'Debugger' Domain +template<> +std::optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(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-declaration-array-type.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[] = { + "Died", + "Fainted", + "Hungry", +}; + +String getEnumConstantValue(int code) { + return enum_constant_values[code]; +} + +// Enums in the 'Debugger' Domain +template<> +std::optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String& protocolString) +{ + static const size_t constantValues[] = { + (size_t)Inspector::Protocol::Debugger::Reason::Died, + (size_t)Inspector::Protocol::Debugger::Reason::Fainted, + (size_t)Inspector::Protocol::Debugger::Reason::Hungry, + }; + for (size_t i = 0; i < 3; ++i) + if (protocolString == enum_constant_values[constantValues[i]]) + return (Inspector::Protocol::Debugger::Reason)constantValues[i]; + + return std::nullopt; +} + + +} // namespace TestHelpers + + + +} // 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-declaration-array-type.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: 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-declaration-array-type.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: 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-declaration-array-type.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: 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-declaration-array-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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: 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-declaration-array-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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-declaration-array-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + + + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + +typedef NS_ENUM(NSInteger, TestProtocolDebuggerReason) { + TestProtocolDebuggerReasonDied, + TestProtocolDebuggerReasonFainted, + TestProtocolDebuggerReasonHungry, +}; + + + + + + + + +### 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-declaration-array-type.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-declaration-array-type.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + +inline String toProtocolString(TestProtocolDebuggerReason value) +{ + switch(value) { + case TestProtocolDebuggerReasonDied: + return ASCIILiteral("Died"); + case TestProtocolDebuggerReasonFainted: + return ASCIILiteral("Fainted"); + case TestProtocolDebuggerReasonHungry: + return ASCIILiteral("Hungry"); + } +} + +template<> +inline std::optional<TestProtocolDebuggerReason> fromProtocolString(const String& value) +{ + if (value == "Died") + return TestProtocolDebuggerReasonDied; + if (value == "Fainted") + return TestProtocolDebuggerReasonFainted; + if (value == "Hungry") + return TestProtocolDebuggerReasonHungry; + return std::nullopt; +} + + + +} // 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-declaration-array-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (DebuggerDomain) + ++ (void)_parseBreakpointId:(NSNumber **)outValue fromPayload:(id)payload; ++ (void)_parseReason:(NSNumber **)outValue fromPayload:(id)payload; + +@end +@interface TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseObjectId:(NSNumber **)outValue fromPayload:(id)payload; ++ (void)_parseLuckyNumbers:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload; ++ (void)_parseBabyNames:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload; ++ (void)_parseNewObjects:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload; ++ (void)_parseOldObjects:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload; ++ (void)_parseStopReasons:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (DebuggerDomain) + ++ (void)_parseBreakpointId:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]); + *outValue = (NSNumber *)payload; +} + ++ (void)_parseReason:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + std::optional<TestProtocolDebuggerReason> result = Inspector::fromProtocolString<TestProtocolDebuggerReason>(payload); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"Reason"); + *outValue = @(result.value()); +} + +@end +@implementation TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseObjectId:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]); + *outValue = (NSNumber *)payload; +} + ++ (void)_parseLuckyNumbers:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSNumber>*/ class]); + *outValue = (NSArray/*<NSNumber>*/ *)payload; +} + ++ (void)_parseBabyNames:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]); + *outValue = (NSArray/*<NSString>*/ *)payload; +} + ++ (void)_parseNewObjects:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSNumber>*/ class]); + *outValue = (NSArray/*<NSNumber>*/ *)payload; +} + ++ (void)_parseOldObjects:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSNumber>*/ class]); + *outValue = (NSArray/*<NSNumber>*/ *)payload; +} + ++ (void)_parseStopReasons:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]); + *outValue = (NSArray/*<NSString>*/ *)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-declaration-array-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + + + + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result new file mode 100644 index 000000000..a1cfcf54b --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result @@ -0,0 +1,1064 @@ +### 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-declaration-enum-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// Runtime. +InspectorBackend.registerEnum("Runtime.FarmAnimals", {Pigs: "Pigs", Cows: "Cows", Cats: "Cats", Hens: "Hens"}); +InspectorBackend.registerEnum("Runtime.TwoLeggedAnimals", {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-declaration-enum-type.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-declaration-enum-type.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-declaration-enum-type.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-declaration-enum-type.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-declaration-enum-type.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-declaration-enum-type.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 Runtime { +enum class FarmAnimals; +enum class TwoLeggedAnimals; +} // Runtime +// End of forward declarations. + + + + +namespace TestHelpers { + +String getEnumConstantValue(int code); + +template<typename T> String getEnumConstantValue(T enumValue) +{ + return getEnumConstantValue(static_cast<int>(enumValue)); +} + +} // namespace TestHelpers + +namespace Runtime { +/* */ +enum class FarmAnimals { + Pigs = 0, + Cows = 1, + Cats = 2, + Hens = 3, +}; // enum class FarmAnimals +/* */ +enum class TwoLeggedAnimals { + Ducks = 4, + Hens = 3, + Crows = 5, + Flamingos = 6, +}; // enum class TwoLeggedAnimals +} // Runtime + + + +namespace TestHelpers { + +template<typename ProtocolEnumType> +std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); + +// Enums in the 'Runtime' Domain +template<> +std::optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String&); +template<> +std::optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(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-declaration-enum-type.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[] = { + "Pigs", + "Cows", + "Cats", + "Hens", + "Ducks", + "Crows", + "Flamingos", +}; + +String getEnumConstantValue(int code) { + return enum_constant_values[code]; +} + +// Enums in the 'Runtime' Domain +template<> +std::optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String& protocolString) +{ + static const size_t constantValues[] = { + (size_t)Inspector::Protocol::Runtime::FarmAnimals::Pigs, + (size_t)Inspector::Protocol::Runtime::FarmAnimals::Cows, + (size_t)Inspector::Protocol::Runtime::FarmAnimals::Cats, + (size_t)Inspector::Protocol::Runtime::FarmAnimals::Hens, + }; + for (size_t i = 0; i < 4; ++i) + if (protocolString == enum_constant_values[constantValues[i]]) + return (Inspector::Protocol::Runtime::FarmAnimals)constantValues[i]; + + return std::nullopt; +} + +template<> +std::optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String& protocolString) +{ + static const size_t constantValues[] = { + (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Ducks, + (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Hens, + (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Crows, + (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Flamingos, + }; + for (size_t i = 0; i < 4; ++i) + if (protocolString == enum_constant_values[constantValues[i]]) + return (Inspector::Protocol::Runtime::TwoLeggedAnimals)constantValues[i]; + + return std::nullopt; +} + + +} // namespace TestHelpers + + + +} // 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-declaration-enum-type.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: 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-declaration-enum-type.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: 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-declaration-enum-type.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: 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-declaration-enum-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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: 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-declaration-enum-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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-declaration-enum-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + + + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + +typedef NS_ENUM(NSInteger, TestProtocolRuntimeFarmAnimals) { + TestProtocolRuntimeFarmAnimalsPigs, + TestProtocolRuntimeFarmAnimalsCows, + TestProtocolRuntimeFarmAnimalsCats, + TestProtocolRuntimeFarmAnimalsHens, +}; + +typedef NS_ENUM(NSInteger, TestProtocolRuntimeTwoLeggedAnimals) { + TestProtocolRuntimeTwoLeggedAnimalsDucks, + TestProtocolRuntimeTwoLeggedAnimalsHens, + TestProtocolRuntimeTwoLeggedAnimalsCrows, + TestProtocolRuntimeTwoLeggedAnimalsFlamingos, +}; + + + + + + + + +### 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-declaration-enum-type.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-declaration-enum-type.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + +inline String toProtocolString(TestProtocolRuntimeFarmAnimals value) +{ + switch(value) { + case TestProtocolRuntimeFarmAnimalsPigs: + return ASCIILiteral("Pigs"); + case TestProtocolRuntimeFarmAnimalsCows: + return ASCIILiteral("Cows"); + case TestProtocolRuntimeFarmAnimalsCats: + return ASCIILiteral("Cats"); + case TestProtocolRuntimeFarmAnimalsHens: + return ASCIILiteral("Hens"); + } +} + +template<> +inline std::optional<TestProtocolRuntimeFarmAnimals> fromProtocolString(const String& value) +{ + if (value == "Pigs") + return TestProtocolRuntimeFarmAnimalsPigs; + if (value == "Cows") + return TestProtocolRuntimeFarmAnimalsCows; + if (value == "Cats") + return TestProtocolRuntimeFarmAnimalsCats; + if (value == "Hens") + return TestProtocolRuntimeFarmAnimalsHens; + return std::nullopt; +} + +inline String toProtocolString(TestProtocolRuntimeTwoLeggedAnimals value) +{ + switch(value) { + case TestProtocolRuntimeTwoLeggedAnimalsDucks: + return ASCIILiteral("Ducks"); + case TestProtocolRuntimeTwoLeggedAnimalsHens: + return ASCIILiteral("Hens"); + case TestProtocolRuntimeTwoLeggedAnimalsCrows: + return ASCIILiteral("Crows"); + case TestProtocolRuntimeTwoLeggedAnimalsFlamingos: + return ASCIILiteral("Flamingos"); + } +} + +template<> +inline std::optional<TestProtocolRuntimeTwoLeggedAnimals> fromProtocolString(const String& value) +{ + if (value == "Ducks") + return TestProtocolRuntimeTwoLeggedAnimalsDucks; + if (value == "Hens") + return TestProtocolRuntimeTwoLeggedAnimalsHens; + if (value == "Crows") + return TestProtocolRuntimeTwoLeggedAnimalsCrows; + if (value == "Flamingos") + return TestProtocolRuntimeTwoLeggedAnimalsFlamingos; + return std::nullopt; +} + +} // 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-declaration-enum-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseFarmAnimals:(NSNumber **)outValue fromPayload:(id)payload; ++ (void)_parseTwoLeggedAnimals:(NSNumber **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (RuntimeDomain) + ++ (void)_parseFarmAnimals:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + std::optional<TestProtocolRuntimeFarmAnimals> result = Inspector::fromProtocolString<TestProtocolRuntimeFarmAnimals>(payload); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"FarmAnimals"); + *outValue = @(result.value()); +} + ++ (void)_parseTwoLeggedAnimals:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + std::optional<TestProtocolRuntimeTwoLeggedAnimals> result = Inspector::fromProtocolString<TestProtocolRuntimeTwoLeggedAnimals>(payload); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"TwoLeggedAnimals"); + *outValue = @(result.value()); +} + +@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-declaration-enum-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result new file mode 100644 index 000000000..1b23ab2a9 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result @@ -0,0 +1,2012 @@ +### 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-declaration-object-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py +### 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-declaration-object-type.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-declaration-object-type.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-declaration-object-type.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-declaration-object-type.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-declaration-object-type.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-declaration-object-type.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 Database { +class Error; +class OptionalParameterBundle; +class ParameterBundle; +class ObjectWithPropertyNameConflicts; +class DummyObject; +} // Database + +namespace Test { +class ParameterBundle; +} // Test +// End of forward declarations. + + +// Typedefs. +namespace Database { +typedef Inspector::Protocol::Array<Inspector::Protocol::Database::Error> ErrorList; +} // Database +// End of typedefs. + +namespace Database { +/* Database error. */ +class Error : public Inspector::InspectorObjectBase { +public: + enum { + NoFieldsSet = 0, + MessageSet = 1 << 0, + CodeSet = 1 << 1, + AllFieldsSet = (MessageSet | CodeSet) + }; + + 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</*Error*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class Error; + public: + + Builder<STATE | MessageSet>& setMessage(const String& value) + { + COMPILE_ASSERT(!(STATE & MessageSet), property_message_already_set); + m_result->setString(ASCIILiteral("message"), value); + return castState<MessageSet>(); + } + + Builder<STATE | CodeSet>& setCode(int value) + { + COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); + m_result->setInteger(ASCIILiteral("code"), value); + return castState<CodeSet>(); + } + + Ref<Error> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(Error) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<Error>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<Error> result = Error::create() + * .setMessage(...) + * .setCode(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } +}; + +class OptionalParameterBundle : 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</*OptionalParameterBundle*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class OptionalParameterBundle; + public: + + Ref<OptionalParameterBundle> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(OptionalParameterBundle) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<OptionalParameterBundle>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<OptionalParameterBundle> result = OptionalParameterBundle::create() + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } + + void setColumnNames(RefPtr<Inspector::Protocol::Array<String>> value) + { + InspectorObjectBase::setArray(ASCIILiteral("columnNames"), WTFMove(value)); + } + + void setNotes(const String& value) + { + InspectorObjectBase::setString(ASCIILiteral("notes"), value); + } + + void setTimestamp(double value) + { + InspectorObjectBase::setDouble(ASCIILiteral("timestamp"), value); + } + + void setValues(RefPtr<Inspector::InspectorObject> value) + { + InspectorObjectBase::setObject(ASCIILiteral("values"), WTFMove(value)); + } + + void setPayload(RefPtr<Inspector::InspectorValue> value) + { + InspectorObjectBase::setValue(ASCIILiteral("payload"), WTFMove(value)); + } + + void setError(RefPtr<Inspector::Protocol::Database::Error> value) + { + InspectorObjectBase::setObject(ASCIILiteral("error"), WTFMove(value)); + } + + void setErrorList(RefPtr<Inspector::Protocol::Database::ErrorList> value) + { + InspectorObjectBase::setArray(ASCIILiteral("errorList"), WTFMove(value)); + } +}; + +class ParameterBundle : public Inspector::InspectorObjectBase { +public: + enum { + NoFieldsSet = 0, + ColumnNamesSet = 1 << 0, + NotesSet = 1 << 1, + TimestampSet = 1 << 2, + ValuesSet = 1 << 3, + PayloadSet = 1 << 4, + ErrorSet = 1 << 5, + ErrorListSet = 1 << 6, + AllFieldsSet = (ColumnNamesSet | NotesSet | TimestampSet | ValuesSet | PayloadSet | ErrorSet | ErrorListSet) + }; + + 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</*ParameterBundle*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class ParameterBundle; + public: + + Builder<STATE | ColumnNamesSet>& setColumnNames(RefPtr<Inspector::Protocol::Array<String>> value) + { + COMPILE_ASSERT(!(STATE & ColumnNamesSet), property_columnNames_already_set); + m_result->setArray(ASCIILiteral("columnNames"), value); + return castState<ColumnNamesSet>(); + } + + Builder<STATE | NotesSet>& setNotes(const String& value) + { + COMPILE_ASSERT(!(STATE & NotesSet), property_notes_already_set); + m_result->setString(ASCIILiteral("notes"), value); + return castState<NotesSet>(); + } + + Builder<STATE | TimestampSet>& setTimestamp(double value) + { + COMPILE_ASSERT(!(STATE & TimestampSet), property_timestamp_already_set); + m_result->setDouble(ASCIILiteral("timestamp"), value); + return castState<TimestampSet>(); + } + + Builder<STATE | ValuesSet>& setValues(RefPtr<Inspector::InspectorObject> value) + { + COMPILE_ASSERT(!(STATE & ValuesSet), property_values_already_set); + m_result->setObject(ASCIILiteral("values"), value); + return castState<ValuesSet>(); + } + + Builder<STATE | PayloadSet>& setPayload(RefPtr<Inspector::InspectorValue> value) + { + COMPILE_ASSERT(!(STATE & PayloadSet), property_payload_already_set); + m_result->setValue(ASCIILiteral("payload"), value); + return castState<PayloadSet>(); + } + + Builder<STATE | ErrorSet>& setError(RefPtr<Inspector::Protocol::Database::Error> value) + { + COMPILE_ASSERT(!(STATE & ErrorSet), property_error_already_set); + m_result->setObject(ASCIILiteral("error"), value); + return castState<ErrorSet>(); + } + + Builder<STATE | ErrorListSet>& setErrorList(RefPtr<Inspector::Protocol::Database::ErrorList> value) + { + COMPILE_ASSERT(!(STATE & ErrorListSet), property_errorList_already_set); + m_result->setArray(ASCIILiteral("errorList"), value); + return castState<ErrorListSet>(); + } + + Ref<ParameterBundle> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(ParameterBundle) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<ParameterBundle>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<ParameterBundle> result = ParameterBundle::create() + * .setColumnNames(...) + * .setNotes(...) + * .setTimestamp(...) + * .setValues(...) + * .setPayload(...) + * .setError(...) + * .setErrorList(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } +}; + +/* Conflicted names may cause generated getters/setters to clash with built-in InspectorObject methods. */ +class ObjectWithPropertyNameConflicts : public Inspector::InspectorObjectBase { +public: + enum { + NoFieldsSet = 0, + IntegerSet = 1 << 0, + ArraySet = 1 << 1, + StringSet = 1 << 2, + ValueSet = 1 << 3, + ObjectSet = 1 << 4, + AllFieldsSet = (IntegerSet | ArraySet | StringSet | ValueSet | ObjectSet) + }; + + 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</*ObjectWithPropertyNameConflicts*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class ObjectWithPropertyNameConflicts; + public: + + Builder<STATE | IntegerSet>& setInteger(const String& value) + { + COMPILE_ASSERT(!(STATE & IntegerSet), property_integer_already_set); + m_result->setString(ASCIILiteral("integer"), value); + return castState<IntegerSet>(); + } + + Builder<STATE | ArraySet>& setArray(const String& value) + { + COMPILE_ASSERT(!(STATE & ArraySet), property_array_already_set); + m_result->setString(ASCIILiteral("array"), value); + return castState<ArraySet>(); + } + + 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 | ValueSet>& setValue(const String& value) + { + COMPILE_ASSERT(!(STATE & ValueSet), property_value_already_set); + m_result->setString(ASCIILiteral("value"), value); + return castState<ValueSet>(); + } + + Builder<STATE | ObjectSet>& setObject(const String& value) + { + COMPILE_ASSERT(!(STATE & ObjectSet), property_object_already_set); + m_result->setString(ASCIILiteral("object"), value); + return castState<ObjectSet>(); + } + + Ref<ObjectWithPropertyNameConflicts> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(ObjectWithPropertyNameConflicts) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<ObjectWithPropertyNameConflicts>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<ObjectWithPropertyNameConflicts> result = ObjectWithPropertyNameConflicts::create() + * .setInteger(...) + * .setArray(...) + * .setString(...) + * .setValue(...) + * .setObject(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } +}; + +} // Database + +namespace Test { +class ParameterBundle : public Inspector::InspectorObjectBase { +public: + enum { + NoFieldsSet = 0, + ColumnNamesSet = 1 << 0, + NotesSet = 1 << 1, + TimestampSet = 1 << 2, + ValuesSet = 1 << 3, + PayloadSet = 1 << 4, + ErrorSet = 1 << 5, + AllFieldsSet = (ColumnNamesSet | NotesSet | TimestampSet | ValuesSet | PayloadSet | ErrorSet) + }; + + 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</*ParameterBundle*/InspectorObject>&& object) + : m_result(WTFMove(object)) + { + COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state); + } + friend class ParameterBundle; + public: + + Builder<STATE | ColumnNamesSet>& setColumnNames(RefPtr<Inspector::Protocol::Array<String>> value) + { + COMPILE_ASSERT(!(STATE & ColumnNamesSet), property_columnNames_already_set); + m_result->setArray(ASCIILiteral("columnNames"), value); + return castState<ColumnNamesSet>(); + } + + Builder<STATE | NotesSet>& setNotes(const String& value) + { + COMPILE_ASSERT(!(STATE & NotesSet), property_notes_already_set); + m_result->setString(ASCIILiteral("notes"), value); + return castState<NotesSet>(); + } + + Builder<STATE | TimestampSet>& setTimestamp(double value) + { + COMPILE_ASSERT(!(STATE & TimestampSet), property_timestamp_already_set); + m_result->setDouble(ASCIILiteral("timestamp"), value); + return castState<TimestampSet>(); + } + + Builder<STATE | ValuesSet>& setValues(RefPtr<Inspector::InspectorObject> value) + { + COMPILE_ASSERT(!(STATE & ValuesSet), property_values_already_set); + m_result->setObject(ASCIILiteral("values"), value); + return castState<ValuesSet>(); + } + + Builder<STATE | PayloadSet>& setPayload(RefPtr<Inspector::InspectorValue> value) + { + COMPILE_ASSERT(!(STATE & PayloadSet), property_payload_already_set); + m_result->setValue(ASCIILiteral("payload"), value); + return castState<PayloadSet>(); + } + + Builder<STATE | ErrorSet>& setError(RefPtr<Inspector::Protocol::Database::Error> value) + { + COMPILE_ASSERT(!(STATE & ErrorSet), property_error_already_set); + m_result->setObject(ASCIILiteral("error"), value); + return castState<ErrorSet>(); + } + + Ref<ParameterBundle> release() + { + COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready); + COMPILE_ASSERT(sizeof(ParameterBundle) == sizeof(InspectorObject), cannot_cast); + + Ref<InspectorObject> result = m_result.releaseNonNull(); + return WTFMove(*reinterpret_cast<Ref<ParameterBundle>*>(&result)); + } + }; + + /* + * Synthetic constructor: + * Ref<ParameterBundle> result = ParameterBundle::create() + * .setColumnNames(...) + * .setNotes(...) + * .setTimestamp(...) + * .setValues(...) + * .setPayload(...) + * .setError(...) + * .release(); + */ + static Builder<NoFieldsSet> create() + { + return Builder<NoFieldsSet>(InspectorObject::create()); + } +}; + +} // Test + + + +} // 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-declaration-object-type.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 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-declaration-object-type.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: 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-declaration-object-type.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: 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-declaration-object-type.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: 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-declaration-object-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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: 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-declaration-object-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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-declaration-object-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + +@class TestProtocolDatabaseError; +@class TestProtocolDatabaseOptionalParameterBundle; +@class TestProtocolDatabaseParameterBundle; +@class TestProtocolDatabaseObjectWithPropertyNameConflicts; +@class TestProtocolDatabaseDummyObject; +@class TestProtocolTestParameterBundle; + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + +__attribute__((visibility ("default"))) +@interface TestProtocolDatabaseError : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithMessage:(NSString *)message code:(int)code; +/* required */ @property (nonatomic, copy) NSString *message; +/* required */ @property (nonatomic, assign) int code; +@end + +__attribute__((visibility ("default"))) +@interface TestProtocolDatabaseOptionalParameterBundle : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +/* optional */ @property (nonatomic, copy) NSArray/*<NSString>*/ *columnNames; +/* optional */ @property (nonatomic, copy) NSString *notes; +/* optional */ @property (nonatomic, assign) double timestamp; +/* optional */ @property (nonatomic, retain) RWIProtocolJSONObject *values; +/* optional */ @property (nonatomic, retain) RWIProtocolJSONObject *payload; +/* optional */ @property (nonatomic, retain) TestProtocolDatabaseError *error; +/* optional */ @property (nonatomic, copy) NSArray/*<TestProtocolDatabaseError>*/ *errorList; +@end + +__attribute__((visibility ("default"))) +@interface TestProtocolDatabaseParameterBundle : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithColumnNames:(NSArray/*<NSString>*/ *)columnNames notes:(NSString *)notes timestamp:(double)timestamp values:(RWIProtocolJSONObject *)values payload:(RWIProtocolJSONObject *)payload error:(TestProtocolDatabaseError *)error errorList:(NSArray/*<TestProtocolDatabaseError>*/ *)errorList; +/* required */ @property (nonatomic, copy) NSArray/*<NSString>*/ *columnNames; +/* required */ @property (nonatomic, copy) NSString *notes; +/* required */ @property (nonatomic, assign) double timestamp; +/* required */ @property (nonatomic, retain) RWIProtocolJSONObject *values; +/* required */ @property (nonatomic, retain) RWIProtocolJSONObject *payload; +/* required */ @property (nonatomic, retain) TestProtocolDatabaseError *error; +/* required */ @property (nonatomic, copy) NSArray/*<TestProtocolDatabaseError>*/ *errorList; +@end + +__attribute__((visibility ("default"))) +@interface TestProtocolDatabaseObjectWithPropertyNameConflicts : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithInteger:(NSString *)integer array:(NSString *)array string:(NSString *)string value:(NSString *)value object:(NSString *)object; +/* required */ @property (nonatomic, copy) NSString *integer; +/* required */ @property (nonatomic, copy) NSString *array; +/* required */ @property (nonatomic, copy) NSString *string; +/* required */ @property (nonatomic, copy) NSString *value; +/* required */ @property (nonatomic, copy) NSString *object; +@end + +__attribute__((visibility ("default"))) +@interface TestProtocolDatabaseDummyObject : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +@end + +__attribute__((visibility ("default"))) +@interface TestProtocolTestParameterBundle : RWIProtocolJSONObject +- (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload; +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject; +- (instancetype)initWithColumnNames:(NSArray/*<NSString>*/ *)columnNames notes:(NSString *)notes timestamp:(double)timestamp values:(RWIProtocolJSONObject *)values payload:(RWIProtocolJSONObject *)payload error:(TestProtocolDatabaseError *)error; +/* required */ @property (nonatomic, copy) NSArray/*<NSString>*/ *columnNames; +/* required */ @property (nonatomic, copy) NSString *notes; +/* required */ @property (nonatomic, assign) double timestamp; +/* required */ @property (nonatomic, retain) RWIProtocolJSONObject *values; +/* required */ @property (nonatomic, retain) RWIProtocolJSONObject *payload; +/* required */ @property (nonatomic, retain) TestProtocolDatabaseError *error; +@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-declaration-object-type.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-declaration-object-type.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + + + + +} // 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-declaration-object-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + +@interface TestProtocolTypeConversions (DatabaseDomain) + ++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload; ++ (void)_parseErrorList:(NSArray/*<TestProtocolDatabaseError>*/ **)outValue fromPayload:(id)payload; ++ (void)_parseOptionalParameterBundle:(TestProtocolDatabaseOptionalParameterBundle **)outValue fromPayload:(id)payload; ++ (void)_parseParameterBundle:(TestProtocolDatabaseParameterBundle **)outValue fromPayload:(id)payload; ++ (void)_parseObjectWithPropertyNameConflicts:(TestProtocolDatabaseObjectWithPropertyNameConflicts **)outValue fromPayload:(id)payload; ++ (void)_parseDummyObject:(TestProtocolDatabaseDummyObject **)outValue fromPayload:(id)payload; + +@end +@interface TestProtocolTypeConversions (TestDomain) + ++ (void)_parseParameterBundle:(TestProtocolTestParameterBundle **)outValue fromPayload:(id)payload; + +@end + +@implementation TestProtocolTypeConversions (DatabaseDomain) + ++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolDatabaseError alloc] initWithPayload:payload]; +} + ++ (void)_parseErrorList:(NSArray/*<TestProtocolDatabaseError>*/ **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<TestProtocolDatabaseError>*/ class]); + *outValue = (NSArray/*<TestProtocolDatabaseError>*/ *)payload; +} + ++ (void)_parseOptionalParameterBundle:(TestProtocolDatabaseOptionalParameterBundle **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolDatabaseOptionalParameterBundle alloc] initWithPayload:payload]; +} + ++ (void)_parseParameterBundle:(TestProtocolDatabaseParameterBundle **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolDatabaseParameterBundle alloc] initWithPayload:payload]; +} + ++ (void)_parseObjectWithPropertyNameConflicts:(TestProtocolDatabaseObjectWithPropertyNameConflicts **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolDatabaseObjectWithPropertyNameConflicts alloc] initWithPayload:payload]; +} + ++ (void)_parseDummyObject:(TestProtocolDatabaseDummyObject **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolDatabaseDummyObject alloc] initWithPayload:payload]; +} + +@end +@implementation TestProtocolTypeConversions (TestDomain) + ++ (void)_parseParameterBundle:(TestProtocolTestParameterBundle **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); + *outValue = [[TestProtocolTestParameterBundle 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-declaration-object-type.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +@implementation TestProtocolDatabaseError + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"message"], @"message"); + self.message = payload[@"message"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"code"], @"code"); + self.code = [payload[@"code"] integerValue]; + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithMessage:(NSString *)message code:(int)code +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(message, @"message"); + + self.message = message; + self.code = code; + + return self; +} + +- (void)setMessage:(NSString *)message +{ + [super setString:message forKey:@"message"]; +} + +- (NSString *)message +{ + return [super stringForKey:@"message"]; +} + +- (void)setCode:(int)code +{ + [super setInteger:code forKey:@"code"]; +} + +- (int)code +{ + return [super integerForKey:@"code"]; +} + +@end + +@implementation TestProtocolDatabaseOptionalParameterBundle + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + self.columnNames = objcArrayFromPayload<NSString>(payload[@"columnNames"]); + + self.notes = payload[@"notes"]; + + self.timestamp = [payload[@"timestamp"] doubleValue]; + + self.values = payload[@"values"]; + + self.payload = payload[@"payload"]; + + self.error = [[TestProtocolDatabaseError alloc] initWithPayload:payload[@"error"]]; + + self.errorList = objcArrayFromPayload<TestProtocolDatabaseError>(payload[@"errorList"]); + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (void)setColumnNames:(NSArray/*<NSString>*/ *)columnNames +{ + [super setInspectorArray:inspectorStringArray(columnNames) forKey:@"columnNames"]; +} + +- (NSArray/*<NSString>*/ *)columnNames +{ + return objcStringArray([super inspectorArrayForKey:@"columnNames"]); +} + +- (void)setNotes:(NSString *)notes +{ + [super setString:notes forKey:@"notes"]; +} + +- (NSString *)notes +{ + return [super stringForKey:@"notes"]; +} + +- (void)setTimestamp:(double)timestamp +{ + [super setDouble:timestamp forKey:@"timestamp"]; +} + +- (double)timestamp +{ + return [super doubleForKey:@"timestamp"]; +} + +- (void)setValues:(RWIProtocolJSONObject *)values +{ + [super setObject:values forKey:@"values"]; +} + +- (RWIProtocolJSONObject *)values +{ + return [[RWIProtocolJSONObject alloc] initWithInspectorObject:[[super objectForKey:@"values"] toInspectorObject].get()]; +} + +- (void)setPayload:(RWIProtocolJSONObject *)payload +{ + [super setObject:payload forKey:@"payload"]; +} + +- (RWIProtocolJSONObject *)payload +{ + return [[RWIProtocolJSONObject alloc] initWithInspectorObject:[[super objectForKey:@"payload"] toInspectorObject].get()]; +} + +- (void)setError:(TestProtocolDatabaseError *)error +{ + [super setObject:error forKey:@"error"]; +} + +- (TestProtocolDatabaseError *)error +{ + return [[TestProtocolDatabaseError alloc] initWithInspectorObject:[[super objectForKey:@"error"] toInspectorObject].get()]; +} + +- (void)setErrorList:(NSArray/*<TestProtocolDatabaseError>*/ *)errorList +{ + THROW_EXCEPTION_FOR_BAD_TYPE_IN_ARRAY(errorList, [TestProtocolDatabaseError class]); + [super setInspectorArray:inspectorObjectArray(errorList) forKey:@"errorList"]; +} + +- (NSArray/*<TestProtocolDatabaseError>*/ *)errorList +{ + return objcArray<TestProtocolDatabaseError>([super inspectorArrayForKey:@"errorList"]); +} + +@end + +@implementation TestProtocolDatabaseParameterBundle + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"columnNames"], @"columnNames"); + self.columnNames = objcArrayFromPayload<NSString>(payload[@"columnNames"]); + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"notes"], @"notes"); + self.notes = payload[@"notes"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"timestamp"], @"timestamp"); + self.timestamp = [payload[@"timestamp"] doubleValue]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"values"], @"values"); + self.values = payload[@"values"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"payload"], @"payload"); + self.payload = payload[@"payload"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"error"], @"error"); + self.error = [[TestProtocolDatabaseError alloc] initWithPayload:payload[@"error"]]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"errorList"], @"errorList"); + self.errorList = objcArrayFromPayload<TestProtocolDatabaseError>(payload[@"errorList"]); + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithColumnNames:(NSArray/*<NSString>*/ *)columnNames notes:(NSString *)notes timestamp:(double)timestamp values:(RWIProtocolJSONObject *)values payload:(RWIProtocolJSONObject *)payload error:(TestProtocolDatabaseError *)error errorList:(NSArray/*<TestProtocolDatabaseError>*/ *)errorList +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(notes, @"notes"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(values, @"values"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload, @"payload"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(error, @"error"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(errorList, @"errorList"); + THROW_EXCEPTION_FOR_BAD_TYPE_IN_ARRAY(errorList, [TestProtocolDatabaseError class]); + + self.columnNames = columnNames; + self.notes = notes; + self.timestamp = timestamp; + self.values = values; + self.payload = payload; + self.error = error; + self.errorList = errorList; + + return self; +} + +- (void)setColumnNames:(NSArray/*<NSString>*/ *)columnNames +{ + [super setInspectorArray:inspectorStringArray(columnNames) forKey:@"columnNames"]; +} + +- (NSArray/*<NSString>*/ *)columnNames +{ + return objcStringArray([super inspectorArrayForKey:@"columnNames"]); +} + +- (void)setNotes:(NSString *)notes +{ + [super setString:notes forKey:@"notes"]; +} + +- (NSString *)notes +{ + return [super stringForKey:@"notes"]; +} + +- (void)setTimestamp:(double)timestamp +{ + [super setDouble:timestamp forKey:@"timestamp"]; +} + +- (double)timestamp +{ + return [super doubleForKey:@"timestamp"]; +} + +- (void)setValues:(RWIProtocolJSONObject *)values +{ + [super setObject:values forKey:@"values"]; +} + +- (RWIProtocolJSONObject *)values +{ + return [[RWIProtocolJSONObject alloc] initWithInspectorObject:[[super objectForKey:@"values"] toInspectorObject].get()]; +} + +- (void)setPayload:(RWIProtocolJSONObject *)payload +{ + [super setObject:payload forKey:@"payload"]; +} + +- (RWIProtocolJSONObject *)payload +{ + return [[RWIProtocolJSONObject alloc] initWithInspectorObject:[[super objectForKey:@"payload"] toInspectorObject].get()]; +} + +- (void)setError:(TestProtocolDatabaseError *)error +{ + [super setObject:error forKey:@"error"]; +} + +- (TestProtocolDatabaseError *)error +{ + return [[TestProtocolDatabaseError alloc] initWithInspectorObject:[[super objectForKey:@"error"] toInspectorObject].get()]; +} + +- (void)setErrorList:(NSArray/*<TestProtocolDatabaseError>*/ *)errorList +{ + THROW_EXCEPTION_FOR_BAD_TYPE_IN_ARRAY(errorList, [TestProtocolDatabaseError class]); + [super setInspectorArray:inspectorObjectArray(errorList) forKey:@"errorList"]; +} + +- (NSArray/*<TestProtocolDatabaseError>*/ *)errorList +{ + return objcArray<TestProtocolDatabaseError>([super inspectorArrayForKey:@"errorList"]); +} + +@end + +@implementation TestProtocolDatabaseObjectWithPropertyNameConflicts + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"integer"], @"integer"); + self.integer = payload[@"integer"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"array"], @"array"); + self.array = payload[@"array"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"string"], @"string"); + self.string = payload[@"string"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"value"], @"value"); + self.value = payload[@"value"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"object"], @"object"); + self.object = payload[@"object"]; + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithInteger:(NSString *)integer array:(NSString *)array string:(NSString *)string value:(NSString *)value object:(NSString *)object +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(integer, @"integer"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(array, @"array"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(string, @"string"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(value, @"value"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(object, @"object"); + + self.integer = integer; + self.array = array; + self.string = string; + self.value = value; + self.object = object; + + return self; +} + +- (void)setInteger:(NSString *)integer +{ + [super setString:integer forKey:@"integer"]; +} + +- (NSString *)integer +{ + return [super stringForKey:@"integer"]; +} + +- (void)setArray:(NSString *)array +{ + [super setString:array forKey:@"array"]; +} + +- (NSString *)array +{ + return [super stringForKey:@"array"]; +} + +- (void)setString:(NSString *)string +{ + [super setString:string forKey:@"string"]; +} + +- (NSString *)string +{ + return [super stringForKey:@"string"]; +} + +- (void)setValue:(NSString *)value +{ + [super setString:value forKey:@"value"]; +} + +- (NSString *)value +{ + return [super stringForKey:@"value"]; +} + +- (void)setObject:(NSString *)object +{ + [super setString:object forKey:@"object"]; +} + +- (NSString *)object +{ + return [super stringForKey:@"object"]; +} + +@end + +@implementation TestProtocolDatabaseDummyObject + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +@end + + +@implementation TestProtocolTestParameterBundle + +- (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"columnNames"], @"columnNames"); + self.columnNames = objcArrayFromPayload<NSString>(payload[@"columnNames"]); + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"notes"], @"notes"); + self.notes = payload[@"notes"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"timestamp"], @"timestamp"); + self.timestamp = [payload[@"timestamp"] doubleValue]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"values"], @"values"); + self.values = payload[@"values"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"payload"], @"payload"); + self.payload = payload[@"payload"]; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"error"], @"error"); + self.error = [[TestProtocolDatabaseError alloc] initWithPayload:payload[@"error"]]; + + return self; +} +- (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject +{ + if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()])) + return nil; + + return self; +} + +- (instancetype)initWithColumnNames:(NSArray/*<NSString>*/ *)columnNames notes:(NSString *)notes timestamp:(double)timestamp values:(RWIProtocolJSONObject *)values payload:(RWIProtocolJSONObject *)payload error:(TestProtocolDatabaseError *)error +{ + if (!(self = [super init])) + return nil; + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(columnNames, @"columnNames"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(notes, @"notes"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(values, @"values"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload, @"payload"); + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(error, @"error"); + + self.columnNames = columnNames; + self.notes = notes; + self.timestamp = timestamp; + self.values = values; + self.payload = payload; + self.error = error; + + return self; +} + +- (void)setColumnNames:(NSArray/*<NSString>*/ *)columnNames +{ + [super setInspectorArray:inspectorStringArray(columnNames) forKey:@"columnNames"]; +} + +- (NSArray/*<NSString>*/ *)columnNames +{ + return objcStringArray([super inspectorArrayForKey:@"columnNames"]); +} + +- (void)setNotes:(NSString *)notes +{ + [super setString:notes forKey:@"notes"]; +} + +- (NSString *)notes +{ + return [super stringForKey:@"notes"]; +} + +- (void)setTimestamp:(double)timestamp +{ + [super setDouble:timestamp forKey:@"timestamp"]; +} + +- (double)timestamp +{ + return [super doubleForKey:@"timestamp"]; +} + +- (void)setValues:(RWIProtocolJSONObject *)values +{ + [super setObject:values forKey:@"values"]; +} + +- (RWIProtocolJSONObject *)values +{ + return [[RWIProtocolJSONObject alloc] initWithInspectorObject:[[super objectForKey:@"values"] toInspectorObject].get()]; +} + +- (void)setPayload:(RWIProtocolJSONObject *)payload +{ + [super setObject:payload forKey:@"payload"]; +} + +- (RWIProtocolJSONObject *)payload +{ + return [[RWIProtocolJSONObject alloc] initWithInspectorObject:[[super objectForKey:@"payload"] toInspectorObject].get()]; +} + +- (void)setError:(TestProtocolDatabaseError *)error +{ + [super setObject:error forKey:@"error"]; +} + +- (TestProtocolDatabaseError *)error +{ + return [[TestProtocolDatabaseError alloc] initWithInspectorObject:[[super objectForKey:@"error"] toInspectorObject].get()]; +} + +@end + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result new file mode 100644 index 000000000..893692982 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result @@ -0,0 +1,1617 @@ +### 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: 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: 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: 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 "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: 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 "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, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + +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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + + +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 std::optional<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; + return std::nullopt; +} + +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 std::optional<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; + return std::nullopt; +} + +} // 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 "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]); + std::optional<TestProtocolTestUncastedAnimals> result = Inspector::fromProtocolString<TestProtocolTestUncastedAnimals>(payload); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"UncastedAnimals"); + *outValue = @(result.value()); +} + ++ (void)_parseCastedAnimals:(NSNumber **)outValue fromPayload:(id)payload +{ + THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); + std::optional<TestProtocolTestCastedAnimals> result = Inspector::fromProtocolString<TestProtocolTestCastedAnimals>(payload); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"CastedAnimals"); + *outValue = @(result.value()); +} + ++ (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 "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"); + std::optional<TestProtocolTestCastedAnimals> animals = fromProtocolString<TestProtocolTestCastedAnimals>(payload[@"animals"]); + THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(animals, @"animals"); + self.animals = animals.value(); + + THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"id"], @"id"); + 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"]).value(); +} + +- (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 diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/worker-supported-domains.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/worker-supported-domains.json-result new file mode 100644 index 000000000..bb4dc2213 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/worker-supported-domains.json-result @@ -0,0 +1,1121 @@ +### 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 worker-supported-domains.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +// DomainA. +InspectorBackend.registerCommand("DomainA.enable", [], []); +InspectorBackend.activateDomain("DomainA"); +InspectorBackend.workerSupportedDomain("DomainA"); + +// DomainB. +InspectorBackend.registerCommand("DomainB.enable", [], []); +InspectorBackend.activateDomain("DomainB"); +### 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 worker-supported-domains.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; +}; + + +class AlternateDomainABackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateDomainABackendDispatcher() { } + virtual void enable(long callId) = 0; +}; +class AlternateDomainBBackendDispatcher : public AlternateBackendDispatcher { +public: + virtual ~AlternateDomainBBackendDispatcher() { } + virtual void enable(long callId) = 0; +}; + +} // 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 worker-supported-domains.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; + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +class AlternateDomainABackendDispatcher; +class AlternateDomainBBackendDispatcher; +#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + +class DomainABackendDispatcherHandler { +public: + virtual void enable(ErrorString&) = 0; +protected: + virtual ~DomainABackendDispatcherHandler(); +}; + +class DomainBBackendDispatcherHandler { +public: + virtual void enable(ErrorString&) = 0; +protected: + virtual ~DomainBBackendDispatcherHandler(); +}; + +class DomainABackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<DomainABackendDispatcher> create(BackendDispatcher&, DomainABackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void enable(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateDomainABackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateDomainABackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + DomainABackendDispatcher(BackendDispatcher&, DomainABackendDispatcherHandler*); + DomainABackendDispatcherHandler* m_agent { nullptr }; +}; + +class DomainBBackendDispatcher final : public SupplementalBackendDispatcher { +public: + static Ref<DomainBBackendDispatcher> create(BackendDispatcher&, DomainBBackendDispatcherHandler*); + void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override; +private: + void enable(long requestId, RefPtr<InspectorObject>&& parameters); +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) +public: + void setAlternateDispatcher(AlternateDomainBBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } +private: + AlternateDomainBBackendDispatcher* m_alternateDispatcher { nullptr }; +#endif +private: + DomainBBackendDispatcher(BackendDispatcher&, DomainBBackendDispatcherHandler*); + DomainBBackendDispatcherHandler* m_agent { nullptr }; +}; + +} // 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 worker-supported-domains.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 { + +DomainABackendDispatcherHandler::~DomainABackendDispatcherHandler() { } +DomainBBackendDispatcherHandler::~DomainBBackendDispatcherHandler() { } + +Ref<DomainABackendDispatcher> DomainABackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainABackendDispatcherHandler* agent) +{ + return adoptRef(*new DomainABackendDispatcher(backendDispatcher, agent)); +} + +DomainABackendDispatcher::DomainABackendDispatcher(BackendDispatcher& backendDispatcher, DomainABackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("DomainA"), this); +} + +void DomainABackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<DomainABackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "enable") + enable(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "DomainA", '.', method, "' was not found")); +} + +void DomainABackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->enable(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->enable(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +Ref<DomainBBackendDispatcher> DomainBBackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainBBackendDispatcherHandler* agent) +{ + return adoptRef(*new DomainBBackendDispatcher(backendDispatcher, agent)); +} + +DomainBBackendDispatcher::DomainBBackendDispatcher(BackendDispatcher& backendDispatcher, DomainBBackendDispatcherHandler* agent) + : SupplementalBackendDispatcher(backendDispatcher) + , m_agent(agent) +{ + m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("DomainB"), this); +} + +void DomainBBackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) +{ + Ref<DomainBBackendDispatcher> protect(*this); + + RefPtr<InspectorObject> parameters; + message->getObject(ASCIILiteral("params"), parameters); + + if (method == "enable") + enable(requestId, WTFMove(parameters)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "DomainB", '.', method, "' was not found")); +} + +void DomainBBackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&) +{ +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + if (m_alternateDispatcher) { + m_alternateDispatcher->enable(requestId); + return; + } +#endif + + ErrorString error; + Ref<InspectorObject> result = InspectorObject::create(); + m_agent->enable(error); + + if (!error.length()) + m_backendDispatcher->sendResponse(requestId, WTFMove(result)); + else + m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error)); +} + +} // 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 worker-supported-domains.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 worker-supported-domains.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 worker-supported-domains.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 { + + + + + + + +} // 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 worker-supported-domains.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 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 worker-supported-domains.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h> +#include <wtf/RetainPtr.h> + +@protocol TestProtocolDomainADomainHandler; +@protocol TestProtocolDomainBDomainHandler; + +namespace Inspector { + + +class ObjCInspectorDomainABackendDispatcher final : public AlternateDomainABackendDispatcher { +public: + ObjCInspectorDomainABackendDispatcher(id<TestProtocolDomainADomainHandler> handler) { m_delegate = handler; } + virtual void enable(long requestId) override; +private: + RetainPtr<id<TestProtocolDomainADomainHandler>> m_delegate; +}; + +class ObjCInspectorDomainBBackendDispatcher final : public AlternateDomainBBackendDispatcher { +public: + ObjCInspectorDomainBBackendDispatcher(id<TestProtocolDomainBDomainHandler> handler) { m_delegate = handler; } + virtual void enable(long requestId) override; +private: + RetainPtr<id<TestProtocolDomainBDomainHandler>> m_delegate; +}; + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 worker-supported-domains.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 { + +void ObjCInspectorDomainABackendDispatcher::enable(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback]; +} + + +void ObjCInspectorDomainBBackendDispatcher::enable(long requestId) +{ + id errorCallback = ^(NSString *error) { + backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); + backendDispatcher()->sendPendingErrors(); + }; + + id successCallback = ^{ + backendDispatcher()->sendResponse(requestId, InspectorObject::create()); + }; + + [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback]; +} + + +} // namespace Inspector + +### End File: TestProtocolBackendDispatchers.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 worker-supported-domains.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <WebInspector/TestProtocol.h> + +__attribute__((visibility ("default"))) +@interface TestProtocolConfiguration : NSObject +@property (nonatomic, retain, setter=setDomainAHandler:) id<TestProtocolDomainADomainHandler> domainAHandler; +@property (nonatomic, retain, setter=setDomainBHandler:) id<TestProtocolDomainBDomainHandler> domainBHandler; +@end + + +### End File: TestProtocolConfiguration.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 worker-supported-domains.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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; + id<TestProtocolDomainADomainHandler> _domainAHandler; + id<TestProtocolDomainBDomainHandler> _domainBHandler; +} + +- (instancetype)initWithController:(AugmentableInspectorController*)controller +{ + self = [super init]; + if (!self) + return nil; + ASSERT(controller); + _controller = controller; + return self; +} + +- (void)dealloc +{ + [_domainAHandler release]; + [_domainBHandler release]; + [super dealloc]; +} + +- (void)setDomainAHandler:(id<TestProtocolDomainADomainHandler>)handler +{ + if (handler == _domainAHandler) + return; + + [_domainAHandler release]; + _domainAHandler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorDomainABackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<DomainABackendDispatcher, AlternateDomainABackendDispatcher>>(ASCIILiteral("DomainA"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolDomainADomainHandler>)domainAHandler +{ + return _domainAHandler; +} + +- (void)setDomainBHandler:(id<TestProtocolDomainBDomainHandler>)handler +{ + if (handler == _domainBHandler) + return; + + [_domainBHandler release]; + _domainBHandler = [handler retain]; + + auto alternateDispatcher = std::make_unique<ObjCInspectorDomainBBackendDispatcher>(handler); + auto alternateAgent = std::make_unique<AlternateDispatchableAgent<DomainBBackendDispatcher, AlternateDomainBBackendDispatcher>>(ASCIILiteral("DomainB"), *_controller, WTFMove(alternateDispatcher)); + _controller->appendExtraAgent(WTFMove(alternateAgent)); +} + +- (id<TestProtocolDomainBDomainHandler>)domainBHandler +{ + return _domainBHandler; +} + +@end + + +### End File: TestProtocolConfiguration.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 worker-supported-domains.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#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 worker-supported-domains.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import <Foundation/Foundation.h> + +#import <WebInspector/RWIProtocolJSONObject.h> + + + + +typedef NS_ENUM(NSInteger, TestProtocolPlatform) { + TestProtocolPlatformAll, + TestProtocolPlatformGeneric, + TestProtocolPlatformIOS, + TestProtocolPlatformMacOS, +}; + + + + + +@protocol TestProtocolDomainADomainHandler <NSObject> +@required +- (void)enableWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +@end + +@protocol TestProtocolDomainBDomainHandler <NSObject> +@required +- (void)enableWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)())successCallback; +@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 worker-supported-domains.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 worker-supported-domains.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> +std::optional<ObjCEnumType> fromProtocolString(const String& value); + +inline String toProtocolString(TestProtocolPlatform value) +{ + switch(value) { + case TestProtocolPlatformAll: + return ASCIILiteral("all"); + case TestProtocolPlatformGeneric: + return ASCIILiteral("generic"); + case TestProtocolPlatformIOS: + return ASCIILiteral("ios"); + case TestProtocolPlatformMacOS: + return ASCIILiteral("macos"); + } +} + +template<> +inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) +{ + if (value == "all") + return TestProtocolPlatformAll; + if (value == "generic") + return TestProtocolPlatformGeneric; + if (value == "ios") + return TestProtocolPlatformIOS; + if (value == "macos") + return TestProtocolPlatformMacOS; + return std::nullopt; +} + +} // 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 worker-supported-domains.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolTypeConversions.h" + +#import "TestProtocol.h" +#import "TestProtocolTypeParser.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> + +using namespace Inspector; + + + + + + +### 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 worker-supported-domains.json +// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py + +#import "TestProtocolInternal.h" + +#import "TestProtocolTypeConversions.h" +#import <WebInspector/RWIProtocolJSONObjectPrivate.h> +#import <JavaScriptCore/InspectorValues.h> +#import <wtf/Assertions.h> + +using namespace Inspector; + + +### End File: TestProtocolTypes.mm diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-command-with-invalid-platform.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-command-with-invalid-platform.json new file mode 100644 index 000000000..a180cae9b --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-command-with-invalid-platform.json @@ -0,0 +1,16 @@ +{ + "domain": "Overlay", + "commands": [ + { + "name": "processPoints", + "platform": "invalid", + "parameters": [ + { "name": "point1", "type": "number" }, + { "name": "point2", "type": "number" } + ], + "returns": [ + { "name": "result", "type": "string" } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-availability.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-availability.json new file mode 100644 index 000000000..36ee2c600 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-availability.json @@ -0,0 +1,9 @@ +{ + "domain": "WebOnly", + "availability": "webb", + "commands": [ + { + "name": "enable" + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-command-call-parameter-names.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-command-call-parameter-names.json new file mode 100644 index 000000000..bab76ca62 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-command-call-parameter-names.json @@ -0,0 +1,16 @@ +{ + "domain": "Overlay", + "commands": [ + { + "name": "processPoints", + "parameters": [ + { "name": "point", "type": "number" }, + { "name": "point", "type": "number" } + ], + "returns": [ + { "name": "result1", "type": "string" }, + { "name": "result2", "type": "string" } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-command-return-parameter-names.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-command-return-parameter-names.json new file mode 100644 index 000000000..c8bb15c04 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-command-return-parameter-names.json @@ -0,0 +1,16 @@ +{ + "domain": "Overlay", + "commands": [ + { + "name": "processPoints", + "parameters": [ + { "name": "point1", "type": "number" }, + { "name": "point2", "type": "number" } + ], + "returns": [ + { "name": "result", "type": "string" }, + { "name": "result", "type": "string" } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-event-parameter-names.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-event-parameter-names.json new file mode 100644 index 000000000..d3d3b3cc6 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-event-parameter-names.json @@ -0,0 +1,12 @@ +{ + "domain": "Overlay", + "events": [ + { + "name": "processedPoints", + "parameters": [ + { "name": "point", "type": "number" }, + { "name": "point", "type": "number" } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-type-declarations.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-type-declarations.json new file mode 100644 index 000000000..702fc6a32 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-type-declarations.json @@ -0,0 +1,15 @@ +{ + "domain": "Runtime", + "types": [ + { + "id": "RemoteObjectId", + "type": "string", + "description": "Unique object identifier." + }, + { + "id": "RemoteObjectId", + "type": "string", + "description": "Unique object identifier." + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-type-member-names.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-type-member-names.json new file mode 100644 index 000000000..aebacee8b --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-type-member-names.json @@ -0,0 +1,15 @@ +[ +{ + "domain": "OverlayTypes", + "types": [ + { + "id": "Point", + "type": "object", + "properties": [ + { "name": "x", "type": "integer" }, + { "name": "x", "type": "integer" } + ] + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-enum-with-no-values.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-enum-with-no-values.json new file mode 100644 index 000000000..232a7c324 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-enum-with-no-values.json @@ -0,0 +1,10 @@ +{ + "domain": "Database", + "types": [ + { + "id": "PrimaryColors", + "type": "string", + "enum": [] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-number-typed-optional-parameter-flag.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-number-typed-optional-parameter-flag.json new file mode 100644 index 000000000..7308db992 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-number-typed-optional-parameter-flag.json @@ -0,0 +1,18 @@ +{ + "domain": "Database", + "types": [ + { + "id": "DatabaseId", + "type": "string", + "description": "Unique identifier of Database object." + } + ], + "events": [ + { + "name": "didExecuteOptionalParameters", + "parameters": [ + { "name": "columnNames", "type": "string", "optional": 0 } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-number-typed-optional-type-member.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-number-typed-optional-type-member.json new file mode 100644 index 000000000..afea555ec --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-number-typed-optional-type-member.json @@ -0,0 +1,16 @@ +[ +{ + "domain": "Database", + "types": [ + { + "id": "Error", + "type": "object", + "description": "Database error.", + "properties": [ + { "name": "message", "type": "string", "description": "Error message." }, + { "name": "code", "type": "integer", "description": "Error code.", "optional": 0 } + ] + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-string-typed-optional-parameter-flag.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-string-typed-optional-parameter-flag.json new file mode 100644 index 000000000..4012c79b6 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-string-typed-optional-parameter-flag.json @@ -0,0 +1,18 @@ +{ + "domain": "Database", + "types": [ + { + "id": "DatabaseId", + "type": "string", + "description": "Unique identifier of Database object." + } + ], + "events": [ + { + "name": "didExecuteOptionalParameters", + "parameters": [ + { "name": "columnNames", "type": "string", "optional": "true" } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-string-typed-optional-type-member.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-string-typed-optional-type-member.json new file mode 100644 index 000000000..ca3ef28a8 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-string-typed-optional-type-member.json @@ -0,0 +1,16 @@ +[ +{ + "domain": "Database", + "types": [ + { + "id": "Error", + "type": "object", + "description": "Database error.", + "properties": [ + { "name": "message", "type": "string", "description": "Error message." }, + { "name": "code", "type": "integer", "description": "Error code.", "optional": "false" } + ] + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-declaration-using-type-reference.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-declaration-using-type-reference.json new file mode 100644 index 000000000..19b7590cc --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-declaration-using-type-reference.json @@ -0,0 +1,13 @@ +[ +{ + "domain": "Runtime", + "types": [ + { + "id": "RemoteObjectId", + "type": "object", + "$ref": "SomeType", + "description": "Unique object identifier." + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-reference-as-primitive-type.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-reference-as-primitive-type.json new file mode 100644 index 000000000..8c83bbfce --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-reference-as-primitive-type.json @@ -0,0 +1,18 @@ +{ + "domain": "Database", + "types": [ + { + "id": "DatabaseId", + "type": "string", + "description": "Unique identifier of Database object." + } + ], + "events": [ + { + "name": "didExecuteOptionalParameters", + "parameters": [ + { "name": "columnNames", "type": "DatabaseId" } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-with-invalid-platform.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-with-invalid-platform.json new file mode 100644 index 000000000..a9fd2e995 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-with-invalid-platform.json @@ -0,0 +1,11 @@ +{ + "domain": "Runtime", + "types": [ + { + "id": "RemoteObjectId", + "type": "string", + "platform": "invalid", + "description": "Unique object identifier." + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-with-lowercase-name.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-with-lowercase-name.json new file mode 100644 index 000000000..531901e4a --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-with-lowercase-name.json @@ -0,0 +1,10 @@ +{ + "domain": "Database", + "types": [ + { + "id": "databaseId", + "type": "integer", + "description": "Unique identifier of Database object." + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-unknown-type-reference-in-type-declaration.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-unknown-type-reference-in-type-declaration.json new file mode 100644 index 000000000..d6887a274 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-unknown-type-reference-in-type-declaration.json @@ -0,0 +1,12 @@ +[ +{ + "domain": "Runtime", + "types": [ + { + "id": "RemoteObjectId", + "type": "dragon", + "description": "Unique object identifier." + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-unknown-type-reference-in-type-member.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-unknown-type-reference-in-type-member.json new file mode 100644 index 000000000..b817db504 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-unknown-type-reference-in-type-member.json @@ -0,0 +1,15 @@ +[ +{ + "domain": "Fantasy", + "types": [ + { + "id": "DragonEgg", + "type": "object", + "description": "A dragon egg.", + "properties": [ + { "name": "color", "$ref": "Color" } + ] + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/generate-domains-with-feature-guards.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/generate-domains-with-feature-guards.json new file mode 100644 index 000000000..67cf8e582 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/generate-domains-with-feature-guards.json @@ -0,0 +1,36 @@ +[ +{ + "domain": "Network1", + "featureGuard": "PLATFORM(WEB_COMMANDS)", + "commands": [ + { + "name": "loadResource", + "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks." + } + ] +}, +{ + "domain": "Network2", + "featureGuard": "PLATFORM(WEB_TYPES)", + "types": [ + { + "id": "NetworkError", + "type": "object", + "properties": [ + { "name": "message", "type": "string", "description": "Error message." }, + { "name": "code", "type": "integer", "description": "Error code." } + ] + } + ] +}, +{ + "domain": "Network3", + "featureGuard": "PLATFORM(WEB_EVENTS)", + "events": [ + { + "name": "resourceLoaded", + "description": "A resource was loaded." + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/same-type-id-different-domain.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/same-type-id-different-domain.json new file mode 100644 index 000000000..3bf4dff5c --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/same-type-id-different-domain.json @@ -0,0 +1,22 @@ +[ +{ + "domain": "Runtime", + "types": [ + { + "id": "RemoteObjectId", + "type": "string", + "description": "Unique object identifier." + } + ] +}, +{ + "domain": "Runtime2", + "types": [ + { + "id": "RemoteObjectId", + "type": "string", + "description": "Unique object identifier." + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/shadowed-optional-type-setters.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/shadowed-optional-type-setters.json new file mode 100644 index 000000000..20a0c1552 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/shadowed-optional-type-setters.json @@ -0,0 +1,31 @@ +{ + "domain": "Runtime", + "types": [ + { + "id": "KeyPath", + "type": "object", + "description": "Key path.", + "properties": [ + { + "name": "type", + "type": "string", + "enum": ["null", "string", "array"], + "description": "Key path type." + }, + { + "name": "string", + "type": "string", + "optional": true, + "description": "String value." + }, + { + "name": "array", + "type": "array", + "optional": true, + "items": { "type": "string" }, + "description": "Array value." + } + ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-aliased-primitive-type.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-aliased-primitive-type.json new file mode 100644 index 000000000..cbc9d5394 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-aliased-primitive-type.json @@ -0,0 +1,10 @@ +{ + "domain": "Runtime", + "types": [ + { + "id": "RemoteObjectId", + "type": "integer", + "description": "Unique object identifier." + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-array-type.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-array-type.json new file mode 100644 index 000000000..cfb08bd94 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-array-type.json @@ -0,0 +1,50 @@ +[ +{ + "domain": "Debugger", + "types": [ + { + "id": "BreakpointId", + "type": "integer" + }, + { + "id": "Reason", + "type": "string", + "enum": ["Died", "Fainted", "Hungry"] + } + ] +}, +{ + "domain": "Runtime", + "types": [ + { + "id": "ObjectId", + "type": "integer" + }, + { + "id": "LuckyNumbers", + "type": "array", + "items": { "type": "integer" } + }, + { + "id": "BabyNames", + "type": "array", + "items": { "type": "string" } + }, + { + "id": "NewObjects", + "type": "array", + "items": { "$ref": "ObjectId" } + }, + { + "id": "OldObjects", + "type": "array", + "items": { "$ref": "Debugger.BreakpointId" } + }, + { + "id": "StopReasons", + "type": "array", + "items": { "$ref": "Debugger.Reason" } + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-enum-type.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-enum-type.json new file mode 100644 index 000000000..9f0aee9c9 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-enum-type.json @@ -0,0 +1,15 @@ +{ + "domain": "Runtime", + "types": [ + { + "id": "FarmAnimals", + "type": "string", + "enum": ["Pigs", "Cows", "Cats", "Hens"] + }, + { + "id": "TwoLeggedAnimals", + "type": "string", + "enum": ["Ducks", "Hens", "Crows", "Flamingos"] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-object-type.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-object-type.json new file mode 100644 index 000000000..178309197 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-object-type.json @@ -0,0 +1,83 @@ +[ +{ + "domain": "Database", + "description": "Test type builder generation of various object types.", + "types": [ + { + "id": "Error", + "type": "object", + "description": "Database error.", + "properties": [ + { "name": "message", "type": "string", "description": "Error message." }, + { "name": "code", "type": "integer", "description": "Error code." } + ] + }, + { + "id": "ErrorList", + "type": "array", + "items": { "$ref": "Error" } + }, + { + "id": "OptionalParameterBundle", + "type": "object", + "properties": [ + { "name": "columnNames", "type": "array", "optional": true, "items": { "type": "string" } }, + { "name": "notes", "type": "string", "optional": true }, + { "name": "timestamp", "type": "number", "optional": true }, + { "name": "values", "type": "object", "optional": true }, + { "name": "payload", "type": "any", "optional": true }, + { "name": "error", "$ref": "Error", "optional": true }, + { "name": "errorList", "$ref": "ErrorList", "optional": true } + ] + }, + { + "id": "ParameterBundle", + "type": "object", + "properties": [ + { "name": "columnNames", "type": "array", "items": { "type": "string" } }, + { "name": "notes", "type": "string" }, + { "name": "timestamp", "type": "number" }, + { "name": "values", "type": "object" }, + { "name": "payload", "type": "any" }, + { "name": "error", "$ref": "Error" }, + { "name": "errorList", "$ref": "ErrorList" } + ] + }, + { + "id": "ObjectWithPropertyNameConflicts", + "description": "Conflicted names may cause generated getters/setters to clash with built-in InspectorObject methods.", + "type": "object", + "properties": [ + { "name": "integer", "type": "string" }, + { "name": "array", "type": "string" }, + { "name": "string", "type": "string" }, + { "name": "value", "type": "string" }, + { "name": "object", "type": "string" } + ] + }, + { + "id": "DummyObject", + "description": "An open object that doesn't have any predefined fields.", + "type": "object" + } + ] +}, +{ + "domain": "Test", + "description": "Test the generation of special behaviors that only apply to specific classes.", + "types": [ + { + "id": "ParameterBundle", + "type": "object", + "properties": [ + { "name": "columnNames", "type": "array", "items": { "type": "string" } }, + { "name": "notes", "type": "string" }, + { "name": "timestamp", "type": "number" }, + { "name": "values", "type": "object" }, + { "name": "payload", "type": "any" }, + { "name": "error", "$ref": "Database.Error" } + ] + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/type-requiring-runtime-casts.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-requiring-runtime-casts.json new file mode 100644 index 000000000..83d94be89 --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/type-requiring-runtime-casts.json @@ -0,0 +1,51 @@ +[ +{ + "domain": "Test", + "types": [ + { + "id": "TypeNeedingCast", + "type": "object", + "description": "A dummy type that requires runtime casts, and forces non-primitive referenced types to also emit runtime cast helpers.", + "properties": [ + { "name": "string", "type": "string", "description": "String member." }, + { "name": "number", "type": "integer", "description": "Number member." }, + { "name": "animals", "$ref": "CastedAnimals", "description": "Enum member." }, + { "name": "id", "$ref": "CastedObjectId", "description": "Aliased member." }, + { "name": "tree", "$ref": "RecursiveObject1", "description": "Recursive object member." } + ] + }, + { + "id": "CastedObjectId", + "type": "integer" + }, + { + "id": "UncastedObjectId", + "type": "integer" + }, + { + "id": "UncastedAnimals", + "type": "string", + "enum": ["Pigs", "Cows", "Cats", "Hens"] + }, + { + "id": "CastedAnimals", + "type": "string", + "enum": ["Ducks", "Hens", "Crows", "Flamingos"] + }, + { + "id": "RecursiveObject1", + "type": "object", + "properties": [ + { "name": "obj", "$ref": "RecursiveObject2", "optional": true } + ] + }, + { + "id": "RecursiveObject2", + "type": "object", + "properties": [ + { "name": "obj", "$ref": "RecursiveObject1", "optional": true } + ] + } + ] +} +] diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/worker-supported-domains.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/worker-supported-domains.json new file mode 100644 index 000000000..5e5889afc --- /dev/null +++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/worker-supported-domains.json @@ -0,0 +1,11 @@ +[ +{ + "domain": "DomainA", + "workerSupported": true, + "commands": [{"name": "enable"}] +}, +{ + "domain": "DomainB", + "commands": [{"name": "enable"}] +} +] |