1 ### Begin File: InspectorAlternateBackendDispatchers.h
3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * Copyright (C) 2013, 2014 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-async-attribute.json
30 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
32 #ifndef InspectorAlternateBackendDispatchers_h
33 #define InspectorAlternateBackendDispatchers_h
35 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
37 #include "InspectorProtocolTypes.h"
38 #include <JavaScriptCore/InspectorBackendDispatcher.h>
42 class AlternateBackendDispatcher {
44 void setBackendDispatcher(RefPtr<BackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
45 BackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
47 RefPtr<BackendDispatcher> m_backendDispatcher;
51 class AlternateDatabaseBackendDispatcher : public AlternateBackendDispatcher {
53 virtual ~AlternateDatabaseBackendDispatcher() { }
54 virtual void executeSQLSyncOptionalReturnValues(long callId, int in_databaseId, const String& in_query) = 0;
55 virtual void executeSQLAsyncOptionalReturnValues(long callId, int in_databaseId, const String& in_query) = 0;
56 virtual void executeSQLSync(long callId, int in_databaseId, const String& in_query) = 0;
57 virtual void executeSQLAsync(long callId, int in_databaseId, const String& in_query) = 0;
60 } // namespace Inspector
62 #endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
64 #endif // !defined(InspectorAlternateBackendDispatchers_h)
65 ### End File: InspectorAlternateBackendDispatchers.h
67 ### Begin File: InspectorBackendCommands.js
69 * Copyright (C) 2013 Google Inc. All rights reserved.
70 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
71 * Copyright (C) 2014 University of Washington. All rights reserved.
73 * Redistribution and use in source and binary forms, with or without
74 * modification, are permitted provided that the following conditions
76 * 1. Redistributions of source code must retain the above copyright
77 * notice, this list of conditions and the following disclaimer.
78 * 2. Redistributions in binary form must reproduce the above copyright
79 * notice, this list of conditions and the following disclaimer in the
80 * documentation and/or other materials provided with the distribution.
82 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
83 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
84 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
85 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
86 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
87 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
88 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
89 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
90 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
91 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
92 * THE POSSIBILITY OF SUCH DAMAGE.
95 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
96 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
99 InspectorBackend.registerDatabaseDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Database");
100 InspectorBackend.registerEnum("Database.PrimaryColors", {Red: "red", Green: "green", Blue: "blue"});
101 InspectorBackend.registerCommand("Database.executeSQLSyncOptionalReturnValues", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
102 InspectorBackend.registerCommand("Database.executeSQLAsyncOptionalReturnValues", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
103 InspectorBackend.registerCommand("Database.executeSQLSync", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "alternateColors", "screenColor", "printColor"]);
104 InspectorBackend.registerCommand("Database.executeSQLAsync", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
105 InspectorBackend.activateDomain("Database");
106 ### End File: InspectorBackendCommands.js
108 ### Begin File: InspectorBackendDispatchers.h
110 * Copyright (C) 2013 Google Inc. All rights reserved.
111 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
112 * Copyright (C) 2014 University of Washington. All rights reserved.
114 * Redistribution and use in source and binary forms, with or without
115 * modification, are permitted provided that the following conditions
117 * 1. Redistributions of source code must retain the above copyright
118 * notice, this list of conditions and the following disclaimer.
119 * 2. Redistributions in binary form must reproduce the above copyright
120 * notice, this list of conditions and the following disclaimer in the
121 * documentation and/or other materials provided with the distribution.
123 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
124 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
125 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
126 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
127 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
128 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
129 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
130 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
131 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
132 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
133 * THE POSSIBILITY OF SUCH DAMAGE.
136 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
137 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
139 #ifndef InspectorBackendDispatchers_h
140 #define InspectorBackendDispatchers_h
142 #include "InspectorProtocolObjects.h"
143 #include <inspector/InspectorBackendDispatcher.h>
144 #include <wtf/text/WTFString.h>
146 namespace Inspector {
148 typedef String ErrorString;
150 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
151 class AlternateDatabaseBackendDispatcher;
152 #endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
154 class DatabaseBackendDispatcherHandler {
156 // Named after parameter 'screenColor' while generating command/event executeSQLSyncOptionalReturnValues.
157 enum class ScreenColor {
161 }; // enum class ScreenColor
162 // Named after parameter 'printColor' while generating command/event executeSQLSyncOptionalReturnValues.
163 enum class PrintColor {
168 }; // enum class PrintColor
169 virtual void executeSQLSyncOptionalReturnValues(ErrorString&, int in_databaseId, const String& in_query, RefPtr<Inspector::Protocol::Array<String>>& opt_out_columnNames, Inspector::Protocol::OptOutput<String>* opt_out_notes, Inspector::Protocol::OptOutput<double>* opt_out_timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* opt_out_values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* opt_out_payload, Inspector::Protocol::OptOutput<int>* opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& opt_out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0;
170 class ExecuteSQLAsyncOptionalReturnValuesCallback : public BackendDispatcher::CallbackBase {
172 ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<BackendDispatcher>&&, int id);
173 void sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, Inspector::Protocol::OptOutput<String>* notes, Inspector::Protocol::OptOutput<double>* timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* payload, Inspector::Protocol::OptOutput<int>* databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Inspector::Protocol::OptOutput<String>* screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Inspector::Protocol::OptOutput<String>* printColor);
175 virtual void executeSQLAsyncOptionalReturnValues(ErrorString&, int in_databaseId, const String& in_query, Ref<ExecuteSQLAsyncOptionalReturnValuesCallback>&& callback) = 0;
176 virtual void executeSQLSync(ErrorString&, int in_databaseId, const String& in_query, RefPtr<Inspector::Protocol::Array<String>>& out_columnNames, String* out_notes, double* out_timestamp, Inspector::InspectorObject* out_values, Inspector::InspectorValue* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, RefPtr<Inspector::Protocol::Database::ColorList>& out_alternateColors, Inspector::Protocol::Database::PrimaryColors* out_screenColor, DatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0;
177 class ExecuteSQLAsyncCallback : public BackendDispatcher::CallbackBase {
179 ExecuteSQLAsyncCallback(Ref<BackendDispatcher>&&, int id);
180 void sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, const String& notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, const String& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, const String& printColor);
182 virtual void executeSQLAsync(ErrorString&, int in_databaseId, const String& in_query, Ref<ExecuteSQLAsyncCallback>&& callback) = 0;
184 virtual ~DatabaseBackendDispatcherHandler();
187 class DatabaseBackendDispatcher final : public SupplementalBackendDispatcher {
189 static Ref<DatabaseBackendDispatcher> create(BackendDispatcher*, DatabaseBackendDispatcherHandler*);
190 virtual void dispatch(long callId, const String& method, Ref<InspectorObject>&& message) override;
192 void executeSQLSyncOptionalReturnValues(long callId, const InspectorObject& message);
193 void executeSQLAsyncOptionalReturnValues(long callId, const InspectorObject& message);
194 void executeSQLSync(long callId, const InspectorObject& message);
195 void executeSQLAsync(long callId, const InspectorObject& message);
197 DatabaseBackendDispatcher(BackendDispatcher&, DatabaseBackendDispatcherHandler*);
198 DatabaseBackendDispatcherHandler* m_agent;
199 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
201 void setAlternateDispatcher(AlternateDatabaseBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
203 AlternateDatabaseBackendDispatcher* m_alternateDispatcher;
207 } // namespace Inspector
209 #endif // !defined(InspectorBackendDispatchers_h)
210 ### End File: InspectorBackendDispatchers.h
212 ### Begin File: InspectorBackendDispatchers.cpp
214 * Copyright (C) 2013 Google Inc. All rights reserved.
215 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
216 * Copyright (C) 2014 University of Washington. All rights reserved.
218 * Redistribution and use in source and binary forms, with or without
219 * modification, are permitted provided that the following conditions
221 * 1. Redistributions of source code must retain the above copyright
222 * notice, this list of conditions and the following disclaimer.
223 * 2. Redistributions in binary form must reproduce the above copyright
224 * notice, this list of conditions and the following disclaimer in the
225 * documentation and/or other materials provided with the distribution.
227 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
228 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
229 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
230 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
231 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
232 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
233 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
234 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
235 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
236 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
237 * THE POSSIBILITY OF SUCH DAMAGE.
240 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
241 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
244 #include "InspectorBackendDispatchers.h"
246 #include <inspector/InspectorFrontendChannel.h>
247 #include <inspector/InspectorValues.h>
248 #include <wtf/text/CString.h>
250 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
251 #include "InspectorAlternateBackendDispatchers.h"
254 namespace Inspector {
256 DatabaseBackendDispatcherHandler::~DatabaseBackendDispatcherHandler() { }
258 Ref<DatabaseBackendDispatcher> DatabaseBackendDispatcher::create(BackendDispatcher* backendDispatcher, DatabaseBackendDispatcherHandler* agent)
260 return adoptRef(*new DatabaseBackendDispatcher(*backendDispatcher, agent));
263 DatabaseBackendDispatcher::DatabaseBackendDispatcher(BackendDispatcher& backendDispatcher, DatabaseBackendDispatcherHandler* agent)
264 : SupplementalBackendDispatcher(backendDispatcher)
266 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
267 , m_alternateDispatcher(nullptr)
270 m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Database"), this);
273 void DatabaseBackendDispatcher::dispatch(long callId, const String& method, Ref<InspectorObject>&& message)
275 Ref<DatabaseBackendDispatcher> protect(*this);
277 if (method == "executeSQLSyncOptionalReturnValues")
278 executeSQLSyncOptionalReturnValues(callId, message);
279 else if (method == "executeSQLAsyncOptionalReturnValues")
280 executeSQLAsyncOptionalReturnValues(callId, message);
281 else if (method == "executeSQLSync")
282 executeSQLSync(callId, message);
283 else if (method == "executeSQLAsync")
284 executeSQLAsync(callId, message);
286 m_backendDispatcher->reportProtocolError(&callId, BackendDispatcher::MethodNotFound, makeString('\'', "Database", '.', method, "' was not found"));
289 void DatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long callId, const InspectorObject& message)
291 auto protocolErrors = Inspector::Protocol::Array<String>::create();
292 RefPtr<InspectorObject> paramsContainer;
293 message.getObject(ASCIILiteral("params"), paramsContainer);
294 int in_databaseId = BackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), nullptr, protocolErrors.get());
295 String in_query = BackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("query"), nullptr, protocolErrors.get());
296 if (protocolErrors->length()) {
297 String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLSyncOptionalReturnValues");
298 m_backendDispatcher->reportProtocolError(&callId, BackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
302 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
303 if (m_alternateDispatcher) {
304 m_alternateDispatcher->executeSQLSyncOptionalReturnValues(callId, in_databaseId, in_query);
310 Ref<InspectorObject> result = InspectorObject::create();
311 RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
312 Inspector::Protocol::OptOutput<String> out_notes;
313 Inspector::Protocol::OptOutput<double> out_timestamp;
314 Inspector::Protocol::OptOutput<Inspector::InspectorObject> out_values;
315 Inspector::Protocol::OptOutput<Inspector::InspectorValue> out_payload;
316 Inspector::Protocol::OptOutput<Inspector::Protocol::Database::DatabaseId> out_databaseId;
317 RefPtr<Inspector::Protocol::Database::Error> out_sqlError;
318 Inspector::Protocol::Database::PrimaryColors out_screenColor;
319 RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors;
320 DatabaseBackendDispatcherHandler::PrintColor out_printColor;
321 m_agent->executeSQLSyncOptionalReturnValues(error, in_databaseId, in_query, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, out_alternateColors, &out_printColor);
323 if (!error.length()) {
325 result->setArray(ASCIILiteral("columnNames"), out_columnNames);
326 if (out_notes.isAssigned())
327 result->setString(ASCIILiteral("notes"), out_notes.getValue());
328 if (out_timestamp.isAssigned())
329 result->setDouble(ASCIILiteral("timestamp"), out_timestamp.getValue());
330 if (out_values.isAssigned())
331 result->setObject(ASCIILiteral("values"), out_values.getValue());
332 if (out_payload.isAssigned())
333 result->setValue(ASCIILiteral("payload"), out_payload.getValue());
334 if (out_databaseId.isAssigned())
335 result->setInteger(ASCIILiteral("databaseId"), out_databaseId.getValue());
337 result->setObject(ASCIILiteral("sqlError"), out_sqlError);
338 if (out_screenColor.isAssigned())
339 result->setString(ASCIILiteral("screenColor"), out_screenColor.getValue());
340 if (out_alternateColors)
341 result->setArray(ASCIILiteral("alternateColors"), out_alternateColors);
342 if (out_printColor.isAssigned())
343 result->setString(ASCIILiteral("printColor"), out_printColor.getValue());
345 m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
348 DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<BackendDispatcher>&& backendDispatcher, int id) : BackendDispatcher::CallbackBase(WTF::move(backendDispatcher), id) { }
350 void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, Inspector::Protocol::OptOutput<String>* notes, Inspector::Protocol::OptOutput<double>* timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* payload, Inspector::Protocol::OptOutput<int>* databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Inspector::Protocol::OptOutput<String>* screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Inspector::Protocol::OptOutput<String>* printColor)
352 Ref<InspectorObject> jsonMessage = InspectorObject::create();
354 jsonMessage->setArray(ASCIILiteral("columnNames"), columnNames);
355 if (notes.isAssigned())
356 jsonMessage->setString(ASCIILiteral("notes"), notes.getValue());
357 if (timestamp.isAssigned())
358 jsonMessage->setDouble(ASCIILiteral("timestamp"), timestamp.getValue());
359 if (values.isAssigned())
360 jsonMessage->setObject(ASCIILiteral("values"), values.getValue());
361 if (payload.isAssigned())
362 jsonMessage->setValue(ASCIILiteral("payload"), payload.getValue());
363 if (databaseId.isAssigned())
364 jsonMessage->setInteger(ASCIILiteral("databaseId"), databaseId.getValue());
366 jsonMessage->setObject(ASCIILiteral("sqlError"), sqlError);
367 if (screenColor.isAssigned())
368 jsonMessage->setString(ASCIILiteral("screenColor"), screenColor.getValue());
370 jsonMessage->setArray(ASCIILiteral("alternateColors"), alternateColors);
371 if (printColor.isAssigned())
372 jsonMessage->setString(ASCIILiteral("printColor"), printColor.getValue());
373 sendIfActive(WTF::move(jsonMessage), ErrorString());
376 void DatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long callId, const InspectorObject& message)
378 auto protocolErrors = Inspector::Protocol::Array<String>::create();
379 RefPtr<InspectorObject> paramsContainer;
380 message.getObject(ASCIILiteral("params"), paramsContainer);
381 int in_databaseId = BackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), nullptr, protocolErrors.get());
382 String in_query = BackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("query"), nullptr, protocolErrors.get());
383 if (protocolErrors->length()) {
384 String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLAsyncOptionalReturnValues");
385 m_backendDispatcher->reportProtocolError(&callId, BackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
389 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
390 if (m_alternateDispatcher) {
391 m_alternateDispatcher->executeSQLAsyncOptionalReturnValues(callId, in_databaseId, in_query);
397 Ref<InspectorObject> result = InspectorObject::create();
398 Ref<DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback> callback = adoptRef(*new DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback(m_backendDispatcher.copyRef(), callId));
399 m_agent->executeSQLAsyncOptionalReturnValues(error, in_databaseId, in_query, callback.copyRef());
401 if (error.length()) {
403 m_backendDispatcher->reportProtocolError(&callId, BackendDispatcher::ServerError, error);
408 void DatabaseBackendDispatcher::executeSQLSync(long callId, const InspectorObject& message)
410 auto protocolErrors = Inspector::Protocol::Array<String>::create();
411 RefPtr<InspectorObject> paramsContainer;
412 message.getObject(ASCIILiteral("params"), paramsContainer);
413 int in_databaseId = BackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), nullptr, protocolErrors.get());
414 String in_query = BackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("query"), nullptr, protocolErrors.get());
415 if (protocolErrors->length()) {
416 String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLSync");
417 m_backendDispatcher->reportProtocolError(&callId, BackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
421 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
422 if (m_alternateDispatcher) {
423 m_alternateDispatcher->executeSQLSync(callId, in_databaseId, in_query);
429 Ref<InspectorObject> result = InspectorObject::create();
430 RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
432 double out_timestamp;
433 Inspector::InspectorObject out_values;
434 Inspector::InspectorValue out_payload;
435 Inspector::Protocol::Database::DatabaseId out_databaseId;
436 RefPtr<Inspector::Protocol::Database::Error> out_sqlError;
437 RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors;
438 Inspector::Protocol::Database::PrimaryColors out_screenColor;
439 DatabaseBackendDispatcherHandler::PrintColor out_printColor;
440 m_agent->executeSQLSync(error, in_databaseId, in_query, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, out_alternateColors, &out_screenColor, &out_printColor);
442 if (!error.length()) {
443 result->setArray(ASCIILiteral("columnNames"), out_columnNames);
444 result->setString(ASCIILiteral("notes"), out_notes);
445 result->setDouble(ASCIILiteral("timestamp"), out_timestamp);
446 result->setObject(ASCIILiteral("values"), out_values);
447 result->setValue(ASCIILiteral("payload"), out_payload);
448 result->setInteger(ASCIILiteral("databaseId"), out_databaseId);
449 result->setObject(ASCIILiteral("sqlError"), out_sqlError);
450 result->setArray(ASCIILiteral("alternateColors"), out_alternateColors);
451 result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::getEnumConstantValue(out_screenColor));
452 result->setString(ASCIILiteral("printColor"), Inspector::Protocol::getEnumConstantValue(out_printColor));
454 m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
457 DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::ExecuteSQLAsyncCallback(Ref<BackendDispatcher>&& backendDispatcher, int id) : BackendDispatcher::CallbackBase(WTF::move(backendDispatcher), id) { }
459 void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, const String& notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, const String& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, const String& printColor)
461 Ref<InspectorObject> jsonMessage = InspectorObject::create();
462 jsonMessage->setArray(ASCIILiteral("columnNames"), columnNames);
463 jsonMessage->setString(ASCIILiteral("notes"), notes);
464 jsonMessage->setDouble(ASCIILiteral("timestamp"), timestamp);
465 jsonMessage->setObject(ASCIILiteral("values"), values);
466 jsonMessage->setValue(ASCIILiteral("payload"), payload);
467 jsonMessage->setInteger(ASCIILiteral("databaseId"), databaseId);
468 jsonMessage->setObject(ASCIILiteral("sqlError"), sqlError);
469 jsonMessage->setString(ASCIILiteral("screenColor"), Inspector::Protocol::getEnumConstantValue(screenColor));
470 jsonMessage->setArray(ASCIILiteral("alternateColors"), alternateColors);
471 jsonMessage->setString(ASCIILiteral("printColor"), Inspector::Protocol::getEnumConstantValue(printColor));
472 sendIfActive(WTF::move(jsonMessage), ErrorString());
475 void DatabaseBackendDispatcher::executeSQLAsync(long callId, const InspectorObject& message)
477 auto protocolErrors = Inspector::Protocol::Array<String>::create();
478 RefPtr<InspectorObject> paramsContainer;
479 message.getObject(ASCIILiteral("params"), paramsContainer);
480 int in_databaseId = BackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), nullptr, protocolErrors.get());
481 String in_query = BackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("query"), nullptr, protocolErrors.get());
482 if (protocolErrors->length()) {
483 String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLAsync");
484 m_backendDispatcher->reportProtocolError(&callId, BackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
488 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
489 if (m_alternateDispatcher) {
490 m_alternateDispatcher->executeSQLAsync(callId, in_databaseId, in_query);
496 Ref<InspectorObject> result = InspectorObject::create();
497 Ref<DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback> callback = adoptRef(*new DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback(m_backendDispatcher.copyRef(), callId));
498 m_agent->executeSQLAsync(error, in_databaseId, in_query, callback.copyRef());
500 if (error.length()) {
502 m_backendDispatcher->reportProtocolError(&callId, BackendDispatcher::ServerError, error);
507 } // namespace Inspector
509 ### End File: InspectorBackendDispatchers.cpp
511 ### Begin File: InspectorFrontendDispatchers.h
513 * Copyright (C) 2013 Google Inc. All rights reserved.
514 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
515 * Copyright (C) 2014 University of Washington. All rights reserved.
517 * Redistribution and use in source and binary forms, with or without
518 * modification, are permitted provided that the following conditions
520 * 1. Redistributions of source code must retain the above copyright
521 * notice, this list of conditions and the following disclaimer.
522 * 2. Redistributions in binary form must reproduce the above copyright
523 * notice, this list of conditions and the following disclaimer in the
524 * documentation and/or other materials provided with the distribution.
526 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
527 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
528 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
529 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
530 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
531 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
532 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
533 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
534 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
535 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
536 * THE POSSIBILITY OF SUCH DAMAGE.
539 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
540 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
542 #ifndef InspectorFrontendDispatchers_h
543 #define InspectorFrontendDispatchers_h
545 #include "InspectorProtocolObjects.h"
546 #include <inspector/InspectorFrontendChannel.h>
547 #include <inspector/InspectorValues.h>
548 #include <wtf/text/WTFString.h>
550 namespace Inspector {
554 } // namespace Inspector
556 #endif // !defined(InspectorFrontendDispatchers_h)
557 ### End File: InspectorFrontendDispatchers.h
559 ### Begin File: InspectorFrontendDispatchers.cpp
561 * Copyright (C) 2013 Google Inc. All rights reserved.
562 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
563 * Copyright (C) 2014 University of Washington. All rights reserved.
565 * Redistribution and use in source and binary forms, with or without
566 * modification, are permitted provided that the following conditions
568 * 1. Redistributions of source code must retain the above copyright
569 * notice, this list of conditions and the following disclaimer.
570 * 2. Redistributions in binary form must reproduce the above copyright
571 * notice, this list of conditions and the following disclaimer in the
572 * documentation and/or other materials provided with the distribution.
574 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
575 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
576 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
577 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
578 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
579 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
580 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
581 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
582 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
583 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
584 * THE POSSIBILITY OF SUCH DAMAGE.
587 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
588 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
591 #include "InspectorFrontendDispatchers.h"
593 #include <wtf/text/CString.h>
595 namespace Inspector {
597 } // namespace Inspector
599 ### End File: InspectorFrontendDispatchers.cpp
601 ### Begin File: InspectorProtocolObjects.h
603 * Copyright (C) 2013 Google Inc. All rights reserved.
604 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
605 * Copyright (C) 2014 University of Washington. All rights reserved.
607 * Redistribution and use in source and binary forms, with or without
608 * modification, are permitted provided that the following conditions
610 * 1. Redistributions of source code must retain the above copyright
611 * notice, this list of conditions and the following disclaimer.
612 * 2. Redistributions in binary form must reproduce the above copyright
613 * notice, this list of conditions and the following disclaimer in the
614 * documentation and/or other materials provided with the distribution.
616 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
617 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
618 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
619 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
620 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
621 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
622 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
623 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
624 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
625 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
626 * THE POSSIBILITY OF SUCH DAMAGE.
629 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
630 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
632 #ifndef InspectorProtocolObjects_h
633 #define InspectorProtocolObjects_h
635 #include <inspector/InspectorProtocolTypes.h>
636 #include <wtf/Assertions.h>
638 namespace Inspector {
644 // Forward declarations.
647 enum class PrimaryColors;
649 // End of forward declarations.
654 /* Unique identifier of Database object. */
655 typedef int DatabaseId;
656 typedef Inspector::Protocol::Array<Inspector::Protocol::Database::PrimaryColors> ColorList;
660 String getEnumConstantValue(int code);
662 template<typename T> String getEnumConstantValue(T enumValue)
664 return getEnumConstantValue(static_cast<int>(enumValue));
669 enum class PrimaryColors {
673 }; // enum class PrimaryColors
674 /* Database error. */
675 class Error : public Inspector::InspectorObjectBase {
681 AllFieldsSet = (MessageSet | CodeSet)
687 RefPtr<InspectorObject> m_result;
689 template<int STEP> Builder<STATE | STEP>& castState()
691 return *reinterpret_cast<Builder<STATE | STEP>*>(this);
694 Builder(Ref</*Error*/InspectorObject>&& object)
695 : m_result(WTF::move(object))
697 COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
702 Builder<STATE | MessageSet>& setMessage(const String& value)
704 COMPILE_ASSERT(!(STATE & MessageSet), property_message_already_set);
705 m_result->setString(ASCIILiteral("message"), value);
706 return castState<MessageSet>();
709 Builder<STATE | CodeSet>& setCode(int value)
711 COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set);
712 m_result->setInteger(ASCIILiteral("code"), value);
713 return castState<CodeSet>();
718 COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
719 COMPILE_ASSERT(sizeof(Error) == sizeof(InspectorObject), cannot_cast);
721 Ref<InspectorObject> result = m_result.releaseNonNull();
722 return WTF::move(*reinterpret_cast<Ref<Error>*>(&result));
727 * Synthetic constructor:
728 * Ref<Error> result = Error::create()
733 static Builder<NoFieldsSet> create()
735 return Builder<NoFieldsSet>(InspectorObject::create());
743 } // namespace Protocol
745 } // namespace Inspector
747 #endif // !defined(InspectorProtocolObjects_h)
748 ### End File: InspectorProtocolObjects.h
750 ### Begin File: InspectorProtocolObjects.cpp
752 * Copyright (C) 2013 Google Inc. All rights reserved.
753 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
754 * Copyright (C) 2014 University of Washington. All rights reserved.
756 * Redistribution and use in source and binary forms, with or without
757 * modification, are permitted provided that the following conditions
759 * 1. Redistributions of source code must retain the above copyright
760 * notice, this list of conditions and the following disclaimer.
761 * 2. Redistributions in binary form must reproduce the above copyright
762 * notice, this list of conditions and the following disclaimer in the
763 * documentation and/or other materials provided with the distribution.
765 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
766 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
767 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
768 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
769 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
770 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
771 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
772 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
773 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
774 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
775 * THE POSSIBILITY OF SUCH DAMAGE.
778 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
779 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
782 #include "InspectorProtocolObjects.h"
784 #include <wtf/text/CString.h>
786 namespace Inspector {
790 static const char* const enum_constant_values[] = {
800 String getEnumConstantValue(int code) {
801 return enum_constant_values[code];
806 } // namespace Protocol
808 } // namespace Inspector
810 ### End File: InspectorProtocolObjects.cpp
812 ### Begin File: RWIProtocolBackendDispatchers.h
814 * Copyright (C) 2013 Google Inc. All rights reserved.
815 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
816 * Copyright (C) 2014 University of Washington. All rights reserved.
818 * Redistribution and use in source and binary forms, with or without
819 * modification, are permitted provided that the following conditions
821 * 1. Redistributions of source code must retain the above copyright
822 * notice, this list of conditions and the following disclaimer.
823 * 2. Redistributions in binary form must reproduce the above copyright
824 * notice, this list of conditions and the following disclaimer in the
825 * documentation and/or other materials provided with the distribution.
827 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
828 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
829 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
830 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
831 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
832 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
833 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
834 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
835 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
836 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
837 * THE POSSIBILITY OF SUCH DAMAGE.
840 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
841 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
843 #include <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
844 #include <wtf/RetainPtr.h>
846 @protocol RWIProtocolDatabaseDomainHandler;
848 namespace Inspector {
851 class ObjCInspectorDatabaseBackendDispatcher final : public AlternateDatabaseBackendDispatcher {
853 ObjCInspectorDatabaseBackendDispatcher(id<RWIProtocolDatabaseDomainHandler> handler) { m_delegate = handler; }
854 virtual void executeSQLSyncOptionalReturnValues(long callId, int in_databaseId, const String& in_query) override;
855 virtual void executeSQLAsyncOptionalReturnValues(long callId, int in_databaseId, const String& in_query) override;
856 virtual void executeSQLSync(long callId, int in_databaseId, const String& in_query) override;
857 virtual void executeSQLAsync(long callId, int in_databaseId, const String& in_query) override;
859 RetainPtr<id<RWIProtocolDatabaseDomainHandler>> m_delegate;
862 } // namespace Inspector
864 ### End File: RWIProtocolBackendDispatchers.h
866 ### Begin File: RWIProtocolConfiguration.mm
868 * Copyright (C) 2013 Google Inc. All rights reserved.
869 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
870 * Copyright (C) 2014 University of Washington. All rights reserved.
872 * Redistribution and use in source and binary forms, with or without
873 * modification, are permitted provided that the following conditions
875 * 1. Redistributions of source code must retain the above copyright
876 * notice, this list of conditions and the following disclaimer.
877 * 2. Redistributions in binary form must reproduce the above copyright
878 * notice, this list of conditions and the following disclaimer in the
879 * documentation and/or other materials provided with the distribution.
881 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
882 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
883 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
884 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
885 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
886 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
887 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
888 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
889 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
890 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
891 * THE POSSIBILITY OF SUCH DAMAGE.
894 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
895 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
898 #import "RWIProtocolConfiguration.h"
900 #import "RWIProtocolInternal.h"
901 #import "RWIProtocolBackendDispatchers.h"
902 #import <JavaScriptCore/AlternateDispatchableAgent.h>
903 #import <JavaScriptCore/AugmentableInspectorController.h>
904 #import <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
905 #import <JavaScriptCore/InspectorBackendDispatchers.h>
907 using namespace Inspector;
909 @implementation RWIProtocolConfiguration
911 AugmentableInspectorController* _controller;
912 id<RWIProtocolDatabaseDomainHandler> _databaseHandler;
915 - (instancetype)initWithController:(AugmentableInspectorController*)controller
921 _controller = controller;
927 [_databaseHandler release];
931 - (void)setDatabaseHandler:(id<RWIProtocolDatabaseDomainHandler>)handler
933 if (handler == _databaseHandler)
936 [_databaseHandler release];
937 _databaseHandler = [handler retain];
939 auto alternateDispatcher = std::make_unique<ObjCInspectorDatabaseBackendDispatcher>(handler);
940 auto alternateAgent = std::make_unique<AlternateDispatchableAgent<DatabaseBackendDispatcher, AlternateDatabaseBackendDispatcher>>(ASCIILiteral("Database"), WTF::move(alternateDispatcher));
941 _controller->appendExtraAgent(WTF::move(alternateAgent));
944 - (id<RWIProtocolDatabaseDomainHandler>)databaseHandler
946 return _databaseHandler;
952 ### End File: RWIProtocolConfiguration.mm
954 ### Begin File: RWIProtocolConfiguration.h
956 * Copyright (C) 2013 Google Inc. All rights reserved.
957 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
958 * Copyright (C) 2014 University of Washington. All rights reserved.
960 * Redistribution and use in source and binary forms, with or without
961 * modification, are permitted provided that the following conditions
963 * 1. Redistributions of source code must retain the above copyright
964 * notice, this list of conditions and the following disclaimer.
965 * 2. Redistributions in binary form must reproduce the above copyright
966 * notice, this list of conditions and the following disclaimer in the
967 * documentation and/or other materials provided with the distribution.
969 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
970 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
971 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
972 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
973 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
974 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
975 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
976 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
977 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
978 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
979 * THE POSSIBILITY OF SUCH DAMAGE.
982 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
983 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
985 #import "RWIProtocol.h"
987 __attribute__((visibility ("default")))
988 @interface RWIProtocolConfiguration : NSObject
989 @property (nonatomic, retain, setter=setDatabaseHandler:) id<RWIProtocolDatabaseDomainHandler> databaseHandler;
993 ### End File: RWIProtocolConfiguration.h
995 ### Begin File: RWIProtocolBackendDispatchers.mm
997 * Copyright (C) 2013 Google Inc. All rights reserved.
998 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
999 * Copyright (C) 2014 University of Washington. All rights reserved.
1001 * Redistribution and use in source and binary forms, with or without
1002 * modification, are permitted provided that the following conditions
1004 * 1. Redistributions of source code must retain the above copyright
1005 * notice, this list of conditions and the following disclaimer.
1006 * 2. Redistributions in binary form must reproduce the above copyright
1007 * notice, this list of conditions and the following disclaimer in the
1008 * documentation and/or other materials provided with the distribution.
1010 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1011 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1012 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1013 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1014 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1015 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1016 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1017 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1018 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1019 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1020 * THE POSSIBILITY OF SUCH DAMAGE.
1023 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
1024 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1027 #import "RWIProtocolBackendDispatchers.h"
1029 #include "RWIProtocolInternal.h"
1030 #include "RWIProtocolEnumConversionHelpers.h"
1031 #include <JavaScriptCore/InspectorFrontendChannel.h>
1032 #include <JavaScriptCore/InspectorValues.h>
1034 namespace Inspector {
1036 void ObjCInspectorDatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long callId, int in_databaseId, const String& in_query)
1038 id errorCallback = ^(NSString *error) {
1039 backendDispatcher()->sendResponse(callId, InspectorObject::create(), error);
1042 id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, RWIProtocolDatabaseError **sqlError, RWIProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor *printColor) {
1043 Ref<InspectorObject> resultObject = InspectorObject::create();
1044 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames");
1045 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes");
1046 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values");
1047 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(payload, @"payload");
1048 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(sqlError, @"sqlError");
1049 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(alternateColors, @"alternateColors");
1051 resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(*columnNames));
1053 resultObject->setString(ASCIILiteral("notes"), *notes);
1055 resultObject->setDouble(ASCIILiteral("timestamp"), *timestamp);
1057 resultObject->setObject(ASCIILiteral("values"), [*values toInspectorObject]);
1059 resultObject->setValue(ASCIILiteral("payload"), [*payload toInspectorObject]);
1061 resultObject->setInteger(ASCIILiteral("databaseId"), *databaseId);
1063 resultObject->setObject(ASCIILiteral("sqlError"), [*sqlError toInspectorObject]);
1065 resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(*screenColor));
1066 if (alternateColors)
1067 resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(*alternateColors));
1069 resultObject->setString(ASCIILiteral("printColor"), toProtocolString(*printColor));
1070 backendDispatcher()->sendResponse(callId, WTF::move(resultObject), String());
1073 int o_in_databaseId = in_databaseId;
1074 NSString *o_in_query = in_query;
1076 [m_delegate executeSQLSyncOptionalReturnValuesWithErrorCallback:errorCallback successCallback:successCallback databaseId:o_in_databaseId query:o_in_query];
1079 void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long callId, int in_databaseId, const String& in_query)
1081 id errorCallback = ^(NSString *error) {
1082 backendDispatcher()->sendResponse(callId, InspectorObject::create(), error);
1085 id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, RWIProtocolDatabaseError **sqlError, RWIProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor *printColor) {
1086 Ref<InspectorObject> resultObject = InspectorObject::create();
1087 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames");
1088 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes");
1089 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values");
1090 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(payload, @"payload");
1091 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(sqlError, @"sqlError");
1092 THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(alternateColors, @"alternateColors");
1094 resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(*columnNames));
1096 resultObject->setString(ASCIILiteral("notes"), *notes);
1098 resultObject->setDouble(ASCIILiteral("timestamp"), *timestamp);
1100 resultObject->setObject(ASCIILiteral("values"), [*values toInspectorObject]);
1102 resultObject->setValue(ASCIILiteral("payload"), [*payload toInspectorObject]);
1104 resultObject->setInteger(ASCIILiteral("databaseId"), *databaseId);
1106 resultObject->setObject(ASCIILiteral("sqlError"), [*sqlError toInspectorObject]);
1108 resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(*screenColor));
1109 if (alternateColors)
1110 resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(*alternateColors));
1112 resultObject->setString(ASCIILiteral("printColor"), toProtocolString(*printColor));
1113 backendDispatcher()->sendResponse(callId, WTF::move(resultObject), String());
1116 int o_in_databaseId = in_databaseId;
1117 NSString *o_in_query = in_query;
1119 [m_delegate executeSQLAsyncOptionalReturnValuesWithErrorCallback:errorCallback successCallback:successCallback databaseId:o_in_databaseId query:o_in_query];
1122 void ObjCInspectorDatabaseBackendDispatcher::executeSQLSync(long callId, int in_databaseId, const String& in_query)
1124 id errorCallback = ^(NSString *error) {
1125 backendDispatcher()->sendResponse(callId, InspectorObject::create(), error);
1128 id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, RWIProtocolDatabaseError *sqlError, NSArray/*<NSString>*/ *alternateColors, RWIProtocolDatabasePrimaryColors screenColor, RWIProtocolDatabaseExecuteSQLSyncPrintColor printColor) {
1129 Ref<InspectorObject> resultObject = InspectorObject::create();
1130 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames");
1131 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes");
1132 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values");
1133 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(payload, @"payload");
1134 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(sqlError, @"sqlError");
1135 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(alternateColors, @"alternateColors");
1136 resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(columnNames));
1137 resultObject->setString(ASCIILiteral("notes"), notes);
1138 resultObject->setDouble(ASCIILiteral("timestamp"), timestamp);
1139 resultObject->setObject(ASCIILiteral("values"), [values toInspectorObject]);
1140 resultObject->setValue(ASCIILiteral("payload"), [payload toInspectorObject]);
1141 resultObject->setInteger(ASCIILiteral("databaseId"), databaseId);
1142 resultObject->setObject(ASCIILiteral("sqlError"), [sqlError toInspectorObject]);
1143 resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(alternateColors));
1144 resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(screenColor));
1145 resultObject->setString(ASCIILiteral("printColor"), toProtocolString(printColor));
1146 backendDispatcher()->sendResponse(callId, WTF::move(resultObject), String());
1149 int o_in_databaseId = in_databaseId;
1150 NSString *o_in_query = in_query;
1152 [m_delegate executeSQLSyncWithErrorCallback:errorCallback successCallback:successCallback databaseId:o_in_databaseId query:o_in_query];
1155 void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsync(long callId, int in_databaseId, const String& in_query)
1157 id errorCallback = ^(NSString *error) {
1158 backendDispatcher()->sendResponse(callId, InspectorObject::create(), error);
1161 id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, RWIProtocolDatabaseError *sqlError, RWIProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, RWIProtocolDatabaseExecuteSQLAsyncPrintColor printColor) {
1162 Ref<InspectorObject> resultObject = InspectorObject::create();
1163 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames");
1164 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes");
1165 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values");
1166 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(payload, @"payload");
1167 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(sqlError, @"sqlError");
1168 THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(alternateColors, @"alternateColors");
1169 resultObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(columnNames));
1170 resultObject->setString(ASCIILiteral("notes"), notes);
1171 resultObject->setDouble(ASCIILiteral("timestamp"), timestamp);
1172 resultObject->setObject(ASCIILiteral("values"), [values toInspectorObject]);
1173 resultObject->setValue(ASCIILiteral("payload"), [payload toInspectorObject]);
1174 resultObject->setInteger(ASCIILiteral("databaseId"), databaseId);
1175 resultObject->setObject(ASCIILiteral("sqlError"), [sqlError toInspectorObject]);
1176 resultObject->setString(ASCIILiteral("screenColor"), toProtocolString(screenColor));
1177 resultObject->setArray(ASCIILiteral("alternateColors"), inspectorStringArray(alternateColors));
1178 resultObject->setString(ASCIILiteral("printColor"), toProtocolString(printColor));
1179 backendDispatcher()->sendResponse(callId, WTF::move(resultObject), String());
1182 int o_in_databaseId = in_databaseId;
1183 NSString *o_in_query = in_query;
1185 [m_delegate executeSQLAsyncWithErrorCallback:errorCallback successCallback:successCallback databaseId:o_in_databaseId query:o_in_query];
1189 } // namespace Inspector
1191 ### End File: RWIProtocolBackendDispatchers.mm
1193 ### Begin File: RWIProtocolEnumConversionHelpers.h
1195 * Copyright (C) 2013 Google Inc. All rights reserved.
1196 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
1197 * Copyright (C) 2014 University of Washington. All rights reserved.
1199 * Redistribution and use in source and binary forms, with or without
1200 * modification, are permitted provided that the following conditions
1202 * 1. Redistributions of source code must retain the above copyright
1203 * notice, this list of conditions and the following disclaimer.
1204 * 2. Redistributions in binary form must reproduce the above copyright
1205 * notice, this list of conditions and the following disclaimer in the
1206 * documentation and/or other materials provided with the distribution.
1208 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1209 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1210 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1211 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1212 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1213 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1214 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1215 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1216 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1217 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1218 * THE POSSIBILITY OF SUCH DAMAGE.
1221 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
1222 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1224 #import "RWIProtocolArrayConversionHelpers.h"
1226 namespace Inspector {
1228 template<typename ObjCEnumType>
1229 ObjCEnumType fromProtocolString(const String& value);
1232 inline String toProtocolString(RWIProtocolDatabasePrimaryColors value)
1235 case RWIProtocolDatabasePrimaryColorsRed:
1236 return ASCIILiteral("red");
1237 case RWIProtocolDatabasePrimaryColorsGreen:
1238 return ASCIILiteral("green");
1239 case RWIProtocolDatabasePrimaryColorsBlue:
1240 return ASCIILiteral("blue");
1245 inline RWIProtocolDatabasePrimaryColors fromProtocolString(const String& value)
1248 return RWIProtocolDatabasePrimaryColorsRed;
1249 if (value == "green")
1250 return RWIProtocolDatabasePrimaryColorsGreen;
1251 if (value == "blue")
1252 return RWIProtocolDatabasePrimaryColorsBlue;
1253 ASSERT_NOT_REACHED();
1254 return RWIProtocolDatabasePrimaryColorsRed;
1257 inline String toProtocolString(RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor value)
1260 case RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan:
1261 return ASCIILiteral("cyan");
1262 case RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorMagenta:
1263 return ASCIILiteral("magenta");
1264 case RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorYellow:
1265 return ASCIILiteral("yellow");
1266 case RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorBlack:
1267 return ASCIILiteral("black");
1272 inline RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor fromProtocolString(const String& value)
1274 if (value == "cyan")
1275 return RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan;
1276 if (value == "magenta")
1277 return RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorMagenta;
1278 if (value == "yellow")
1279 return RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorYellow;
1280 if (value == "black")
1281 return RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorBlack;
1282 ASSERT_NOT_REACHED();
1283 return RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan;
1286 inline String toProtocolString(RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor value)
1289 case RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan:
1290 return ASCIILiteral("cyan");
1291 case RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorMagenta:
1292 return ASCIILiteral("magenta");
1293 case RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorYellow:
1294 return ASCIILiteral("yellow");
1295 case RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorBlack:
1296 return ASCIILiteral("black");
1301 inline RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor fromProtocolString(const String& value)
1303 if (value == "cyan")
1304 return RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan;
1305 if (value == "magenta")
1306 return RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorMagenta;
1307 if (value == "yellow")
1308 return RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorYellow;
1309 if (value == "black")
1310 return RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorBlack;
1311 ASSERT_NOT_REACHED();
1312 return RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan;
1315 inline String toProtocolString(RWIProtocolDatabaseExecuteSQLSyncPrintColor value)
1318 case RWIProtocolDatabaseExecuteSQLSyncPrintColorCyan:
1319 return ASCIILiteral("cyan");
1320 case RWIProtocolDatabaseExecuteSQLSyncPrintColorMagenta:
1321 return ASCIILiteral("magenta");
1322 case RWIProtocolDatabaseExecuteSQLSyncPrintColorYellow:
1323 return ASCIILiteral("yellow");
1324 case RWIProtocolDatabaseExecuteSQLSyncPrintColorBlack:
1325 return ASCIILiteral("black");
1330 inline RWIProtocolDatabaseExecuteSQLSyncPrintColor fromProtocolString(const String& value)
1332 if (value == "cyan")
1333 return RWIProtocolDatabaseExecuteSQLSyncPrintColorCyan;
1334 if (value == "magenta")
1335 return RWIProtocolDatabaseExecuteSQLSyncPrintColorMagenta;
1336 if (value == "yellow")
1337 return RWIProtocolDatabaseExecuteSQLSyncPrintColorYellow;
1338 if (value == "black")
1339 return RWIProtocolDatabaseExecuteSQLSyncPrintColorBlack;
1340 ASSERT_NOT_REACHED();
1341 return RWIProtocolDatabaseExecuteSQLSyncPrintColorCyan;
1344 inline String toProtocolString(RWIProtocolDatabaseExecuteSQLAsyncPrintColor value)
1347 case RWIProtocolDatabaseExecuteSQLAsyncPrintColorCyan:
1348 return ASCIILiteral("cyan");
1349 case RWIProtocolDatabaseExecuteSQLAsyncPrintColorMagenta:
1350 return ASCIILiteral("magenta");
1351 case RWIProtocolDatabaseExecuteSQLAsyncPrintColorYellow:
1352 return ASCIILiteral("yellow");
1353 case RWIProtocolDatabaseExecuteSQLAsyncPrintColorBlack:
1354 return ASCIILiteral("black");
1359 inline RWIProtocolDatabaseExecuteSQLAsyncPrintColor fromProtocolString(const String& value)
1361 if (value == "cyan")
1362 return RWIProtocolDatabaseExecuteSQLAsyncPrintColorCyan;
1363 if (value == "magenta")
1364 return RWIProtocolDatabaseExecuteSQLAsyncPrintColorMagenta;
1365 if (value == "yellow")
1366 return RWIProtocolDatabaseExecuteSQLAsyncPrintColorYellow;
1367 if (value == "black")
1368 return RWIProtocolDatabaseExecuteSQLAsyncPrintColorBlack;
1369 ASSERT_NOT_REACHED();
1370 return RWIProtocolDatabaseExecuteSQLAsyncPrintColorCyan;
1373 } // namespace Inspector
1375 ### End File: RWIProtocolEnumConversionHelpers.h
1377 ### Begin File: RWIProtocolEventDispatchers.mm
1379 * Copyright (C) 2013 Google Inc. All rights reserved.
1380 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
1381 * Copyright (C) 2014 University of Washington. All rights reserved.
1383 * Redistribution and use in source and binary forms, with or without
1384 * modification, are permitted provided that the following conditions
1386 * 1. Redistributions of source code must retain the above copyright
1387 * notice, this list of conditions and the following disclaimer.
1388 * 2. Redistributions in binary form must reproduce the above copyright
1389 * notice, this list of conditions and the following disclaimer in the
1390 * documentation and/or other materials provided with the distribution.
1392 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1393 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1394 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1395 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1396 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1397 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1398 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1399 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1400 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1401 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1402 * THE POSSIBILITY OF SUCH DAMAGE.
1405 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
1406 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1409 #import "RWIProtocolInternal.h"
1411 #import "RWIProtocolEnumConversionHelpers.h"
1412 #import <JavaScriptCore/InspectorFrontendChannel.h>
1413 #import <JavaScriptCore/InspectorValues.h>
1415 using namespace Inspector;
1420 ### End File: RWIProtocolEventDispatchers.mm
1422 ### Begin File: RWIProtocol.h
1424 * Copyright (C) 2013 Google Inc. All rights reserved.
1425 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
1426 * Copyright (C) 2014 University of Washington. All rights reserved.
1428 * Redistribution and use in source and binary forms, with or without
1429 * modification, are permitted provided that the following conditions
1431 * 1. Redistributions of source code must retain the above copyright
1432 * notice, this list of conditions and the following disclaimer.
1433 * 2. Redistributions in binary form must reproduce the above copyright
1434 * notice, this list of conditions and the following disclaimer in the
1435 * documentation and/or other materials provided with the distribution.
1437 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1438 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1439 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1440 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1441 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1442 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1443 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1444 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1445 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1446 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1447 * THE POSSIBILITY OF SUCH DAMAGE.
1450 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
1451 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1453 #import <Foundation/Foundation.h>
1455 #import <WebInspector/RWIProtocolJSONObject.h>
1458 @class RWIProtocolDatabaseError;
1461 typedef NS_ENUM(NSInteger, RWIProtocolDatabasePrimaryColors) {
1462 RWIProtocolDatabasePrimaryColorsRed,
1463 RWIProtocolDatabasePrimaryColorsGreen,
1464 RWIProtocolDatabasePrimaryColorsBlue,
1467 typedef NS_ENUM(NSInteger, RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor) {
1468 RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan,
1469 RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorMagenta,
1470 RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorYellow,
1471 RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorBlack,
1474 typedef NS_ENUM(NSInteger, RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor) {
1475 RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan,
1476 RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorMagenta,
1477 RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorYellow,
1478 RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorBlack,
1481 typedef NS_ENUM(NSInteger, RWIProtocolDatabaseExecuteSQLSyncPrintColor) {
1482 RWIProtocolDatabaseExecuteSQLSyncPrintColorCyan,
1483 RWIProtocolDatabaseExecuteSQLSyncPrintColorMagenta,
1484 RWIProtocolDatabaseExecuteSQLSyncPrintColorYellow,
1485 RWIProtocolDatabaseExecuteSQLSyncPrintColorBlack,
1488 typedef NS_ENUM(NSInteger, RWIProtocolDatabaseExecuteSQLAsyncPrintColor) {
1489 RWIProtocolDatabaseExecuteSQLAsyncPrintColorCyan,
1490 RWIProtocolDatabaseExecuteSQLAsyncPrintColorMagenta,
1491 RWIProtocolDatabaseExecuteSQLAsyncPrintColorYellow,
1492 RWIProtocolDatabaseExecuteSQLAsyncPrintColorBlack,
1496 __attribute__((visibility ("default")))
1497 @interface RWIProtocolDatabaseError : RWIProtocolJSONObject
1498 - (instancetype)initWithMessage:(NSString *)message code:(int)code;
1499 /* required */ @property (nonatomic, copy) NSString *message;
1500 /* required */ @property (nonatomic, assign) int code;
1503 @protocol RWIProtocolDatabaseDomainHandler <NSObject>
1505 - (void)executeSQLSyncOptionalReturnValuesWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, RWIProtocolDatabaseError **sqlError, RWIProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor *printColor))successCallback databaseId:(int)databaseId query:(NSString *)query;
1506 - (void)executeSQLAsyncOptionalReturnValuesWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, RWIProtocolDatabaseError **sqlError, RWIProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor *printColor))successCallback databaseId:(int)databaseId query:(NSString *)query;
1507 - (void)executeSQLSyncWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, RWIProtocolDatabaseError *sqlError, NSArray/*<NSString>*/ *alternateColors, RWIProtocolDatabasePrimaryColors screenColor, RWIProtocolDatabaseExecuteSQLSyncPrintColor printColor))successCallback databaseId:(int)databaseId query:(NSString *)query;
1508 - (void)executeSQLAsyncWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, RWIProtocolDatabaseError *sqlError, RWIProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, RWIProtocolDatabaseExecuteSQLAsyncPrintColor printColor))successCallback databaseId:(int)databaseId query:(NSString *)query;
1514 ### End File: RWIProtocol.h
1516 ### Begin File: RWIProtocolTypes.mm
1518 * Copyright (C) 2013 Google Inc. All rights reserved.
1519 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
1520 * Copyright (C) 2014 University of Washington. All rights reserved.
1522 * Redistribution and use in source and binary forms, with or without
1523 * modification, are permitted provided that the following conditions
1525 * 1. Redistributions of source code must retain the above copyright
1526 * notice, this list of conditions and the following disclaimer.
1527 * 2. Redistributions in binary form must reproduce the above copyright
1528 * notice, this list of conditions and the following disclaimer in the
1529 * documentation and/or other materials provided with the distribution.
1531 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1532 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1533 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1534 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1535 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1536 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1537 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1538 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1539 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1540 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1541 * THE POSSIBILITY OF SUCH DAMAGE.
1544 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
1545 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1548 #import "RWIProtocolInternal.h"
1550 #import "RWIProtocolEnumConversionHelpers.h"
1551 #import <JavaScriptCore/InspectorValues.h>
1552 #import <wtf/Assertions.h>
1554 using namespace Inspector;
1557 @implementation RWIProtocolDatabaseError
1559 - (instancetype)initWithMessage:(NSString *)message code:(int)code;
1561 self = [super init];
1565 THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(message, @"message");
1567 self.message = message;
1573 - (void)setMessage:(NSString *)message
1575 [super setString:message forKey:@"message"];
1578 - (NSString *)message
1580 return [super stringForKey:@"message"];
1583 - (void)setCode:(int)code
1585 [super setInteger:code forKey:@"code"];
1590 return [super integerForKey:@"code"];
1596 ### End File: RWIProtocolTypes.mm
1598 ### Begin File: RWIProtocolInternal.h
1600 * Copyright (C) 2013 Google Inc. All rights reserved.
1601 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
1602 * Copyright (C) 2014 University of Washington. All rights reserved.
1604 * Redistribution and use in source and binary forms, with or without
1605 * modification, are permitted provided that the following conditions
1607 * 1. Redistributions of source code must retain the above copyright
1608 * notice, this list of conditions and the following disclaimer.
1609 * 2. Redistributions in binary form must reproduce the above copyright
1610 * notice, this list of conditions and the following disclaimer in the
1611 * documentation and/or other materials provided with the distribution.
1613 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
1614 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1615 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1616 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
1617 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1618 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1619 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1620 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1621 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1622 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1623 * THE POSSIBILITY OF SUCH DAMAGE.
1626 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
1627 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
1629 #import "RWIProtocol.h"
1630 #import "RWIProtocolJSONObjectInternal.h"
1631 #import <JavaScriptCore/AugmentableInspectorController.h>
1632 #import <JavaScriptCore/InspectorValues.h>
1637 ### End File: RWIProtocolInternal.h