Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: mojo/public/tools/bindings/pylib/mojom/generate/data.py

Issue 844433003: Revert "Generate some of the C++ bindings for mojom tagged unions." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # TODO(vtl): "data" is a pretty vague name. Rename it? 5 # TODO(vtl): "data" is a pretty vague name. Rename it?
6 6
7 import copy 7 import copy
8 8
9 import module as mojom 9 import module as mojom
10 10
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 module.imports = map( 377 module.imports = map(
378 lambda import_data: ImportFromData(module, import_data), 378 lambda import_data: ImportFromData(module, import_data),
379 data['imports']) 379 data['imports'])
380 380
381 # First pass collects kinds. 381 # First pass collects kinds.
382 module.enums = map( 382 module.enums = map(
383 lambda enum: EnumFromData(module, enum, None), data['enums']) 383 lambda enum: EnumFromData(module, enum, None), data['enums'])
384 module.structs = map( 384 module.structs = map(
385 lambda struct: StructFromData(module, struct), data['structs']) 385 lambda struct: StructFromData(module, struct), data['structs'])
386 module.unions = map( 386 module.unions = map(
387 lambda union: UnionFromData(module, union), data.get('unions', [])) 387 lambda union: UnionFromData(module, struct), data.get('unions', []))
388 module.interfaces = map( 388 module.interfaces = map(
389 lambda interface: InterfaceFromData(module, interface), 389 lambda interface: InterfaceFromData(module, interface),
390 data['interfaces']) 390 data['interfaces'])
391 module.constants = map( 391 module.constants = map(
392 lambda constant: ConstantFromData(module, constant, None), 392 lambda constant: ConstantFromData(module, constant, None),
393 data['constants']) 393 data['constants'])
394 394
395 # Second pass expands fields and methods. This allows fields and parameters 395 # Second pass expands fields and methods. This allows fields and parameters
396 # to refer to kinds defined anywhere in the mojom. 396 # to refer to kinds defined anywhere in the mojom.
397 for struct in module.structs: 397 for struct in module.structs:
(...skipping 13 matching lines...) Expand all
411 411
412 def OrderedModuleFromData(data): 412 def OrderedModuleFromData(data):
413 module = ModuleFromData(data) 413 module = ModuleFromData(data)
414 for interface in module.interfaces: 414 for interface in module.interfaces:
415 next_ordinal = 0 415 next_ordinal = 0
416 for method in interface.methods: 416 for method in interface.methods:
417 if method.ordinal is None: 417 if method.ordinal is None:
418 method.ordinal = next_ordinal 418 method.ordinal = next_ordinal
419 next_ordinal = method.ordinal + 1 419 next_ordinal = method.ordinal + 1
420 return module 420 return module
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/mojom.gni ('k') | mojo/public/tools/bindings/pylib/mojom/generate/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698