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

Unified Diff: mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl

Issue 1457383005: Require an explicit ServiceName annotation for interfaces in Java (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 1 month 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/generators/java_templates/interface_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl
index 527e15fbfcf5d6d7581a115f22900715a6076717..0aec7fac5d9e80620a47e0e100a760ee564ee8f6 100644
--- a/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl
@@ -51,16 +51,18 @@ org.chromium.mojo.bindings.MessageHeader.MESSAGE_IS_RESPONSE_FLAG
{%- endmacro -%}
{%- macro manager_class(interface, fully_qualified=False) -%}
-{% if fully_qualified %}org.chromium.mojo.bindings.Interface.{% endif %}Manager<{{interface|name}}, {{interface|name}}.Proxy>
+{% if fully_qualified %}org.chromium.mojo.bindings.Interface.{% endif %}{% if interface.service_name %}Named{% endif %}Manager<{{interface|name}}, {{interface|name}}.Proxy>
{%- endmacro -%}
{%- macro manager_def(interface) -%}
public static final {{manager_class(interface, True)}} MANAGER =
new {{manager_class(interface, True)}}() {
+{% if interface.service_name %}
public String getName() {
- return "{{namespace|replace(".","::")}}::{{interface.name}}";
+ return "{{interface.service_name}}";
}
+{% endif %}
public int getVersion() {
return {{interface.version}};
« no previous file with comments | « mojo/public/java/bindings/src/org/chromium/mojo/bindings/Interface.java ('k') | mojo/services/camera/interfaces/camera.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698