WebKit Bugzilla
Attachment 358822 Details for
Bug 193331
: Web Inspector: incorrect type signature used for protocol enums in async command results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193331-20190110125600.patch (text/plain), 8.58 KB, created by
BJ Burg
on 2019-01-10 12:56:01 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
BJ Burg
Created:
2019-01-10 12:56:01 PST
Size:
8.58 KB
patch
obsolete
>Subversion Revision: 239839 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index f594ab9310a3708390cefbe2b56a23c9ad7f228e..c87693cea20b1387e6684039c35c1a59537a1327 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-01-10 Brian Burg <bburg@apple.com> >+ >+ Web Inspector: incorrect type signature used for protocol enums in async command results >+ https://bugs.webkit.org/show_bug.cgi?id=193331 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When an enum is returned by an async command, the type signature should be that of the >+ Inspector::Protocol::* generated enum, rather than the underlying primitive type (i.e., String). >+ >+ * inspector/scripts/codegen/cpp_generator.py: >+ (CppGenerator.cpp_type_for_formal_async_parameter): >+ * inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result: >+ Rebaseline generator test results. >+ > 2019-01-10 Brian Burg <bburg@apple.com> > > Rebaseline inspector generator test results after recent changes. >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py b/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py >index 226c0ca637b05bf9941878f8fc804c4983813530..060f0317d548273f3ea8d483184052739a9fb379 100644 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py >@@ -229,9 +229,6 @@ class CppGenerator(Generator): > if isinstance(_type, AliasedType): > _type = _type.aliased_type # Fall through. > >- if isinstance(_type, EnumType): >- _type = _type.primitive_type # Fall through. >- > if isinstance(_type, (ObjectType, ArrayType)): > return 'RefPtr<%s>&&' % CppGenerator.cpp_protocol_type_for_type(_type) > if isinstance(_type, PrimitiveType): >@@ -244,6 +241,16 @@ class CppGenerator(Generator): > return 'const %s&' % cpp_name > else: > return cpp_name >+ if isinstance(_type, EnumType): >+ if _type.is_anonymous: >+ cpp_name = '%sBackendDispatcherHandler::%s' % (_type.type_domain().domain_name, ucfirst(parameter.parameter_name)) >+ else: >+ cpp_name = 'Inspector::Protocol::%s::%s' % (_type.type_domain().domain_name, _type.raw_name()) >+ >+ if parameter.is_optional: >+ return "Optional<%s>" % cpp_name >+ else: >+ return cpp_name > > raise ValueError("Unknown formal async parameter type.") > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result >index 165d13c13b22ebb8b0d41508799c7c32a5e107d2..3e1331878ccdf105e347ae91f53857f715b76df0 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result >@@ -161,14 +161,14 @@ public: > class ExecuteSQLAsyncOptionalReturnValuesCallback : public BackendDispatcher::CallbackBase { > public: > ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<BackendDispatcher>&&, int id); >- void sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, Optional<String>& notes, Optional<double>& timestamp, Optional<JSON::Object>& values, Optional<JSON::Value>& payload, Optional<int>& databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Optional<String>& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Optional<String>& printColor); >+ void sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, Optional<String>& notes, Optional<double>& timestamp, Optional<JSON::Object>& values, Optional<JSON::Value>& payload, Optional<int>& databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Optional<Inspector::Protocol::Database::PrimaryColors> screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Optional<DatabaseBackendDispatcherHandler::PrintColor> printColor); > }; > virtual void executeSQLAsyncOptionalReturnValues(int in_databaseId, const String& in_query, Ref<ExecuteSQLAsyncOptionalReturnValuesCallback>&& callback) = 0; > virtual void executeSQLSync(ErrorString&, int in_databaseId, const String& in_query, RefPtr<JSON::ArrayOf<String>>& out_columnNames, String* out_notes, double* out_timestamp, JSON::Object* out_values, JSON::Value* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, RefPtr<Inspector::Protocol::Database::ColorList>& out_alternateColors, Inspector::Protocol::Database::PrimaryColors* out_screenColor, DatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0; > class ExecuteSQLAsyncCallback : public BackendDispatcher::CallbackBase { > public: > ExecuteSQLAsyncCallback(Ref<BackendDispatcher>&&, int id); >- void sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, const String& notes, double timestamp, JSON::Object values, JSON::Value payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, const String& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, const String& printColor); >+ void sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, const String& notes, double timestamp, JSON::Object values, JSON::Value payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Inspector::Protocol::Database::PrimaryColors screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, DatabaseBackendDispatcherHandler::PrintColor printColor); > }; > virtual void executeSQLAsync(int in_databaseId, const String& in_query, Ref<ExecuteSQLAsyncCallback>&& callback) = 0; > protected: >@@ -336,7 +336,7 @@ void DatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long requestI > > DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<BackendDispatcher>&& backendDispatcher, int id) : BackendDispatcher::CallbackBase(WTFMove(backendDispatcher), id) { } > >-void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, Optional<String>& notes, Optional<double>& timestamp, Optional<JSON::Object>& values, Optional<JSON::Value>& payload, Optional<int>& databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Optional<String>& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Optional<String>& printColor) >+void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, Optional<String>& notes, Optional<double>& timestamp, Optional<JSON::Object>& values, Optional<JSON::Value>& payload, Optional<int>& databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Optional<Inspector::Protocol::Database::PrimaryColors> screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Optional<DatabaseBackendDispatcherHandler::PrintColor> printColor) > { > Ref<JSON::Object> jsonMessage = JSON::Object::create(); > if (columnNames) >@@ -433,7 +433,7 @@ void DatabaseBackendDispatcher::executeSQLSync(long requestId, RefPtr<JSON::Obje > > DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::ExecuteSQLAsyncCallback(Ref<BackendDispatcher>&& backendDispatcher, int id) : BackendDispatcher::CallbackBase(WTFMove(backendDispatcher), id) { } > >-void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, const String& notes, double timestamp, JSON::Object values, JSON::Value payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, const String& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, const String& printColor) >+void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, const String& notes, double timestamp, JSON::Object values, JSON::Value payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Inspector::Protocol::Database::PrimaryColors screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, DatabaseBackendDispatcherHandler::PrintColor printColor) > { > Ref<JSON::Object> jsonMessage = JSON::Object::create(); > jsonMessage->setArray("columnNames"_s, columnNames);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193331
: 358822