Commit 41449ea8 authored by Nico Weber's avatar Nico Weber

Revert "Support typemaps inlined as GN targets"

This reverts commit 2714fec9.

Reason for revert: Breaks GN's MSVC generator, https://crbug.com/1059666

Original change's description:
> Support typemaps inlined as GN targets
> 
> This introduces support for typemaps specified as GN targets, with new
> cpp_typemaps and blink_cpp_typemaps variables that mojom() targets can
> used to reference their typemap rules.
> 
> The underlying work to use the typemap configuration is shared with the
> existing typemap infrastructure, but the net result is that we no longer
> need separate .typemap files or global "bindings configurations" once
> everything is converted to this approach.
> 
> Bug: 1059389
> Change-Id: Id2e5fe765d3c7600a3f50e337fb693f1b3a3cc0a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090716
> Commit-Queue: Ken Rockot <rockot@google.com>
> Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#747990}

TBR=rockot@google.com,oksamyt@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1059389
Change-Id: I060cf9d20c7d03c930296a9e777ab5e8c4e2a7b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2093136Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748211}
parent 9a0bcaf8
This diff is collapsed.
......@@ -81,36 +81,6 @@ def ParseTypemapArgs(args):
return result
def LoadCppTypemapConfigs(paths):
_SUPPORTED_KEYS = set([
'mojom', 'cpp', 'public_headers', 'copyable_pass_by_value',
'force_serialize', 'hashable', 'move_only', 'nullable_is_same_type'
])
configs = {}
for path in paths:
with open(path) as f:
config = json.load(f)
for entry in config['types']:
for key in entry.iterkeys():
if key not in _SUPPORTED_KEYS:
raise IOError('Invalid typemap property "%s" when processing %s' %
(key, path))
configs[entry['mojom']] = {
'typename': entry['cpp'],
'public_headers': config.get('public_headers', []),
'copyable_pass_by_value': entry.get('copyable_pass_by_value',
False),
'force_serialize': entry.get('force_serialize', False),
'hashable': entry.get('hashable', False),
'move_only': entry.get('move_only', False),
'nullable_is_same_type': entry.get('nullable_is_same_type', False),
'non_copyable_non_movable': False,
}
return configs
def ParseTypemap(typemap):
values = {'type_mappings': [], 'public_headers': [], 'traits_headers': []}
for line in typemap.split('\n'):
......@@ -167,21 +137,12 @@ def main():
default=[],
help=('A path to another JSON typemap to merge into the output. '
'This may be repeated to merge multiple typemaps.'))
parser.add_argument(
'--cpp-typemap-config',
type=str,
action='append',
default=[],
dest='cpp_config_paths',
help=('A path to a single JSON-formatted typemap config as emitted by'
'GN when processing a mojom_cpp_typemap build rule.'))
parser.add_argument('--output',
type=str,
required=True,
help='The path to which to write the generated JSON.')
params, typemap_params = parser.parse_known_args()
typemaps = ParseTypemapArgs(typemap_params)
typemaps.update(LoadCppTypemapConfigs(params.cpp_config_paths))
missing = [path for path in params.dependency if not os.path.exists(path)]
if missing:
raise IOError('Missing dependencies: %s' % ', '.join(missing))
......
This diff is collapsed.
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