1 ### Begin File: InspectorBackendCommands.js
3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
5 * Copyright (C) 2014 University of Washington. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26 * THE POSSIBILITY OF SUCH DAMAGE.
29 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
30 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
33 InspectorBackend.registerEnum("Database.PrimaryColors", {Red: "red", Green: "green", Blue: "blue"});
34 InspectorBackend.registerCommand("Database.executeAllOptionalParameters", [{"name": "columnNames", "type": "object", "optional": true}, {"name": "notes", "type": "string", "optional": true}, {"name": "timestamp", "type": "number", "optional": true}, {"name": "values", "type": "object", "optional": true}, {"name": "payload", "type": "object", "optional": true}, {"name": "databaseId", "type": "number", "optional": true}, {"name": "sqlError", "type": "object", "optional": true}, {"name": "screenColor", "type": "string", "optional": true}, {"name": "alternateColors", "type": "object", "optional": true}, {"name": "printColor", "type": "string", "optional": true}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
35 InspectorBackend.registerCommand("Database.executeNoOptionalParameters", [{"name": "columnNames", "type": "object", "optional": false}, {"name": "notes", "type": "string", "optional": false}, {"name": "timestamp", "type": "number", "optional": false}, {"name": "values", "type": "object", "optional": false}, {"name": "payload", "type": "object", "optional": false}, {"name": "databaseId", "type": "number", "optional": false}, {"name": "sqlError", "type": "object", "optional": false}, {"name": "screenColor", "type": "string", "optional": false}, {"name": "alternateColors", "type": "object", "optional": false}, {"name": "printColor", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
36 InspectorBackend.activateDomain("Database");
37 ### End File: InspectorBackendCommands.js
39 ### Begin File: TestAlternateBackendDispatchers.h
41 * Copyright (C) 2013 Google Inc. All rights reserved.
42 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
43 * Copyright (C) 2014 University of Washington. All rights reserved.
45 * Redistribution and use in source and binary forms, with or without
46 * modification, are permitted provided that the following conditions
48 * 1. Redistributions of source code must retain the above copyright
49 * notice, this list of conditions and the following disclaimer.
50 * 2. Redistributions in binary form must reproduce the above copyright
51 * notice, this list of conditions and the following disclaimer in the
52 * documentation and/or other materials provided with the distribution.
54 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
55 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
56 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
57 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
58 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
59 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
60 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
61 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
62 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
63 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
64 * THE POSSIBILITY OF SUCH DAMAGE.
67 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
68 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
72 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
74 #include "TestProtocolTypes.h"
75 #include <inspector/InspectorFrontendRouter.h>
76 #include <JavaScriptCore/InspectorBackendDispatcher.h>
80 class AlternateBackendDispatcher {
82 void setBackendDispatcher(RefPtr<BackendDispatcher>&& dispatcher) { m_backendDispatcher = WTFMove(dispatcher); }
83 BackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
85 RefPtr<BackendDispatcher> m_backendDispatcher;
89 class AlternateDatabaseBackendDispatcher : public AlternateBackendDispatcher {
91 virtual ~AlternateDatabaseBackendDispatcher() { }
92 virtual void executeAllOptionalParameters(long callId, const Inspector::InspectorArray* in_columnNames, const String* const in_notes, const double* const in_timestamp, const Inspector::InspectorObject* in_values, const Inspector::InspectorValue* const in_payload, const int* const in_databaseId, const Inspector::InspectorObject* in_sqlError, const String* const in_screenColor, const Inspector::InspectorArray* in_alternateColors, const String* const in_printColor) = 0;
93 virtual void executeNoOptionalParameters(long callId, const Inspector::InspectorArray& in_columnNames, const String& in_notes, double in_timestamp, const Inspector::InspectorObject& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const Inspector::InspectorObject& in_sqlError, const String& in_screenColor, const Inspector::InspectorArray& in_alternateColors, const String& in_printColor) = 0;
96 } // namespace Inspector
98 #endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
99 ### End File: TestAlternateBackendDispatchers.h
101 ### Begin File: TestBackendDispatchers.h
103 * Copyright (C) 2013 Google Inc. All rights reserved.
104 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
105 * Copyright (C) 2014 University of Washington. All rights reserved.
107 * Redistribution and use in source and binary forms, with or without
108 * modification, are permitted provided that the following conditions
110 * 1. Redistributions of source code must retain the above copyright
111 * notice, this list of conditions and the following disclaimer.
112 * 2. Redistributions in binary form must reproduce the above copyright
113 * notice, this list of conditions and the following disclaimer in the
114 * documentation and/or other materials provided with the distribution.
116 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
117 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
118 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
119 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
120 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
121 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
122 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
123 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
124 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
125 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
126 * THE POSSIBILITY OF SUCH DAMAGE.
129 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
130 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
134 #include "TestProtocolObjects.h"
135 #include <inspector/InspectorBackendDispatcher.h>
136 #include <wtf/text/WTFString.h>
138 namespace Inspector {
140 typedef String ErrorString;
142 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
143 class AlternateDatabaseBackendDispatcher;
144 #endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
146 class DatabaseBackendDispatcherHandler {
148 // Named after parameter 'printColor' while generating command/event executeAllOptionalParameters.
149 enum class PrintColor {
154 }; // enum class PrintColor
155 virtual void executeAllOptionalParameters(ErrorString&, const Inspector::InspectorArray* opt_in_columnNames, const String* const opt_in_notes, const double* const opt_in_timestamp, const Inspector::InspectorObject* opt_in_values, const Inspector::InspectorValue* const opt_in_payload, const int* const opt_in_databaseId, const Inspector::InspectorObject* opt_in_sqlError, const String* const opt_in_screenColor, const Inspector::InspectorArray* opt_in_alternateColors, const String* const opt_in_printColor, RefPtr<Inspector::Protocol::Array<String>>& opt_out_columnNames, Inspector::Protocol::OptOutput<String>* opt_out_notes, Inspector::Protocol::OptOutput<double>* opt_out_timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* opt_out_values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* opt_out_payload, Inspector::Protocol::OptOutput<int>* opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& opt_out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0;
156 virtual void executeNoOptionalParameters(ErrorString&, const Inspector::InspectorArray& in_columnNames, const String& in_notes, double in_timestamp, const Inspector::InspectorObject& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const Inspector::InspectorObject& in_sqlError, const String& in_screenColor, const Inspector::InspectorArray& in_alternateColors, const String& in_printColor, RefPtr<Inspector::Protocol::Array<String>>& out_columnNames, String* out_notes, double* out_timestamp, Inspector::InspectorObject* out_values, Inspector::InspectorValue* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, Inspector::Protocol::Database::PrimaryColors* out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0;
158 virtual ~DatabaseBackendDispatcherHandler();
161 class DatabaseBackendDispatcher final : public SupplementalBackendDispatcher {
163 static Ref<DatabaseBackendDispatcher> create(BackendDispatcher&, DatabaseBackendDispatcherHandler*);
164 void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override;
166 void executeAllOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters);
167 void executeNoOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters);
168 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
170 void setAlternateDispatcher(AlternateDatabaseBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
172 AlternateDatabaseBackendDispatcher* m_alternateDispatcher { nullptr };
175 DatabaseBackendDispatcher(BackendDispatcher&, DatabaseBackendDispatcherHandler*);
176 DatabaseBackendDispatcherHandler* m_agent { nullptr };
179 } // namespace Inspector
180 ### End File: TestBackendDispatchers.h
182 ### Begin File: TestBackendDispatchers.cpp
184 * Copyright (C) 2013 Google Inc. All rights reserved.
185 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
186 * Copyright (C) 2014 University of Washington. All rights reserved.
188 * Redistribution and use in source and binary forms, with or without
189 * modification, are permitted provided that the following conditions
191 * 1. Redistributions of source code must retain the above copyright
192 * notice, this list of conditions and the following disclaimer.
193 * 2. Redistributions in binary form must reproduce the above copyright
194 * notice, this list of conditions and the following disclaimer in the
195 * documentation and/or other materials provided with the distribution.
197 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
198 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
199 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
200 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
201 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
202 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
203 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
204 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
205 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
206 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
207 * THE POSSIBILITY OF SUCH DAMAGE.
210 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
211 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
214 #include "TestBackendDispatchers.h"
216 #include <inspector/InspectorFrontendRouter.h>
217 #include <inspector/InspectorValues.h>
218 #include <wtf/NeverDestroyed.h>
219 #include <wtf/text/CString.h>
221 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
222 #include "TestAlternateBackendDispatchers.h"
225 namespace Inspector {
227 DatabaseBackendDispatcherHandler::~DatabaseBackendDispatcherHandler() { }
229 Ref<DatabaseBackendDispatcher> DatabaseBackendDispatcher::create(BackendDispatcher& backendDispatcher, DatabaseBackendDispatcherHandler* agent)
231 return adoptRef(*new DatabaseBackendDispatcher(backendDispatcher, agent));
234 DatabaseBackendDispatcher::DatabaseBackendDispatcher(BackendDispatcher& backendDispatcher, DatabaseBackendDispatcherHandler* agent)
235 : SupplementalBackendDispatcher(backendDispatcher)
238 m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Database"), this);
241 void DatabaseBackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message)
243 Ref<DatabaseBackendDispatcher> protect(*this);
245 RefPtr<InspectorObject> parameters;
246 message->getObject(ASCIILiteral("params"), parameters);
248 if (method == "executeAllOptionalParameters")
249 executeAllOptionalParameters(requestId, WTFMove(parameters));
250 else if (method == "executeNoOptionalParameters")
251 executeNoOptionalParameters(requestId, WTFMove(parameters));
253 m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Database", '.', method, "' was not found"));
256 void DatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters)
258 bool opt_in_columnNames_valueFound = false;
259 RefPtr<Inspector::InspectorArray> opt_in_columnNames = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("columnNames"), &opt_in_columnNames_valueFound);
260 bool opt_in_notes_valueFound = false;
261 String opt_in_notes = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("notes"), &opt_in_notes_valueFound);
262 bool opt_in_timestamp_valueFound = false;
263 Inspector::Protocol::OptOutput<double> opt_in_timestamp = m_backendDispatcher->getDouble(parameters.get(), ASCIILiteral("timestamp"), &opt_in_timestamp_valueFound);
264 bool opt_in_values_valueFound = false;
265 RefPtr<Inspector::InspectorObject> opt_in_values = m_backendDispatcher->getObject(parameters.get(), ASCIILiteral("values"), &opt_in_values_valueFound);
266 bool opt_in_payload_valueFound = false;
267 RefPtr<Inspector::InspectorValue> opt_in_payload = m_backendDispatcher->getValue(parameters.get(), ASCIILiteral("payload"), &opt_in_payload_valueFound);
268 bool opt_in_databaseId_valueFound = false;
269 int opt_in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), &opt_in_databaseId_valueFound);
270 bool opt_in_sqlError_valueFound = false;
271 RefPtr<Inspector::InspectorObject> opt_in_sqlError = m_backendDispatcher->getObject(parameters.get(), ASCIILiteral("sqlError"), &opt_in_sqlError_valueFound);
272 bool opt_in_screenColor_valueFound = false;
273 String opt_in_screenColor = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("screenColor"), &opt_in_screenColor_valueFound);
274 bool opt_in_alternateColors_valueFound = false;
275 RefPtr<Inspector::InspectorArray> opt_in_alternateColors = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("alternateColors"), &opt_in_alternateColors_valueFound);
276 bool opt_in_printColor_valueFound = false;
277 String opt_in_printColor = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("printColor"), &opt_in_printColor_valueFound);
278 if (m_backendDispatcher->hasProtocolErrors()) {
279 m_backendDispatcher->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Some arguments of method '%s' can't be processed", "Database.executeAllOptionalParameters"));
283 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
284 if (m_alternateDispatcher) {
285 m_alternateDispatcher->executeAllOptionalParameters(requestId, opt_in_columnNames_valueFound ? opt_in_columnNames.get() : nullptr, opt_in_notes_valueFound ? &opt_in_notes : nullptr, opt_in_timestamp_valueFound ? &opt_in_timestamp : nullptr, opt_in_values_valueFound ? opt_in_values.get() : nullptr, opt_in_payload_valueFound ? opt_in_payload.get() : nullptr, opt_in_databaseId_valueFound ? &opt_in_databaseId : nullptr, opt_in_sqlError_valueFound ? opt_in_sqlError.get() : nullptr, opt_in_screenColor_valueFound ? &opt_in_screenColor : nullptr, opt_in_alternateColors_valueFound ? opt_in_alternateColors.get() : nullptr, opt_in_printColor_valueFound ? &opt_in_printColor : nullptr);
291 Ref<InspectorObject> result = InspectorObject::create();
292 RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
293 Inspector::Protocol::OptOutput<String> out_notes;
294 Inspector::Protocol::OptOutput<double> out_timestamp;
295 Inspector::Protocol::OptOutput<Inspector::InspectorObject> out_values;
296 Inspector::Protocol::OptOutput<Inspector::InspectorValue> out_payload;
297 Inspector::Protocol::OptOutput<Inspector::Protocol::Database::DatabaseId> out_databaseId;
298 RefPtr<Inspector::Protocol::Database::Error> out_sqlError;
299 Inspector::Protocol::Database::PrimaryColors out_screenColor;
300 RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors;
301 DatabaseBackendDispatcherHandler::PrintColor out_printColor;
302 m_agent->executeAllOptionalParameters(error, opt_in_columnNames_valueFound ? opt_in_columnNames.get() : nullptr, opt_in_notes_valueFound ? &opt_in_notes : nullptr, opt_in_timestamp_valueFound ? &opt_in_timestamp : nullptr, opt_in_values_valueFound ? opt_in_values.get() : nullptr, opt_in_payload_valueFound ? opt_in_payload.get() : nullptr, opt_in_databaseId_valueFound ? &opt_in_databaseId : nullptr, opt_in_sqlError_valueFound ? opt_in_sqlError.get() : nullptr, opt_in_screenColor_valueFound ? &opt_in_screenColor : nullptr, opt_in_alternateColors_valueFound ? opt_in_alternateColors.get() : nullptr, opt_in_printColor_valueFound ? &opt_in_printColor : nullptr, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, out_alternateColors, &out_printColor);
304 if (!error.length()) {
306 result->setArray(ASCIILiteral("columnNames"), out_columnNames);
307 if (out_notes.isAssigned())
308 result->setString(ASCIILiteral("notes"), out_notes.getValue());
309 if (out_timestamp.isAssigned())
310 result->setDouble(ASCIILiteral("timestamp"), out_timestamp.getValue());
311 if (out_values.isAssigned())
312 result->setObject(ASCIILiteral("values"), out_values.getValue());
313 if (out_payload.isAssigned())
314 result->setValue(ASCIILiteral("payload"), out_payload.getValue());
315 if (out_databaseId.isAssigned())
316 result->setInteger(ASCIILiteral("databaseId"), out_databaseId.getValue());
318 result->setObject(ASCIILiteral("sqlError"), out_sqlError);
319 if (out_screenColor.isAssigned())
320 result->setString(ASCIILiteral("screenColor"), out_screenColor.getValue());
321 if (out_alternateColors)
322 result->setArray(ASCIILiteral("alternateColors"), out_alternateColors);
323 if (out_printColor.isAssigned())
324 result->setString(ASCIILiteral("printColor"), out_printColor.getValue());
327 m_backendDispatcher->sendResponse(requestId, WTFMove(result));
329 m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
332 void DatabaseBackendDispatcher::executeNoOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters)
334 RefPtr<Inspector::InspectorArray> in_columnNames = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("columnNames"), nullptr);
335 String in_notes = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("notes"), nullptr);
336 double in_timestamp = m_backendDispatcher->getDouble(parameters.get(), ASCIILiteral("timestamp"), nullptr);
337 RefPtr<Inspector::InspectorObject> in_values = m_backendDispatcher->getObject(parameters.get(), ASCIILiteral("values"), nullptr);
338 RefPtr<Inspector::InspectorValue> in_payload = m_backendDispatcher->getValue(parameters.get(), ASCIILiteral("payload"), nullptr);
339 int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr);
340 RefPtr<Inspector::InspectorObject> in_sqlError = m_backendDispatcher->getObject(parameters.get(), ASCIILiteral("sqlError"), nullptr);
341 String in_screenColor = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("screenColor"), nullptr);
342 RefPtr<Inspector::InspectorArray> in_alternateColors = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("alternateColors"), nullptr);
343 String in_printColor = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("printColor"), nullptr);
344 if (m_backendDispatcher->hasProtocolErrors()) {
345 m_backendDispatcher->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Some arguments of method '%s' can't be processed", "Database.executeNoOptionalParameters"));
349 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
350 if (m_alternateDispatcher) {
351 m_alternateDispatcher->executeNoOptionalParameters(requestId, *in_columnNames, in_notes, in_timestamp, *in_values, *in_payload, in_databaseId, *in_sqlError, in_screenColor, *in_alternateColors, in_printColor);
357 Ref<InspectorObject> result = InspectorObject::create();
358 RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
360 double out_timestamp;
361 Inspector::InspectorObject out_values;
362 Inspector::InspectorValue out_payload;
363 Inspector::Protocol::Database::DatabaseId out_databaseId;
364 RefPtr<Inspector::Protocol::Database::Error> out_sqlError;
365 Inspector::Protocol::Database::PrimaryColors out_screenColor;
366 RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors;
367 DatabaseBackendDispatcherHandler::PrintColor out_printColor;
368 m_agent->executeNoOptionalParameters(error, *in_columnNames, in_notes, in_timestamp, *in_values, *in_payload, in_databaseId, *in_sqlError, in_screenColor, *in_alternateColors, in_printColor, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, out_alternateColors, &out_printColor);
370 if (!error.length()) {
371 result->setArray(ASCIILiteral("columnNames"), out_columnNames);
372 result->setString(ASCIILiteral("notes"), out_notes);
373 result->setDouble(ASCIILiteral("timestamp"), out_timestamp);
374 result->setObject(ASCIILiteral("values"), out_values);
375 result->setValue(ASCIILiteral("payload"), out_payload);
376 result->setInteger(ASCIILiteral("databaseId"), out_databaseId);
377 result->setObject(ASCIILiteral("sqlError"), out_sqlError);
378 result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_screenColor));
379 result->setArray(ASCIILiteral("alternateColors"), out_alternateColors);
380 result->setString(ASCIILiteral("printColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_printColor));
383 m_backendDispatcher->sendResponse(requestId, WTFMove(result));
385 m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
388 } // namespace Inspector
390 ### End File: TestBackendDispatchers.cpp
392 ### Begin File: TestFrontendDispatchers.h
394 * Copyright (C) 2013 Google Inc. All rights reserved.
395 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
396 * Copyright (C) 2014 University of Washington. All rights reserved.
398 * Redistribution and use in source and binary forms, with or without
399 * modification, are permitted provided that the following conditions
401 * 1. Redistributions of source code must retain the above copyright
402 * notice, this list of conditions and the following disclaimer.
403 * 2. Redistributions in binary form must reproduce the above copyright
404 * notice, this list of conditions and the following disclaimer in the
405 * documentation and/or other materials provided with the distribution.
407 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
408 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
409 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
410 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
411 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
412 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
413 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
414 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
415 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
416 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
417 * THE POSSIBILITY OF SUCH DAMAGE.
420 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
421 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
425 #include "TestProtocolObjects.h"
426 #include <inspector/InspectorValues.h>
427 #include <wtf/text/WTFString.h>
429 namespace Inspector {
431 class FrontendRouter;
433 } // namespace Inspector
434 ### End File: TestFrontendDispatchers.h
436 ### Begin File: TestFrontendDispatchers.cpp
438 * Copyright (C) 2013 Google Inc. All rights reserved.
439 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
440 * Copyright (C) 2014 University of Washington. All rights reserved.
442 * Redistribution and use in source and binary forms, with or without
443 * modification, are permitted provided that the following conditions
445 * 1. Redistributions of source code must retain the above copyright
446 * notice, this list of conditions and the following disclaimer.
447 * 2. Redistributions in binary form must reproduce the above copyright
448 * notice, this list of conditions and the following disclaimer in the
449 * documentation and/or other materials provided with the distribution.
451 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
452 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
453 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
454 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
455 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
456 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
457 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
458 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
459 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
460 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
461 * THE POSSIBILITY OF SUCH DAMAGE.
464 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
465 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
468 #include "TestFrontendDispatchers.h"
470 #include "InspectorFrontendRouter.h"
471 #include <wtf/text/CString.h>
473 namespace Inspector {
475 } // namespace Inspector
477 ### End File: TestFrontendDispatchers.cpp
479 ### Begin File: TestProtocolObjects.h
481 * Copyright (C) 2013 Google Inc. All rights reserved.
482 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
483 * Copyright (C) 2014 University of Washington. All rights reserved.
485 * Redistribution and use in source and binary forms, with or without
486 * modification, are permitted provided that the following conditions
488 * 1. Redistributions of source code must retain the above copyright
489 * notice, this list of conditions and the following disclaimer.
490 * 2. Redistributions in binary form must reproduce the above copyright
491 * notice, this list of conditions and the following disclaimer in the
492 * documentation and/or other materials provided with the distribution.
494 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
495 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
496 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
497 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
498 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
499 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
500 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
501 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
502 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
503 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
504 * THE POSSIBILITY OF SUCH DAMAGE.
507 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
508 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
512 #include <inspector/InspectorProtocolTypes.h>
513 #include <wtf/Assertions.h>
515 namespace Inspector {
521 // Forward declarations.
524 enum class PrimaryColors;
526 // End of forward declarations.
531 /* Unique identifier of Database object. */
532 typedef int DatabaseId;
533 typedef Inspector::Protocol::Array<Inspector::Protocol::Database::PrimaryColors> ColorList;
537 namespace TestHelpers {
539 String getEnumConstantValue(int code);
541 template<typename T> String getEnumConstantValue(T enumValue)
543 return getEnumConstantValue(static_cast<int>(enumValue));
546 } // namespace TestHelpers
550 enum class PrimaryColors {
554 }; // enum class PrimaryColors
555 /* Database error. */
556 class Error : public Inspector::InspectorObjectBase {
562 AllFieldsSet = (MessageSet | CodeSet)
568 RefPtr<InspectorObject> m_result;
570 template<int STEP> Builder<STATE | STEP>& castState()
572 return *reinterpret_cast<Builder<STATE | STEP>*>(this);
575 Builder(Ref</*Error*/InspectorObject>&& object)
576 : m_result(WTFMove(object))
578 COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
583 Builder<STATE | MessageSet>& setMessage(const String& value)
585 COMPILE_ASSERT(!(STATE & MessageSet), property_message_already_set);
586 m_result->setString(ASCIILiteral("message"), value);
587 return castState<MessageSet>();
590 Builder<STATE | CodeSet>& setCode(int value)
592 COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set);
593 m_result->setInteger(ASCIILiteral("code"), value);
594 return castState<CodeSet>();
599 COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
600 COMPILE_ASSERT(sizeof(Error) == sizeof(InspectorObject), cannot_cast);
602 Ref<InspectorObject> result = m_result.releaseNonNull();
603 return WTFMove(*reinterpret_cast<Ref<Error>*>(&result));
608 * Synthetic constructor:
609 * Ref<Error> result = Error::create()
614 static Builder<NoFieldsSet> create()
616 return Builder<NoFieldsSet>(InspectorObject::create());
624 namespace TestHelpers {
626 template<typename ProtocolEnumType>
627 std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);
629 // Enums in the 'Database' Domain
631 std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&);
633 } // namespace TestHelpers
635 } // namespace Protocol
637 } // namespace Inspector
638 ### End File: TestProtocolObjects.h
640 ### Begin File: TestProtocolObjects.cpp
642 * Copyright (C) 2013 Google Inc. All rights reserved.
643 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
644 * Copyright (C) 2014 University of Washington. All rights reserved.
646 * Redistribution and use in source and binary forms, with or without
647 * modification, are permitted provided that the following conditions
649 * 1. Redistributions of source code must retain the above copyright
650 * notice, this list of conditions and the following disclaimer.
651 * 2. Redistributions in binary form must reproduce the above copyright
652 * notice, this list of conditions and the following disclaimer in the
653 * documentation and/or other materials provided with the distribution.
655 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
656 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
657 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
658 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
659 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
660 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
661 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
662 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
663 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
664 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
665 * THE POSSIBILITY OF SUCH DAMAGE.
668 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
669 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
672 #include "TestProtocolObjects.h"
674 #include <wtf/Optional.h>
675 #include <wtf/text/CString.h>
677 namespace Inspector {
681 namespace TestHelpers {
683 static const char* const enum_constant_values[] = {
693 String getEnumConstantValue(int code) {
694 return enum_constant_values[code];
697 // Enums in the 'Database' Domain
699 std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString)
701 static const size_t constantValues[] = {
702 (size_t)Inspector::Protocol::Database::PrimaryColors::Red,
703 (size_t)Inspector::Protocol::Database::PrimaryColors::Green,
704 (size_t)Inspector::Protocol::Database::PrimaryColors::Blue,
706 for (size_t i = 0; i < 3; ++i)
707 if (protocolString == enum_constant_values[constantValues[i]])
708 return (Inspector::Protocol::Database::PrimaryColors)constantValues[i];
714 } // namespace TestHelpers
718 } // namespace Protocol
720 } // namespace Inspector
722 ### End File: TestProtocolObjects.cpp
724 ### Begin File: TestProtocolBackendDispatchers.h
726 * Copyright (C) 2013 Google Inc. All rights reserved.
727 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
728 * Copyright (C) 2014 University of Washington. All rights reserved.
730 * Redistribution and use in source and binary forms, with or without
731 * modification, are permitted provided that the following conditions
733 * 1. Redistributions of source code must retain the above copyright
734 * notice, this list of conditions and the following disclaimer.
735 * 2. Redistributions in binary form must reproduce the above copyright
736 * notice, this list of conditions and the following disclaimer in the
737 * documentation and/or other materials provided with the distribution.
739 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
740 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
741 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
742 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
743 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
744 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
745 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
746 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
747 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
748 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
749 * THE POSSIBILITY OF SUCH DAMAGE.
752 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
753 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
755 #include <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
756 #include <wtf/RetainPtr.h>
758 @protocol TestProtocolDatabaseDomainHandler;
760 namespace Inspector {
763 class ObjCInspectorDatabaseBackendDispatcher final : public AlternateDatabaseBackendDispatcher {
765 ObjCInspectorDatabaseBackendDispatcher(id<TestProtocolDatabaseDomainHandler> handler) { m_delegate = handler; }
766 virtual void executeAllOptionalParameters(long requestId, const Inspector::InspectorArray* in_columnNames, const String* const in_notes, const double* const in_timestamp, const Inspector::InspectorObject* in_values, const Inspector::InspectorValue* const in_payload, const int* const in_databaseId, const Inspector::InspectorObject* in_sqlError, const String* const in_screenColor, const Inspector::InspectorArray* in_alternateColors, const String* const in_printColor) override;
767 virtual void executeNoOptionalParameters(long requestId, const Inspector::InspectorArray& in_columnNames, const String& in_notes, double in_timestamp, const Inspector::InspectorObject& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const Inspector::InspectorObject& in_sqlError, const String& in_screenColor, const Inspector::InspectorArray& in_alternateColors, const String& in_printColor) override;
769 RetainPtr<id<TestProtocolDatabaseDomainHandler>> m_delegate;
772 } // namespace Inspector
774 ### End File: TestProtocolBackendDispatchers.h
776 ### Begin File: TestProtocolConfiguration.mm
778 * Copyright (C) 2013 Google Inc. All rights reserved.
779 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
780 * Copyright (C) 2014 University of Washington. All rights reserved.
782 * Redistribution and use in source and binary forms, with or without
783 * modification, are permitted provided that the following conditions
785 * 1. Redistributions of source code must retain the above copyright
786 * notice, this list of conditions and the following disclaimer.
787 * 2. Redistributions in binary form must reproduce the above copyright
788 * notice, this list of conditions and the following disclaimer in the
789 * documentation and/or other materials provided with the distribution.
791 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
792 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
793 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
794 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
795 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
796 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
797 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
798 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
799 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
800 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
801 * THE POSSIBILITY OF SUCH DAMAGE.
804 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
805 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
808 #import "TestProtocolConfiguration.h"
810 #import "TestProtocolInternal.h"
811 #import "TestProtocolBackendDispatchers.h"
812 #import <JavaScriptCore/AlternateDispatchableAgent.h>
813 #import <JavaScriptCore/AugmentableInspectorController.h>
814 #import <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
815 #import <JavaScriptCore/InspectorBackendDispatchers.h>
817 using namespace Inspector;
819 @implementation TestProtocolConfiguration
821 AugmentableInspectorController* _controller;
822 id<TestProtocolDatabaseDomainHandler> _databaseHandler;
825 - (instancetype)initWithController:(AugmentableInspectorController*)controller
831 _controller = controller;
837 [_databaseHandler release];
841 - (void)setDatabaseHandler:(id<TestProtocolDatabaseDomainHandler>)handler
843 if (handler == _databaseHandler)
846 [_databaseHandler release];
847 _databaseHandler = [handler retain];
849 auto alternateDispatcher = std::make_unique<ObjCInspectorDatabaseBackendDispatcher>(handler);
850 auto alternateAgent = std::make_unique<AlternateDispatchableAgent<DatabaseBackendDispatcher, AlternateDatabaseBackendDispatcher>>(ASCIILiteral("Database"), *_controller, WTFMove(alternateDispatcher));
851 _controller->appendExtraAgent(WTFMove(alternateAgent));
854 - (id<TestProtocolDatabaseDomainHandler>)databaseHandler
856 return _databaseHandler;
862 ### End File: TestProtocolConfiguration.mm
864 ### Begin File: TestProtocolConfiguration.h
866 * Copyright (C) 2013 Google Inc. All rights reserved.
867 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
868 * Copyright (C) 2014 University of Washington. All rights reserved.
870 * Redistribution and use in source and binary forms, with or without
871 * modification, are permitted provided that the following conditions
873 * 1. Redistributions of source code must retain the above copyright
874 * notice, this list of conditions and the following disclaimer.
875 * 2. Redistributions in binary form must reproduce the above copyright
876 * notice, this list of conditions and the following disclaimer in the
877 * documentation and/or other materials provided with the distribution.
879 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
880 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
881 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
882 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
883 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
884 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
885 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
886 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
887 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
888 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
889 * THE POSSIBILITY OF SUCH DAMAGE.
892 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
893 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
895 #import <WebInspector/TestProtocol.h>
897 __attribute__((visibility ("default")))
898 @interface TestProtocolConfiguration : NSObject
899 @property (nonatomic, retain, setter=setDatabaseHandler:) id<TestProtocolDatabaseDomainHandler> databaseHandler;
903 ### End File: TestProtocolConfiguration.h
905 ### Begin File: TestProtocolBackendDispatchers.mm
907 * Copyright (C) 2013 Google Inc. All rights reserved.
908 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
909 * Copyright (C) 2014 University of Washington. All rights reserved.
911 * Redistribution and use in source and binary forms, with or without
912 * modification, are permitted provided that the following conditions
914 * 1. Redistributions of source code must retain the above copyright
915 * notice, this list of conditions and the following disclaimer.
916 * 2. Redistributions in binary form must reproduce the above copyright
917 * notice, this list of conditions and the following disclaimer in the
918 * documentation and/or other materials provided with the distribution.
920 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
921 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
922 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
923 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
924 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
925 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
926 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
927 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
928 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
929 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
930 * THE POSSIBILITY OF SUCH DAMAGE.
933 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
934 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
937 #import "TestProtocolBackendDispatchers.h"
939 #include "TestProtocolInternal.h"
940 #include "TestProtocolTypeConversions.h"
941 #include <JavaScriptCore/InspectorValues.h>
943 namespace Inspector {
945 void ObjCInspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, const Inspector::InspectorArray* in_columnNames, const String* const in_notes, const double* const in_timestamp, const Inspector::InspectorObject* in_values, const Inspector::InspectorValue* const in_payload, const int* const in_databaseId, const Inspector::InspectorObject* in_sqlError, const String* const in_screenColor, const Inspector::InspectorArray* in_alternateColors, const String* const in_printColor)
947 id errorCallback = ^(NSString *error) {
948 backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error);
949 backendDispatcher()->sendPendingErrors();
952 id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteAllOptionalParametersPrintColor *printColor) {
953 Ref<InspectorObject> resultObject = InspectorObject::create();
954 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames");
955 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes");
956 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values");
957 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(payload, @"payload");
958 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(sqlError, @"sqlError");
959 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(alternateColors, @"alternateColors");
961 resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(*columnNames));
963 resultObject->setString(ASCIILiteral("notes"), *notes);
965 resultObject->setDouble(ASCIILiteral("timestamp"), *timestamp);
967 resultObject->setObject(ASCIILiteral("values"), [*values toInspectorObject]);
969 resultObject->setValue(ASCIILiteral("payload"), [*payload toInspectorObject]);
971 resultObject->setInteger(ASCIILiteral("databaseId"), *databaseId);
973 resultObject->setObject(ASCIILiteral("sqlError"), [*sqlError toInspectorObject]);
975 resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(*screenColor));
977 resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(*alternateColors));
979 resultObject->setString(ASCIILiteral("printColor"), toProtocolString(*printColor));
980 backendDispatcher()->sendResponse(requestId, WTFMove(resultObject));
983 NSArray/*<NSString>*/ *o_in_columnNames;
985 o_in_columnNames = objcStringArray(in_columnNames);
986 NSString *o_in_notes;
988 o_in_notes = *in_notes;
989 double o_in_timestamp;
991 o_in_timestamp = *in_timestamp;
992 RWIProtocolJSONObject *o_in_values;
994 o_in_values = [[[RWIProtocolJSONObject alloc] initWithInspectorObject:in_values] autorelease];
995 RWIProtocolJSONObject *o_in_payload;
997 o_in_payload = [[[RWIProtocolJSONObject alloc] initWithInspectorObject:in_payload] autorelease];
1000 o_in_databaseId = *in_databaseId;
1001 TestProtocolDatabaseError *o_in_sqlError;
1003 o_in_sqlError = [[[TestProtocolDatabaseError alloc] initWithInspectorObject:in_sqlError] autorelease];
1004 TestProtocolDatabasePrimaryColors o_in_screenColor;
1006 o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(*in_screenColor);
1007 NSArray/*<NSString>*/ *o_in_alternateColors;
1008 if (in_alternateColors)
1009 o_in_alternateColors = objcStringArray(in_alternateColors);
1010 TestProtocolDatabaseExecuteAllOptionalParametersPrintColor o_in_printColor;
1012 o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor>(*in_printColor);
1014 [m_delegate executeAllOptionalParametersWithErrorCallback:errorCallback successCallback:successCallback columnNames:(in_columnNames ? &o_in_columnNames : nil) notes:(in_notes ? &o_in_notes : nil) timestamp:(in_timestamp ? &o_in_timestamp : nil) values:(in_values ? &o_in_values : nil) payload:(in_payload ? &o_in_payload : nil) databaseId:(in_databaseId ? &o_in_databaseId : nil) sqlError:(in_sqlError ? &o_in_sqlError : nil) screenColor:(in_screenColor ? &o_in_screenColor : nil) alternateColors:(in_alternateColors ? &o_in_alternateColors : nil) printColor:(in_printColor ? &o_in_printColor : nil)];
1017 void ObjCInspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long requestId, const Inspector::InspectorArray& in_columnNames, const String& in_notes, double in_timestamp, const Inspector::InspectorObject& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const Inspector::InspectorObject& in_sqlError, const String& in_screenColor, const Inspector::InspectorArray& in_alternateColors, const String& in_printColor)
1019 id errorCallback = ^(NSString *error) {
1020 backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error);
1021 backendDispatcher()->sendPendingErrors();
1024 id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, TestProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabaseExecuteNoOptionalParametersPrintColor printColor) {
1025 Ref<InspectorObject> resultObject = InspectorObject::create();
1026 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames");
1027 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes");
1028 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values");
1029 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(payload, @"payload");
1030 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(sqlError, @"sqlError");
1031 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(alternateColors, @"alternateColors");
1032 resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(columnNames));
1033 resultObject->setString(ASCIILiteral("notes"), notes);
1034 resultObject->setDouble(ASCIILiteral("timestamp"), timestamp);
1035 resultObject->setObject(ASCIILiteral("values"), [values toInspectorObject]);
1036 resultObject->setValue(ASCIILiteral("payload"), [payload toInspectorObject]);
1037 resultObject->setInteger(ASCIILiteral("databaseId"), databaseId);
1038 resultObject->setObject(ASCIILiteral("sqlError"), [sqlError toInspectorObject]);
1039 resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(screenColor));
1040 resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(alternateColors));
1041 resultObject->setString(ASCIILiteral("printColor"), toProtocolString(printColor));
1042 backendDispatcher()->sendResponse(requestId, WTFMove(resultObject));
1045 NSArray/*<NSString>*/ *o_in_columnNames = objcStringArray(&in_columnNames);
1046 NSString *o_in_notes = in_notes;
1047 double o_in_timestamp = in_timestamp;
1048 RWIProtocolJSONObject *o_in_values = [[[RWIProtocolJSONObject alloc] initWithInspectorObject:&in_values] autorelease];
1049 RWIProtocolJSONObject *o_in_payload = [[[RWIProtocolJSONObject alloc] initWithInspectorObject:&in_payload] autorelease];
1050 int o_in_databaseId = in_databaseId;
1051 TestProtocolDatabaseError *o_in_sqlError = [[[TestProtocolDatabaseError alloc] initWithInspectorObject:&in_sqlError] autorelease];
1052 TestProtocolDatabasePrimaryColors o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(in_screenColor);
1053 NSArray/*<NSString>*/ *o_in_alternateColors = objcStringArray(&in_alternateColors);
1054 TestProtocolDatabaseExecuteNoOptionalParametersPrintColor o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor>(in_printColor);
1056 [m_delegate executeNoOptionalParametersWithErrorCallback:errorCallback successCallback:successCallback columnNames:o_in_columnNames notes:o_in_notes timestamp:o_in_timestamp values:o_in_values payload:o_in_payload databaseId:o_in_databaseId sqlError:o_in_sqlError screenColor:o_in_screenColor alternateColors:o_in_alternateColors printColor:o_in_printColor];
1060 } // namespace Inspector
1062 ### End File: TestProtocolBackendDispatchers.mm
1064 ### Begin File: TestProtocolEventDispatchers.mm
1066 * Copyright (C) 2013 Google Inc. All rights reserved.
1067 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
1068 * Copyright (C) 2014 University of Washington. All rights reserved.
1070 * Redistribution and use in source and binary forms, with or without
1071 * modification, are permitted provided that the following conditions
1073 * 1. Redistributions of source code must retain the above copyright
1074 * notice, this list of conditions and the following disclaimer.
1075 * 2. Redistributions in binary form must reproduce the above copyright
1076 * notice, this list of conditions and the following disclaimer in the
1077 * documentation and/or other materials provided with the distribution.
1079 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1080 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1081 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1082 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1083 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1084 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1085 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1086 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1087 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1088 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1089 * THE POSSIBILITY OF SUCH DAMAGE.
1092 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
1093 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1096 #import "TestProtocolInternal.h"
1098 #import "TestProtocolTypeConversions.h"
1099 #import <JavaScriptCore/InspectorValues.h>
1101 using namespace Inspector;
1106 ### End File: TestProtocolEventDispatchers.mm
1108 ### Begin File: TestProtocol.h
1110 * Copyright (C) 2013 Google Inc. All rights reserved.
1111 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
1112 * Copyright (C) 2014 University of Washington. All rights reserved.
1114 * Redistribution and use in source and binary forms, with or without
1115 * modification, are permitted provided that the following conditions
1117 * 1. Redistributions of source code must retain the above copyright
1118 * notice, this list of conditions and the following disclaimer.
1119 * 2. Redistributions in binary form must reproduce the above copyright
1120 * notice, this list of conditions and the following disclaimer in the
1121 * documentation and/or other materials provided with the distribution.
1123 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1124 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1125 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1126 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1127 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1128 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1129 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1130 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1131 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1132 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1133 * THE POSSIBILITY OF SUCH DAMAGE.
1136 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
1137 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1139 #import <Foundation/Foundation.h>
1141 #import <WebInspector/RWIProtocolJSONObject.h>
1144 @class TestProtocolDatabaseError;
1147 typedef NS_ENUM(NSInteger, TestProtocolDatabasePrimaryColors) {
1148 TestProtocolDatabasePrimaryColorsRed,
1149 TestProtocolDatabasePrimaryColorsGreen,
1150 TestProtocolDatabasePrimaryColorsBlue,
1153 typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteAllOptionalParametersPrintColor) {
1154 TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan,
1155 TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta,
1156 TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow,
1157 TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack,
1160 typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteAllOptionalParametersPrintColor) {
1161 TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan,
1162 TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta,
1163 TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow,
1164 TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack,
1167 typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteNoOptionalParametersPrintColor) {
1168 TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan,
1169 TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta,
1170 TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow,
1171 TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack,
1174 typedef NS_ENUM(NSInteger, TestProtocolDatabaseExecuteNoOptionalParametersPrintColor) {
1175 TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan,
1176 TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta,
1177 TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow,
1178 TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack,
1182 __attribute__((visibility ("default")))
1183 @interface TestProtocolDatabaseError : RWIProtocolJSONObject
1184 - (instancetype)initWithPayload:(NSDictionary<NSString *, id> *)payload;
1185 - (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject;
1186 - (instancetype)initWithMessage:(NSString *)message code:(int)code;
1187 /* required */ @property (nonatomic, copy) NSString *message;
1188 /* required */ @property (nonatomic, assign) int code;
1191 @protocol TestProtocolDatabaseDomainHandler <NSObject>
1193 - (void)executeAllOptionalParametersWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteAllOptionalParametersPrintColor *printColor))successCallback columnNames:(NSArray/*<NSString>*/ **)columnNames notes:(NSString **)notes timestamp:(double *)timestamp values:(RWIProtocolJSONObject **)values payload:(RWIProtocolJSONObject **)payload databaseId:(int *)databaseId sqlError:(TestProtocolDatabaseError **)sqlError screenColor:(TestProtocolDatabasePrimaryColors *)screenColor alternateColors:(NSArray/*<NSString>*/ **)alternateColors printColor:(TestProtocolDatabaseExecuteAllOptionalParametersPrintColor *)printColor;
1194 - (void)executeNoOptionalParametersWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, TestProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabaseExecuteNoOptionalParametersPrintColor printColor))successCallback columnNames:(NSArray/*<NSString>*/ *)columnNames notes:(NSString *)notes timestamp:(double)timestamp values:(RWIProtocolJSONObject *)values payload:(RWIProtocolJSONObject *)payload databaseId:(int)databaseId sqlError:(TestProtocolDatabaseError *)sqlError screenColor:(TestProtocolDatabasePrimaryColors)screenColor alternateColors:(NSArray/*<NSString>*/ *)alternateColors printColor:(TestProtocolDatabaseExecuteNoOptionalParametersPrintColor)printColor;
1200 ### End File: TestProtocol.h
1202 ### Begin File: TestProtocolInternal.h
1204 * Copyright (C) 2013 Google Inc. All rights reserved.
1205 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
1206 * Copyright (C) 2014 University of Washington. All rights reserved.
1208 * Redistribution and use in source and binary forms, with or without
1209 * modification, are permitted provided that the following conditions
1211 * 1. Redistributions of source code must retain the above copyright
1212 * notice, this list of conditions and the following disclaimer.
1213 * 2. Redistributions in binary form must reproduce the above copyright
1214 * notice, this list of conditions and the following disclaimer in the
1215 * documentation and/or other materials provided with the distribution.
1217 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1218 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1219 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1220 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1221 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1222 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1223 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1224 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1225 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1226 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1227 * THE POSSIBILITY OF SUCH DAMAGE.
1230 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
1231 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1233 #import "TestProtocol.h"
1234 #import "TestProtocolJSONObjectPrivate.h"
1235 #import <JavaScriptCore/AugmentableInspectorController.h>
1236 #import <JavaScriptCore/InspectorValues.h>
1241 ### End File: TestProtocolInternal.h
1243 ### Begin File: TestProtocolTypeConversions.h
1245 * Copyright (C) 2013 Google Inc. All rights reserved.
1246 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
1247 * Copyright (C) 2014 University of Washington. All rights reserved.
1249 * Redistribution and use in source and binary forms, with or without
1250 * modification, are permitted provided that the following conditions
1252 * 1. Redistributions of source code must retain the above copyright
1253 * notice, this list of conditions and the following disclaimer.
1254 * 2. Redistributions in binary form must reproduce the above copyright
1255 * notice, this list of conditions and the following disclaimer in the
1256 * documentation and/or other materials provided with the distribution.
1258 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1259 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1260 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1261 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1262 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1263 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1264 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1265 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1266 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1267 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1268 * THE POSSIBILITY OF SUCH DAMAGE.
1271 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
1272 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1274 #import "TestProtocol.h"
1275 #import <WebInspector/RWIProtocolArrayConversions.h>
1277 namespace Inspector {
1279 template<typename ObjCEnumType>
1280 ObjCEnumType fromProtocolString(const String& value);
1283 inline String toProtocolString(TestProtocolDatabasePrimaryColors value)
1286 case TestProtocolDatabasePrimaryColorsRed:
1287 return ASCIILiteral("red");
1288 case TestProtocolDatabasePrimaryColorsGreen:
1289 return ASCIILiteral("green");
1290 case TestProtocolDatabasePrimaryColorsBlue:
1291 return ASCIILiteral("blue");
1296 inline TestProtocolDatabasePrimaryColors fromProtocolString(const String& value)
1299 return TestProtocolDatabasePrimaryColorsRed;
1300 if (value == "green")
1301 return TestProtocolDatabasePrimaryColorsGreen;
1302 if (value == "blue")
1303 return TestProtocolDatabasePrimaryColorsBlue;
1304 ASSERT_NOT_REACHED();
1305 return TestProtocolDatabasePrimaryColorsRed;
1308 inline String toProtocolString(TestProtocolDatabaseExecuteAllOptionalParametersPrintColor value)
1311 case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan:
1312 return ASCIILiteral("cyan");
1313 case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta:
1314 return ASCIILiteral("magenta");
1315 case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow:
1316 return ASCIILiteral("yellow");
1317 case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack:
1318 return ASCIILiteral("black");
1323 inline TestProtocolDatabaseExecuteAllOptionalParametersPrintColor fromProtocolString(const String& value)
1325 if (value == "cyan")
1326 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan;
1327 if (value == "magenta")
1328 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta;
1329 if (value == "yellow")
1330 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow;
1331 if (value == "black")
1332 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack;
1333 ASSERT_NOT_REACHED();
1334 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan;
1337 inline String toProtocolString(TestProtocolDatabaseExecuteAllOptionalParametersPrintColor value)
1340 case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan:
1341 return ASCIILiteral("cyan");
1342 case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta:
1343 return ASCIILiteral("magenta");
1344 case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow:
1345 return ASCIILiteral("yellow");
1346 case TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack:
1347 return ASCIILiteral("black");
1352 inline TestProtocolDatabaseExecuteAllOptionalParametersPrintColor fromProtocolString(const String& value)
1354 if (value == "cyan")
1355 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan;
1356 if (value == "magenta")
1357 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorMagenta;
1358 if (value == "yellow")
1359 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow;
1360 if (value == "black")
1361 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack;
1362 ASSERT_NOT_REACHED();
1363 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan;
1366 inline String toProtocolString(TestProtocolDatabaseExecuteNoOptionalParametersPrintColor value)
1369 case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan:
1370 return ASCIILiteral("cyan");
1371 case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta:
1372 return ASCIILiteral("magenta");
1373 case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow:
1374 return ASCIILiteral("yellow");
1375 case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack:
1376 return ASCIILiteral("black");
1381 inline TestProtocolDatabaseExecuteNoOptionalParametersPrintColor fromProtocolString(const String& value)
1383 if (value == "cyan")
1384 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan;
1385 if (value == "magenta")
1386 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta;
1387 if (value == "yellow")
1388 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow;
1389 if (value == "black")
1390 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack;
1391 ASSERT_NOT_REACHED();
1392 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan;
1395 inline String toProtocolString(TestProtocolDatabaseExecuteNoOptionalParametersPrintColor value)
1398 case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan:
1399 return ASCIILiteral("cyan");
1400 case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta:
1401 return ASCIILiteral("magenta");
1402 case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow:
1403 return ASCIILiteral("yellow");
1404 case TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack:
1405 return ASCIILiteral("black");
1410 inline TestProtocolDatabaseExecuteNoOptionalParametersPrintColor fromProtocolString(const String& value)
1412 if (value == "cyan")
1413 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan;
1414 if (value == "magenta")
1415 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorMagenta;
1416 if (value == "yellow")
1417 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow;
1418 if (value == "black")
1419 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack;
1420 ASSERT_NOT_REACHED();
1421 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan;
1424 } // namespace Inspector
1426 ### End File: TestProtocolTypeConversions.h
1428 ### Begin File: TestProtocolTypeConversions.mm
1430 * Copyright (C) 2013 Google Inc. All rights reserved.
1431 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
1432 * Copyright (C) 2014 University of Washington. All rights reserved.
1434 * Redistribution and use in source and binary forms, with or without
1435 * modification, are permitted provided that the following conditions
1437 * 1. Redistributions of source code must retain the above copyright
1438 * notice, this list of conditions and the following disclaimer.
1439 * 2. Redistributions in binary form must reproduce the above copyright
1440 * notice, this list of conditions and the following disclaimer in the
1441 * documentation and/or other materials provided with the distribution.
1443 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1444 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1445 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1446 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1447 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1448 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1449 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1450 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1451 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1452 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1453 * THE POSSIBILITY OF SUCH DAMAGE.
1456 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
1457 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1460 #import "TestProtocolTypeConversions.h"
1462 #import "TestProtocol.h"
1463 #import "TestProtocolTypeParser.h"
1464 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
1466 using namespace Inspector;
1468 @interface TestProtocolTypeConversions (DatabaseDomain)
1470 + (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload;
1471 + (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload;
1472 + (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload;
1473 + (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload;
1477 @implementation TestProtocolTypeConversions (DatabaseDomain)
1479 + (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload
1481 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
1482 *outValue = (NSNumber *)payload;
1485 + (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload
1487 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
1488 *outValue = @(Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload));
1491 + (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload
1493 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]);
1494 *outValue = (NSArray/*<NSString>*/ *)payload;
1497 + (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload
1499 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
1500 *outValue = [[TestProtocolDatabaseError alloc] initWithPayload:payload];
1506 ### End File: TestProtocolTypeConversions.mm
1508 ### Begin File: TestProtocolTypes.mm
1510 * Copyright (C) 2013 Google Inc. All rights reserved.
1511 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
1512 * Copyright (C) 2014 University of Washington. All rights reserved.
1514 * Redistribution and use in source and binary forms, with or without
1515 * modification, are permitted provided that the following conditions
1517 * 1. Redistributions of source code must retain the above copyright
1518 * notice, this list of conditions and the following disclaimer.
1519 * 2. Redistributions in binary form must reproduce the above copyright
1520 * notice, this list of conditions and the following disclaimer in the
1521 * documentation and/or other materials provided with the distribution.
1523 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1524 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1525 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1526 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1527 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1528 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1529 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1530 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1531 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1532 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1533 * THE POSSIBILITY OF SUCH DAMAGE.
1536 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
1537 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1540 #import "TestProtocolInternal.h"
1542 #import "TestProtocolTypeConversions.h"
1543 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
1544 #import <JavaScriptCore/InspectorValues.h>
1545 #import <wtf/Assertions.h>
1547 using namespace Inspector;
1550 @implementation TestProtocolDatabaseError
1552 - (instancetype)initWithPayload:(nonnull NSDictionary<NSString *, id> *)payload
1554 if (!(self = [super init]))
1557 THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"message"], @"message");
1558 self.message = payload[@"message"];
1560 THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"code"], @"code");
1561 self.code = [payload[@"code"] integerValue];
1565 - (instancetype)initWithJSONObject:(RWIProtocolJSONObject *)jsonObject
1567 if (!(self = [super initWithInspectorObject:[jsonObject toInspectorObject].get()]))
1573 - (instancetype)initWithMessage:(NSString *)message code:(int)code
1575 if (!(self = [super init]))
1578 THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(message, @"message");
1580 self.message = message;
1586 - (void)setMessage:(NSString *)message
1588 [super setString:message forKey:@"message"];
1591 - (NSString *)message
1593 return [super stringForKey:@"message"];
1596 - (void)setCode:(int)code
1598 [super setInteger:code forKey:@"code"];
1603 return [super integerForKey:@"code"];
1609 ### End File: TestProtocolTypes.mm