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

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

Issue 1677343002: mojom_types.mojom: Changes the name |interface_name| to |service_name| in struct MojomInterface. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Responds to code review. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
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 3bf13715bbce637de57c6b7297c3ed55905af747..4a7d95cbcd4d948110110268fd9aa09d5f06f82b 100755
--- a/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py
@@ -393,12 +393,16 @@ class FileTranslator(object):
== mojom_types_mojom.UserDefinedType.Tags.interface_type)
mojom_interface = mojom_type.interface_type
interface.attributes = self.AttributesFromMojom(mojom_interface)
- interface.service_name = None
- if interface.attributes:
- interface.service_name = interface.attributes.get('ServiceName')
self.PopulateModuleOrImportedFrom(interface, mojom_interface)
- interface.name = mojom_interface.interface_name
+ interface.name = mojom_interface.decl_data.short_name
interface.spec = interface.name
+ interface.service_name = mojom_interface.service_name
+ if interface.attributes:
+ assert interface.service_name == interface.attributes.get(
+ 'ServiceName', None), interface.service_name
+ else:
+ assert interface.service_name is None, interface.service_name
+
# Translate the dictionary of methods into a list of module.Methods.
# In order to have a deterministic ordering we sort by method ordinal.

Powered by Google App Engine
This is Rietveld 408576698