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

Unified Diff: mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py

Issue 1522583003: New Mojom compiler: Assign a meaningful spec string instead of 'dummyspec' because it turns out it… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
index dd4a65788ac25b7ddd5b311e7a96fa5212b88ae5..cb6f4551c5daaf562513fd7d8134bf61b762e31a 100755
--- a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
@@ -333,6 +333,9 @@ class FileTranslator(object):
"""
module_type.attributes = self.AttributesFromMojom(mojom)
module_type.name = mojom.decl_data.short_name
+ module_type.spec = mojom.decl_data.full_identifier
+ if module_type.spec == None:
+ module_type.spec = mojom.decl_data.short_name
self.PopulateModuleOrImportedFrom(module_type, mojom)
def PopulateModuleOrImportedFrom(self, module_type, mojom):
@@ -387,6 +390,8 @@ class FileTranslator(object):
interface.service_name = interface.attributes.get('ServiceName')
self.PopulateModuleOrImportedFrom(interface, mojom_interface)
interface.name = mojom_interface.interface_name
+ interface.spec = interface.name
+
interface.methods = [self.MethodFromMojom(mojom_method, interface)
for mojom_method in mojom_interface.methods.itervalues()]
self.PopulateContainedDeclarationsFromMojom(
@@ -759,10 +764,11 @@ class FileTranslator(object):
module_type_class, from_mojom = user_defined_types[mojom_type.tag]
module_type = module_type_class()
- # module.py expects the spec of user defined types to be set when
- # constructing map, array, and interface request types, but the value
- # appears unimportant.
- module_type.spec = 'dummyspec'
+ if module_type.spec == None:
+ # module.py expects the spec of user defined types to be set when
+ # constructing map, array, and interface request types, but the value
+ # appears to be only used for error messages.
+ module_type.spec = 'dummyspec'
# It is necessary to cache the type object before populating it since in
# the course of populating it, it may be necessary to resolve that same
« no previous file with comments | « no previous file | mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698