Commit 080d1870 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Rename output filenames of make_event_factory.py

One of output files was "Event.cpp". move_blink_source.py confused with
it because it was same as core/dom/events/Event.cpp. Also it was not a
proper name because the generated "Event.cpp" was an implementation of
blink::EventFactory class.

This CL renames Event(Modules).cpp to event_(modules_)factory.cc to
match to C++ class names, and prepare for the great Blink mv. Also,
renames Event(Modules)Headers.h to event_(modules_)headers.h for
consistency.

Bug: 578345
Change-Id: Ie3c6e951a01ca88376527f6f5c32357d4707016b
Reviewed-on: https://chromium-review.googlesource.com/670222
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502784}
parent 5c0d0363
...@@ -70,8 +70,8 @@ make_event_factory("event_modules") { ...@@ -70,8 +70,8 @@ make_event_factory("event_modules") {
visibility = [ ":*" ] visibility = [ ":*" ]
in_files = [ "$root_gen_dir/blink/EventModulesInterfaces.json5" ] in_files = [ "$root_gen_dir/blink/EventModulesInterfaces.json5" ]
outputs = [ outputs = [
"$blink_modules_output_dir/EventModules.cpp", "$blink_modules_output_dir/event_modules_factory.cc",
"$blink_modules_output_dir/EventModulesHeaders.h", "$blink_modules_output_dir/event_modules_headers.h",
] ]
deps = make_core_generated_deps + [ "//third_party/WebKit/Source/bindings/modules:modules_bindings_generated_event_interfaces" ] deps = make_core_generated_deps + [ "//third_party/WebKit/Source/bindings/modules:modules_bindings_generated_event_interfaces" ]
deps += [ deps += [
......
...@@ -123,9 +123,12 @@ class EventFactoryWriter(json5_generator.Writer): ...@@ -123,9 +123,12 @@ class EventFactoryWriter(json5_generator.Writer):
self.namespace = self.json5_file.metadata['namespace'].strip('"') self.namespace = self.json5_file.metadata['namespace'].strip('"')
assert self.namespace == 'Event', 'namespace field should be "Event".' assert self.namespace == 'Event', 'namespace field should be "Event".'
self.suffix = self.json5_file.metadata['suffix'].strip('"') self.suffix = self.json5_file.metadata['suffix'].strip('"')
self._outputs = {('Event%sHeaders.h' % self.suffix): self.generate_headers_header, snake_suffix = (self.suffix.lower() + '_') if self.suffix else ''
('Event%s.cpp' % self.suffix): self.generate_implementation, self._headers_header_basename = 'event_%sheaders.h' % snake_suffix
} self._outputs = {
self._headers_header_basename: self.generate_headers_header,
('event_%sfactory.cc' % snake_suffix): self.generate_implementation,
}
def _fatal(self, message): def _fatal(self, message):
print 'FATAL ERROR: ' + message print 'FATAL ERROR: ' + message
...@@ -163,7 +166,7 @@ class EventFactoryWriter(json5_generator.Writer): ...@@ -163,7 +166,7 @@ class EventFactoryWriter(json5_generator.Writer):
def generate_headers_header(self): def generate_headers_header(self):
base_header_for_suffix = '' base_header_for_suffix = ''
if self.suffix: if self.suffix:
base_header_for_suffix = '\n#include "core/EventHeaders.h"\n' base_header_for_suffix = '\n#include "core/event_headers.h"\n'
return HEADER_TEMPLATE % { return HEADER_TEMPLATE % {
'input_files': self._input_files, 'input_files': self._input_files,
'license': license.license_for_generated_cpp(), 'license': license.license_for_generated_cpp(),
...@@ -175,6 +178,7 @@ class EventFactoryWriter(json5_generator.Writer): ...@@ -175,6 +178,7 @@ class EventFactoryWriter(json5_generator.Writer):
@template_expander.use_jinja('templates/EventFactory.cpp.tmpl', filters=filters) @template_expander.use_jinja('templates/EventFactory.cpp.tmpl', filters=filters)
def generate_implementation(self): def generate_implementation(self):
return { return {
'headers_header_basename': self._headers_header_basename,
'input_files': self._input_files, 'input_files': self._input_files,
'suffix': self.suffix, 'suffix': self.suffix,
'events': self.json5_file.name_dictionaries, 'events': self.json5_file.name_dictionaries,
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include "core/events/EventFactory.h" #include "core/events/EventFactory.h"
{% endif %} {% endif %}
#include "Event{{suffix}}Headers.h"
#include "core/frame/Deprecation.h" #include "core/frame/Deprecation.h"
#include "{{headers_header_basename}}"
#include "platform/runtime_enabled_features.h" #include "platform/runtime_enabled_features.h"
namespace blink { namespace blink {
......
...@@ -900,8 +900,8 @@ make_event_factory("make_core_generated_event_factory") { ...@@ -900,8 +900,8 @@ make_event_factory("make_core_generated_event_factory") {
"events/EventAliases.json5", "events/EventAliases.json5",
] ]
outputs = [ outputs = [
"$blink_core_output_dir/Event.cpp", "$blink_core_output_dir/event_factory.cc",
"$blink_core_output_dir/EventHeaders.h", "$blink_core_output_dir/event_headers.h",
] ]
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment