Web Inspector: protocol generator should prefix C++ filenames with the protocol group
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Mar 2016 18:18:50 +0000 (18:18 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Mar 2016 18:18:50 +0000 (18:18 +0000)
commit609b4ef4b373524216b3100e6636f67aa5b38cbd
treed742dc910dcf7e847c9ef8fd0f84931acad1c1ad
parent2229cf0250761fbbaa4c510ff7d9ca444ba824a9
Web Inspector: protocol generator should prefix C++ filenames with the protocol group
https://bugs.webkit.org/show_bug.cgi?id=155859
<rdar://problem/25349859>

Reviewed by Alex Christensen and Joseph Pecoraro.

Source/JavaScriptCore:

Like for generated Objective-C files, we should use the 'protocol group' name
as the prefix for generated C++ files so that headers from different protocol
groups have unambiguous names.

* inspector/scripts/codegen/cpp_generator.py:
(CppGenerator):
(CppGenerator.__init__):
(CppGenerator.protocol_name):
Make all C++ code generators extend the CppGenerator python class and use the
protocol_name() instance method. This matches a recent change to the ObjC generator.

* inspector/scripts/codegen/cpp_generator_templates.py:
(CppGeneratorTemplates):
Drive-by cleanup to use #pragma once instead of header guards.

* inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py:
(CppAlternateBackendDispatcherHeaderGenerator):
(CppAlternateBackendDispatcherHeaderGenerator.__init__):
(CppAlternateBackendDispatcherHeaderGenerator.output_filename):
(CppAlternateBackendDispatcherHeaderGenerator.generate_output):
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:
(CppBackendDispatcherHeaderGenerator):
(CppBackendDispatcherHeaderGenerator.__init__):
(CppBackendDispatcherHeaderGenerator.output_filename):
(CppBackendDispatcherHeaderGenerator.generate_output):
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator):
(CppBackendDispatcherImplementationGenerator.__init__):
(CppBackendDispatcherImplementationGenerator.output_filename):
(CppBackendDispatcherImplementationGenerator.generate_output):
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:
(CppFrontendDispatcherHeaderGenerator):
(CppFrontendDispatcherHeaderGenerator.__init__):
(CppFrontendDispatcherHeaderGenerator.output_filename):
(CppFrontendDispatcherHeaderGenerator.generate_output):
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:
(CppFrontendDispatcherImplementationGenerator):
(CppFrontendDispatcherImplementationGenerator.__init__):
(CppFrontendDispatcherImplementationGenerator.output_filename):
(CppFrontendDispatcherImplementationGenerator.generate_output):
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(CppProtocolTypesHeaderGenerator):
(CppProtocolTypesHeaderGenerator.__init__):
(CppProtocolTypesHeaderGenerator.output_filename):
(CppProtocolTypesHeaderGenerator.generate_output):
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator):
(CppProtocolTypesImplementationGenerator.__init__):
(CppProtocolTypesImplementationGenerator.output_filename):
(CppProtocolTypesImplementationGenerator.generate_output):
Use the protocol_name() instance method to compute generated protocol file names.

* inspector/scripts/codegen/models.py:
Explicitly set the 'protocol_group' for the Inspector protocol.

Rebaseline generator test results.

* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

Source/WebKit2:

Adjust header include and build system paths.

* CMakeLists.txt:
Revert the workaround introduced in r198659 since this change fixes the
underlying issue.

* DerivedSources.make:
* UIProcess/Automation/WebAutomationSession.cpp:
* UIProcess/Automation/WebAutomationSession.h:
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py
Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.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/codegen/models.py
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit2/UIProcess/Automation/WebAutomationSession.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj