Commit b76a5d49 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

make_event_factory.py: Do not generate event_headers.h and event_modules_headers.h.

Only event_factory.cc and event_modules_factory.cc need to depend on
each of event_*headers.h. So we don't need to generate header files,
and can fold them into *.cc.

Change-Id: I38b1c4a646045d66f8c4fbf49f12de93724c9ec0
Reviewed-on: https://chromium-review.googlesource.com/681094Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504260}
parent 12953e19
......@@ -72,7 +72,6 @@ make_event_factory("event_modules") {
in_files = [ "$root_gen_dir/blink/EventModulesInterfaces.json5" ]
outputs = [
"$blink_modules_output_dir/event_modules_factory.cc",
"$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 += [
......
......@@ -36,17 +36,6 @@ import name_utilities
import template_expander
HEADER_TEMPLATE = """%(license)s
#ifndef Event%(suffix)sHeaders_h
#define Event%(suffix)sHeaders_h
%(base_header_for_suffix)s
%(includes)s
#endif // Event%(suffix)sHeaders_h
"""
# All events on the following whitelist are matched case-insensitively
# in createEvent.
#
......@@ -124,9 +113,7 @@ class EventFactoryWriter(json5_generator.Writer):
assert self.namespace == 'Event', 'namespace field should be "Event".'
self.suffix = self.json5_file.metadata['suffix'].strip('"')
snake_suffix = (self.suffix.lower() + '_') if self.suffix else ''
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,
}
......@@ -151,26 +138,14 @@ class EventFactoryWriter(json5_generator.Writer):
# Avoid duplicate includes.
if cpp_name in includes:
continue
includes[cpp_name] = ('#include "%s"' %
self._headers_header_include_path(entry))
return includes.values()
def generate_headers_header(self):
base_header_for_suffix = ''
if self.suffix:
base_header_for_suffix = '\n#include "core/event_headers.h"\n'
return HEADER_TEMPLATE % {
'input_files': self._input_files,
'license': license.license_for_generated_cpp(),
'suffix': self.suffix,
'base_header_for_suffix': base_header_for_suffix,
'includes': '\n'.join(self._headers_header_includes(self.json5_file.name_dictionaries)),
}
includes[cpp_name] = self._headers_header_include_path(entry)
return sorted(includes.values())
@template_expander.use_jinja('templates/EventFactory.cpp.tmpl', filters=filters)
def generate_implementation(self):
return {
'headers_header_basename': self._headers_header_basename,
'include_header_paths': self._headers_header_includes(
self.json5_file.name_dictionaries),
'input_files': self._input_files,
'suffix': self.suffix,
'events': self.json5_file.name_dictionaries,
......
......@@ -10,7 +10,9 @@
{% endif %}
#include "core/frame/Deprecation.h"
#include "{{headers_header_basename}}"
{% for header_path in include_header_paths %}
#include "{{header_path}}"
{% endfor %}
#include "platform/runtime_enabled_features.h"
namespace blink {
......
......@@ -901,7 +901,6 @@ make_event_factory("make_core_generated_event_factory") {
]
outputs = [
"$blink_core_output_dir/event_factory.cc",
"$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