Commit 8ee63d6c authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

make_names.py: Drop support of namespace fields including capital letters

Bug: 889726
Change-Id: I7994d14f8651f0ebcacc4e7485eabe4f28379dea
Reviewed-on: https://chromium-review.googlesource.com/c/1317419Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605494}
parent 5b638caa
...@@ -37,15 +37,6 @@ import template_expander ...@@ -37,15 +37,6 @@ import template_expander
import name_utilities import name_utilities
def _legacy_symbol(entry):
if entry['Symbol'] is not None:
return entry['Symbol']
# FIXME: Remove this special case for the ugly x-webkit-foo attributes.
if entry['name'].original.startswith('-webkit-'):
return entry['name'].original.replace('-', '_')[1:]
return name_utilities.cpp_name(entry).replace('-', '_').replace(' ', '_')
def _symbol(entry): def _symbol(entry):
if entry['Symbol'] is not None: if entry['Symbol'] is not None:
return entry['Symbol'] return entry['Symbol']
...@@ -70,7 +61,6 @@ class MakeNamesWriter(json5_generator.Writer): ...@@ -70,7 +61,6 @@ class MakeNamesWriter(json5_generator.Writer):
filters = { filters = {
'cpp_name': name_utilities.cpp_name, 'cpp_name': name_utilities.cpp_name,
'hash': hasher.hash, 'hash': hasher.hash,
'script_name': name_utilities.script_name,
'symbol': _symbol, 'symbol': _symbol,
} }
...@@ -81,12 +71,13 @@ class MakeNamesWriter(json5_generator.Writer): ...@@ -81,12 +71,13 @@ class MakeNamesWriter(json5_generator.Writer):
suffix = self.json5_file.metadata['suffix'].strip('"') suffix = self.json5_file.metadata['suffix'].strip('"')
export = self.json5_file.metadata['export'].strip('"') export = self.json5_file.metadata['export'].strip('"')
assert namespace, 'A namespace is required.' if not namespace:
# TODO(tkent): Remove the following condition. Namespace fields of all raise ValueError('A namespace is required.')
# foo_names.json5 should be lower-cased. crbug.com/889726 # https://google.github.io/styleguide/cppguide.html#Namespace_Names
if namespace.lower() != namespace: if namespace.lower() != namespace:
namespace = namespace + 'Names' raise ValueError('The namespace field should be lower-cased. ' +
MakeNamesWriter.filters['symbol'] = _legacy_symbol '"%s" is specified in %s.' %
(namespace, json5_file_path))
basename, _ = os.path.splitext(os.path.basename(json5_file_path[0])) basename, _ = os.path.splitext(os.path.basename(json5_file_path[0]))
self._outputs = { self._outputs = {
......
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