### 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 #include namespace Inspector { class AlternateBackendDispatcher { public: void setBackendDispatcher(RefPtr&& dispatcher) { m_backendDispatcher = WTFMove(dispatcher); } BackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); } private: RefPtr 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 #include 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 create(BackendDispatcher&, CommandDomainBackendDispatcherHandler*); void dispatch(long requestId, const String& method, Ref&& message) override; private: void commandWithEnumReturnValue(long requestId, RefPtr&& 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 #include #include #include #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) #include "TestAlternateBackendDispatchers.h" #endif namespace Inspector { CommandDomainBackendDispatcherHandler::~CommandDomainBackendDispatcherHandler() { } Ref 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&& message) { Ref protect(*this); RefPtr 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&&) { #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) if (m_alternateDispatcher) { m_alternateDispatcher->commandWithEnumReturnValue(requestId); return; } #endif ErrorString error; Ref 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 #include 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 namespace Inspector { void EventDomainFrontendDispatcher::eventWithEnumParameter(Parameter parameter) { Ref jsonMessage = InspectorObject::create(); jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("EventDomain.eventWithEnumParameter")); Ref 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 #include namespace Inspector { namespace Protocol { // Forward declarations. namespace TypeDomain { enum class TypeDomainEnum; } // TypeDomain // End of forward declarations. namespace TestHelpers { String getEnumConstantValue(int code); template String getEnumConstantValue(T enumValue) { return getEnumConstantValue(static_cast(enumValue)); } } // namespace TestHelpers namespace TypeDomain { /* */ enum class TypeDomainEnum { Shared = 0, Red = 1, Green = 2, Blue = 3, }; // enum class TypeDomainEnum } // TypeDomain namespace TestHelpers { template std::optional parseEnumValueFromString(const String&); // Enums in the 'TypeDomain' Domain template<> std::optional parseEnumValueFromString(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 #include 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 parseEnumValueFromString(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 #include @protocol TestProtocolCommandDomainDomainHandler; namespace Inspector { class ObjCInspectorCommandDomainBackendDispatcher final : public AlternateCommandDomainBackendDispatcher { public: ObjCInspectorCommandDomainBackendDispatcher(id handler) { m_delegate = handler; } virtual void commandWithEnumReturnValue(long requestId) override; private: RetainPtr> m_delegate; }; } // namespace Inspector ### End File: TestProtocolBackendDispatchers.h ### Begin File: TestProtocolConfiguration.mm /* * Copyright (C) 2013 Google Inc. All rights reserved. * Copyright (C) 2013-2016 Apple Inc. All rights reserved. * Copyright (C) 2014 University of Washington. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ // DO NOT EDIT THIS FILE. It is automatically generated from enum-values.json // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py #import "config.h" #import "TestProtocolConfiguration.h" #import "TestProtocolInternal.h" #import "TestProtocolBackendDispatchers.h" #import #import #import #import using namespace Inspector; @implementation TestProtocolConfiguration { AugmentableInspectorController* _controller; id _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)handler { if (handler == _commandDomainHandler) return; [_commandDomainHandler release]; _commandDomainHandler = [handler retain]; auto alternateDispatcher = std::make_unique(handler); auto alternateAgent = std::make_unique>(ASCIILiteral("CommandDomain"), *_controller, WTFMove(alternateDispatcher)); _controller->appendExtraAgent(WTFMove(alternateAgent)); } - (id)commandDomainHandler { return _commandDomainHandler; } - (TestProtocolEventDomainDomainEventDispatcher *)eventDomainEventDispatcher { if (!_eventDomainEventDispatcher) _eventDomainEventDispatcher = [[TestProtocolEventDomainDomainEventDispatcher alloc] initWithController:_controller]; return _eventDomainEventDispatcher; } @end ### End File: TestProtocolConfiguration.mm ### Begin File: TestProtocolConfiguration.h /* * Copyright (C) 2013 Google Inc. All rights reserved. * Copyright (C) 2013-2016 Apple Inc. All rights reserved. * Copyright (C) 2014 University of Washington. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ // DO NOT EDIT THIS FILE. It is automatically generated from enum-values.json // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py #import __attribute__((visibility ("default"))) @interface TestProtocolConfiguration : NSObject @property (nonatomic, retain, setter=setCommandDomainHandler:) id commandDomainHandler; @property (nonatomic, readonly) TestProtocolEventDomainDomainEventDispatcher *eventDomainEventDispatcher; @end ### End File: TestProtocolConfiguration.h ### Begin File: TestProtocolBackendDispatchers.mm /* * Copyright (C) 2013 Google Inc. All rights reserved. * Copyright (C) 2013-2016 Apple Inc. All rights reserved. * Copyright (C) 2014 University of Washington. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ // DO NOT EDIT THIS FILE. It is automatically generated from 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 namespace Inspector { void ObjCInspectorCommandDomainBackendDispatcher::commandWithEnumReturnValue(long requestId) { id errorCallback = ^(NSString *error) { backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error); backendDispatcher()->sendPendingErrors(); }; id successCallback = ^(TestProtocolCommandDomainCommandWithEnumReturnValueReturnValue returnValue) { Ref 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: 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 "config.h" #import "TestProtocolInternal.h" #import "TestProtocolTypeConversions.h" #import 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 jsonMessage = InspectorObject::create(); jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("EventDomain.eventWithEnumParameter")); Ref 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 #import typedef NS_ENUM(NSInteger, TestProtocolTypeDomainEnum) { TestProtocolTypeDomainEnumShared, TestProtocolTypeDomainEnumRed, TestProtocolTypeDomainEnumGreen, TestProtocolTypeDomainEnumBlue, }; typedef NS_ENUM(NSInteger, TestProtocolCommandDomainCommandWithEnumReturnValueReturnValue) { TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueShared, TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueCyan, TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueMagenta, TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueYellow, }; typedef NS_ENUM(NSInteger, TestProtocolEventDomainEventWithEnumParameterParameter) { TestProtocolEventDomainEventWithEnumParameterParameterShared, TestProtocolEventDomainEventWithEnumParameterParameterBlack, TestProtocolEventDomainEventWithEnumParameterParameterWhite, }; @protocol TestProtocolCommandDomainDomainHandler @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 #import @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 namespace Inspector { template ObjCEnumType fromProtocolString(const String& value); 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 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; ASSERT_NOT_REACHED(); return TestProtocolTypeDomainEnumShared; } inline String toProtocolString(TestProtocolCommandDomainCommandWithEnumReturnValueReturnValue value) { switch(value) { case TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueShared: return ASCIILiteral("shared"); case TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueCyan: return ASCIILiteral("cyan"); case TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueMagenta: return ASCIILiteral("magenta"); case TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueYellow: return ASCIILiteral("yellow"); } } template<> inline TestProtocolCommandDomainCommandWithEnumReturnValueReturnValue fromProtocolString(const String& value) { if (value == "shared") return TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueShared; if (value == "cyan") return TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueCyan; if (value == "magenta") return TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueMagenta; if (value == "yellow") return TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueYellow; ASSERT_NOT_REACHED(); return TestProtocolCommandDomainCommandWithEnumReturnValueReturnValueShared; } inline String toProtocolString(TestProtocolEventDomainEventWithEnumParameterParameter value) { switch(value) { case TestProtocolEventDomainEventWithEnumParameterParameterShared: return ASCIILiteral("shared"); case TestProtocolEventDomainEventWithEnumParameterParameterBlack: return ASCIILiteral("black"); case TestProtocolEventDomainEventWithEnumParameterParameterWhite: return ASCIILiteral("white"); } } template<> inline TestProtocolEventDomainEventWithEnumParameterParameter fromProtocolString(const String& value) { if (value == "shared") return TestProtocolEventDomainEventWithEnumParameterParameterShared; if (value == "black") return TestProtocolEventDomainEventWithEnumParameterParameterBlack; if (value == "white") return TestProtocolEventDomainEventWithEnumParameterParameterWhite; ASSERT_NOT_REACHED(); return TestProtocolEventDomainEventWithEnumParameterParameterShared; } } // 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 "config.h" #import "TestProtocolTypeConversions.h" #import "TestProtocol.h" #import "TestProtocolTypeParser.h" #import using namespace Inspector; @interface TestProtocolTypeConversions (TypeDomainDomain) + (void)_parseTypeDomainEnum:(NSNumber **)outValue fromPayload:(id)payload; @end @interface TestProtocolTypeConversions (CommandDomainDomain) @end @interface TestProtocolTypeConversions (EventDomainDomain) @end @implementation TestProtocolTypeConversions (TypeDomainDomain) + (void)_parseTypeDomainEnum:(NSNumber **)outValue fromPayload:(id)payload { THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); *outValue = @(Inspector::fromProtocolString(payload)); } @end @implementation TestProtocolTypeConversions (CommandDomainDomain) @end @implementation TestProtocolTypeConversions (EventDomainDomain) @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 "config.h" #import "TestProtocolInternal.h" #import "TestProtocolTypeConversions.h" #import #import #import using namespace Inspector; ### End File: TestProtocolTypes.mm