### Begin File: InspectorBackendCommands.js.in /* * Copyright (C) 2013 Google Inc. All rights reserved. * Copyright (C) 2013-2016 Apple Inc. All rights reserved. * Copyright (C) 2014 University of Washington. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF 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 #if DOMAIN-MAC // Network InspectorBackend.registerDomain("Network", null); #if COMMAND-MAC InspectorBackend.registerCommand("Network.loadResource", null, [], []); #endif // COMMAND-MAC #if EVENT-MAC InspectorBackend.registerEvent("Network.resourceLoaded", null, []); #endif // EVENT-MAC InspectorBackend.registerNetworkDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "Network"); InspectorBackend.activateDomain("Network", null); #endif // DOMAIN-MAC ### End File: InspectorBackendCommands.js.in ### 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 "TestProtocolObjects.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; }; #if DOMAIN-MAC class AlternateNetworkBackendDispatcher : public AlternateBackendDispatcher { public: virtual ~AlternateNetworkBackendDispatcher() { } #if COMMAND-MAC virtual void loadResource(long protocol_requestId) = 0; #endif // COMMAND-MAC }; #endif // DOMAIN-MAC } // 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 #include #include #include namespace Inspector { #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) #if DOMAIN-MAC class AlternateNetworkBackendDispatcher; #endif // DOMAIN-MAC #endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) #if DOMAIN-MAC class NetworkBackendDispatcherHandler { public: #if COMMAND-MAC virtual Protocol::ErrorStringOr loadResource() = 0; #endif // COMMAND-MAC protected: virtual ~NetworkBackendDispatcherHandler(); }; #endif // DOMAIN-MAC #if DOMAIN-MAC class NetworkBackendDispatcher final : public SupplementalBackendDispatcher { public: static Ref create(BackendDispatcher&, NetworkBackendDispatcherHandler*); void dispatch(long protocol_requestId, const String& protocol_method, Ref&& protocol_message) final; private: #if COMMAND-MAC void loadResource(long protocol_requestId, RefPtr&& protocol_parameters); #endif // COMMAND-MAC #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) public: void setAlternateDispatcher(AlternateNetworkBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; } private: AlternateNetworkBackendDispatcher* m_alternateDispatcher { nullptr }; #endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) private: NetworkBackendDispatcher(BackendDispatcher&, NetworkBackendDispatcherHandler*); NetworkBackendDispatcherHandler* m_agent { nullptr }; }; #endif // DOMAIN-MAC } // 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 #include #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) #include "TestAlternateBackendDispatchers.h" #endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) namespace Inspector { #if DOMAIN-MAC NetworkBackendDispatcherHandler::~NetworkBackendDispatcherHandler() { } #endif // DOMAIN-MAC #if DOMAIN-MAC Ref 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("Network"_s, this); } void NetworkBackendDispatcher::dispatch(long protocol_requestId, const String& protocol_method, Ref&& protocol_message) { Ref protect(*this); auto protocol_parameters = protocol_message->getObject("params"_s); #if COMMAND-MAC if (protocol_method == "loadResource"_s) { loadResource(protocol_requestId, WTFMove(protocol_parameters)); return; } #endif // COMMAND-MAC m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString("'Network."_s, protocol_method, "' was not found"_s)); } #if COMMAND-MAC void NetworkBackendDispatcher::loadResource(long protocol_requestId, RefPtr&&) { #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) if (m_alternateDispatcher) { m_alternateDispatcher->loadResource(protocol_requestId); return; } #endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) auto result = m_agent->loadResource(); if (!result) { ASSERT(!result.error().isEmpty()); m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, result.error()); return; } auto protocol_jsonMessage = JSON::Object::create(); m_backendDispatcher->sendResponse(protocol_requestId, WTFMove(protocol_jsonMessage), false); } #endif // COMMAND-MAC #endif // DOMAIN-MAC } // 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 #include namespace Inspector { class FrontendRouter; #if DOMAIN-MAC class NetworkFrontendDispatcher { WTF_MAKE_FAST_ALLOCATED; public: NetworkFrontendDispatcher(FrontendRouter& frontendRouter) : m_frontendRouter(frontendRouter) { } #if EVENT-MAC void resourceLoaded(); #endif // EVENT-MAC private: FrontendRouter& m_frontendRouter; }; #endif // DOMAIN-MAC } // 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 namespace Inspector { #if DOMAIN-MAC #if EVENT-MAC void NetworkFrontendDispatcher::resourceLoaded() { auto protocol_jsonMessage = JSON::Object::create(); protocol_jsonMessage->setString("method"_s, "Network.resourceLoaded"_s); m_frontendRouter.sendEvent(protocol_jsonMessage->toJSONString()); } #endif // EVENT-MAC #endif // DOMAIN-MAC } // 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 #include #include namespace Inspector { namespace Protocol { // Forward declarations. #if DOMAIN-MAC namespace Network { #if TYPE-MAC class NetworkError; #endif // TYPE-MAC } // Network #endif // DOMAIN-MAC // End of forward declarations. #if DOMAIN-MAC namespace Network { #if TYPE-MAC class NetworkError final : public JSON::ObjectBase { public: enum { NoFieldsSet = 0, MessageSet = 1 << 0, CodeSet = 1 << 1, AllFieldsSet = (MessageSet | CodeSet) }; template class Builder { private: RefPtr m_result; template Builder& castState() { return *reinterpret_cast*>(this); } Builder(Ref&& object) : m_result(WTFMove(object)) { static_assert(STATE == NoFieldsSet, "builder created in non init state"); } friend class NetworkError; public: Builder& setMessage(const String& in_message) { static_assert(!(STATE & MessageSet), "property message already set"); m_result->setString("message"_s, in_message); return castState(); } Builder& setCode(int in_code) { static_assert(!(STATE & CodeSet), "property code already set"); m_result->setInteger("code"_s, in_code); return castState(); } Ref release() { static_assert(STATE == AllFieldsSet, "result is not ready"); static_assert(sizeof(NetworkError) == sizeof(JSON::Object), "cannot cast"); Ref jsonResult = m_result.releaseNonNull(); auto result = WTFMove(*reinterpret_cast*>(&jsonResult)); return result; } }; /* * Synthetic constructor: * Ref result = NetworkError::create() * .setMessage(...) * .setCode(...) * .release(); */ static Builder create() { return Builder(JSON::Object::create()); } }; #endif // TYPE-MAC } // Network #endif // DOMAIN-MAC } // 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 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 #include #if DOMAIN-MAC @protocol TestProtocolNetworkDomainHandler; #endif // DOMAIN-MAC namespace Inspector { #if DOMAIN-MAC class ObjCInspectorNetworkBackendDispatcher final : public AlternateNetworkBackendDispatcher { WTF_MAKE_FAST_ALLOCATED; public: ObjCInspectorNetworkBackendDispatcher(id handler) { m_delegate = handler; } #if COMMAND-MAC void loadResource(long protocol_requestId) final; #endif // COMMAND-MAC private: RetainPtr> m_delegate; }; #endif // DOMAIN-MAC } // 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 namespace Inspector { #if DOMAIN-MAC #if COMMAND-MAC void ObjCInspectorNetworkBackendDispatcher::loadResource(long protocol_requestId) { if (![m_delegate respondsToSelector:@selector(loadResourceWithErrorCallback:successCallback:)]) { backendDispatcher()->reportProtocolError(protocol_requestId, BackendDispatcher::MethodNotFound, "'Network.loadResource' was not found"_s); backendDispatcher()->sendPendingErrors(); return; } id errorCallback = ^(NSString *error) { backendDispatcher()->reportProtocolError(protocol_requestId, BackendDispatcher::ServerError, error); backendDispatcher()->sendPendingErrors(); }; id successCallback = ^{ auto protocol_jsonMessage = JSON::Object::create(); backendDispatcher()->sendResponse(protocol_requestId, WTFMove(protocol_jsonMessage), false); }; [m_delegate loadResourceWithErrorCallback:errorCallback successCallback:successCallback]; } #endif // COMMAND-MAC #endif // DOMAIN-MAC } // 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 __attribute__((visibility ("default"))) @interface TestProtocolConfiguration : NSObject #if DOMAIN-MAC @property (nonatomic, retain, setter=setNetworkHandler:) id networkHandler; @property (nonatomic, readonly) TestProtocolNetworkDomainEventDispatcher *networkEventDispatcher; #endif // DOMAIN-MAC @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 #import #import #import using namespace Inspector; @implementation TestProtocolConfiguration { AugmentableInspectorController* _controller; #if DOMAIN-MAC RetainPtr> _networkHandler; RetainPtr _networkEventDispatcher; #endif // DOMAIN-MAC } - (instancetype)initWithController:(AugmentableInspectorController*)controller { self = [super init]; if (!self) return nil; ASSERT(controller); _controller = controller; return self; } #if DOMAIN-MAC - (void)setNetworkHandler:(id)handler { if (handler == _networkHandler) return; _networkHandler = handler; auto alternateDispatcher = makeUnique(handler); auto alternateAgent = makeUnique>("Network"_s, *_controller, WTFMove(alternateDispatcher)); _controller->registerAlternateAgent(WTFMove(alternateAgent)); } - (id)networkHandler { return _networkHandler.get(); } - (TestProtocolNetworkDomainEventDispatcher *)networkEventDispatcher { if (!_networkEventDispatcher) _networkEventDispatcher = adoptNS([[TestProtocolNetworkDomainEventDispatcher alloc] initWithController:_controller]); return _networkEventDispatcher.get(); } #endif // DOMAIN-MAC @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 using namespace Inspector; #if DOMAIN-MAC @implementation TestProtocolNetworkDomainEventDispatcher { AugmentableInspectorController* _controller; } - (instancetype)initWithController:(AugmentableInspectorController*)controller { self = [super init]; if (!self) return nil; ASSERT(controller); _controller = controller; return self; } #if EVENT-MAC - (void)resourceLoaded { const FrontendRouter& router = _controller->frontendRouter(); auto protocol_jsonMessage = JSON::Object::create(); protocol_jsonMessage->setString("method"_s, "Network.resourceLoaded"_s); router.sendEvent(protocol_jsonMessage->toJSONString()); } #endif // EVENT-MAC @end #endif // DOMAIN-MAC ### 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 #import #if DOMAIN-MAC #if TYPE-MAC @class TestProtocolNetworkError; #endif // TYPE-MAC #endif // DOMAIN-MAC #if DOMAIN-MAC #if TYPE-MAC __attribute__((visibility ("default"))) @interface TestProtocolNetworkError : RWIProtocolJSONObject - (instancetype)initWithPayload:(NSDictionary *)payload; - (instancetype)initWithProtocolObject:(RWIProtocolJSONObject *)jsonObject; - (instancetype)initWithMessage:(NSString *)message code:(int)code; /* required */ @property (nonatomic, copy) NSString *message; /* required */ @property (nonatomic, assign) int code; @end #endif // TYPE-MAC #endif // DOMAIN-MAC #if DOMAIN-MAC @protocol TestProtocolNetworkDomainHandler @optional #if COMMAND-MAC - (void)loadResourceWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(void))successCallback; #endif // COMMAND-MAC @end #endif // DOMAIN-MAC #if DOMAIN-MAC __attribute__((visibility ("default"))) @interface TestProtocolNetworkDomainEventDispatcher : NSObject #if EVENT-MAC - (void)resourceLoaded; #endif // EVENT-MAC @end #endif // DOMAIN-MAC #import ### 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 #import #if DOMAIN-MAC @interface TestProtocolNetworkDomainEventDispatcher (Private) - (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller; @end #endif // DOMAIN-MAC ### 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 #import namespace Inspector { template std::optional fromProtocolString(const String& value); } // 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 using namespace Inspector; #if DOMAIN-MAC @interface TestProtocolTypeConversions (NetworkDomain) #if TYPE-MAC + (void)_parseNetworkError:(TestProtocolNetworkError **)outValue fromPayload:(id)payload; #endif // TYPE-MAC @end #endif // DOMAIN-MAC #if DOMAIN-MAC @implementation TestProtocolTypeConversions (NetworkDomain) #if TYPE-MAC + (void)_parseNetworkError:(TestProtocolNetworkError **)outValue fromPayload:(id)payload { THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]); *outValue = [[TestProtocolNetworkError alloc] initWithPayload:payload]; } #endif // TYPE-MAC @end #endif // DOMAIN-MAC ### 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 #import #import using namespace Inspector; #if DOMAIN-MAC #if TYPE-MAC @implementation TestProtocolNetworkError - (instancetype)initWithPayload:(nonnull NSDictionary *)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)initWithProtocolObject:(RWIProtocolJSONObject *)object { if (!(self = [super initWithJSONObject:[object toJSONObject].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 #endif // TYPE-MAC #endif // DOMAIN-MAC ### End File: TestProtocolTypes.mm