Web Inspector: use JSON::{Array,Object,Value} instead of Inspector{Array,Object,Value}
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Nov 2017 13:02:13 +0000 (13:02 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Nov 2017 13:02:13 +0000 (13:02 +0000)
commit4d7e3a0682251400b1a63755c9520d55fbb707c3
treef4d8ad0e4ab50f8c52dcf46d41aee544a82f1420
parentfde2defd5ced23fb0cf8e09531d28e4f51e21856
Web Inspector: use JSON::{Array,Object,Value} instead of Inspector{Array,Object,Value}
https://bugs.webkit.org/show_bug.cgi?id=173619

Source/JavaScriptCore:

Reviewed by Alex Christensen and Brian Burg.

Eventually all classes used for our JSON-RPC message passing should be outside
of the Inspector namespace since the protocol is used outside of Inspector code.
This will also allow us to unify the primitive JSON types with parameteric types
like Inspector::Protocol::Array<T> and other protocol-related types which don't
need to be in the Inspector namespace.

Start this refactoring off by making JSON::Value a typedef for InspectorValue. In following
patches, other clients will move to use JSON::Value and friends. When all uses are
changed, the actual implementation will be renamed. This patch just focuses on the typedef
and making changes in generated protocol code.

Original patch by Brian Burg, rebased and updated by me.

* inspector/InspectorValues.cpp:
* inspector/InspectorValues.h:
* inspector/scripts/codegen/cpp_generator.py:
(CppGenerator.cpp_protocol_type_for_type):
(CppGenerator.cpp_type_for_unchecked_formal_in_parameter):
(CppGenerator.cpp_type_for_type_with_name):
(CppGenerator.cpp_type_for_stack_in_parameter):
* inspector/scripts/codegen/cpp_generator_templates.py:
(void):
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(_generate_class_for_object_declaration):
(_generate_forward_declarations_for_binding_traits):
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration):
(CppProtocolTypesImplementationGenerator._generate_assertion_for_enum):
* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/domain-availability.json-result:
* inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result:
* inspector/scripts/tests/generic/expected/worker-supported-domains.json-result:
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:

Tools:

Reviewed by Brian Burg.

Update InspectorValue unit tests to use JSON namespace and add more basic tests to cover all the API.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/JavaScriptCore/InspectorValue.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InspectorValues.cpp
Source/JavaScriptCore/inspector/InspectorValues.h
Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py
Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/worker-supported-domains.json-result
Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result
Tools/ChangeLog
Tools/TestWebKitAPI/PlatformGTK.cmake
Tools/TestWebKitAPI/Tests/JavaScriptCore/InspectorValue.cpp